Pages: [1]   Go Down
Author Topic: MCP23017 pullup resistors  (Read 1096 times)
0 Members and 1 Guest are viewing this topic.
germany
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hope this is the right category.

First: The MCP23017 work fine for me with switch buttons with 220R. It would be much easier to use the internal pullup resistors, but I do not get this to work.  I simply want to extend this http://arduino.cc/en/Tutorial/InputPullupSerial to the MCP23017-Inputs. Is this possible?

I found this code:
Code:
Wire.beginTransmission(0x20); //23017 address
Wire.write(0x12); // set MCP23017 memory pointer to GPIOA address
Wire.write(0xFF); //enable pullup???
Wire.endTransmission();
source: http://www.gammon.com.au/forum/?id=10945

but that does not seem to work and I cannot find a better tutorial.
« Last Edit: February 13, 2013, 06:01:00 pm by Lurkars » Logged

hardware: Arduino Uno R3
project: DJ MIDI controller http://bombatuino.wordpress.com

Cumming, GA
Offline Offline
Edison Member
*
Karma: 18
Posts: 1627
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The chip documentation reads "corresponding port pin is internally pulled up with a 100 kΩ resistor"  when you set the register 0x0C  (not sure why you have 0x12)  to "1".  In your case "all" due to the 0xFF.

Nick's Example Shows :
Code:
expanderWriteBoth (GPPUA, 0xFF);   // pull-up resistor for switch - both ports

...where GPPUA is defined as : #define GPPUA    0x0C

So maybe that is part of the issue?

To me, 100K is a damn weak pull up... so weak in fact  that I would tend to ignore it even exists.
Logged

germany
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, the register address was wrong, I thought it act like the arduino internal pull-up by just writing HIGH to all inputs, that's why I used 0x12. Reading the documentation would have helped. It all work fine now. 100K is bigger than the internal pullup of the arduino pins with 20K, and I just connect switch buttons to it, so I think it will work for me. So thank you, problem is solved!

Logged

hardware: Arduino Uno R3
project: DJ MIDI controller http://bombatuino.wordpress.com

Pages: [1]   Go Up
Jump to: