Quote:
I'm about to test some of this in the next 30 minutes. I'm only using these as an output so I don't believe I need the pullups due to the fact I'll never read any pins. If I were to read the pins, then I would need a pullup, correct? & if that was the case, I could activate them internally? Thanks for all the help again! I do appreciate your time. & is it okay to use > 3.3k pullups on the data lines? Just not less?
Hi Jesse,
Pull ups are optional. You would use them when the ports are in input mode to get a defined level. For example, a pushbutton connected between GND and one of the inputpins would result in a '0' when you push the switch, but without a pullup the pinlevel is undefined when you dont push the switch. So a pullup provides a solid '1' when the switch is not operated. You still get a solid '0' on the pin when you push the switch, the max current between 3V3 and GND is limited by the pullup.
It is OK to use >3K3 pullups on the SDA and SCL, but beware that the values should not really be above 4K7. Remember that the I2C bus has open collector or open drain portpins. That means the mbed will only pull the level to '0'. It can not force a '1' on the bus. Instead it just lets the bus float. The pullup causes it to go high. A large pullup will result in slow rise times to overcome the capacitance of the wires. That leads to a slow bus, flaky levels, noise problems etc.
On the other hand, the pullup value can not be too low to avoid a high current when the I2C port wants to pull it low. That leads to short circuits, power dissipation etc. So, normally 3K3 is a good value.
Hey guys, I have a MCP23017 chip and I'm trying to understand the syntax. I have the most updated library found here:
http://mbed.org/users/wim/libraries/MCP23017/m5cz32
What do I do for a basic initialization, and write High/Low? That's all I really need. I don't understand what is going on in the program below:
What's the basic initialization and method for writing high/low? Thanks.