I2C / SMBus on Teensy-3.1: External pullups needed?

Status
Not open for further replies.

spacewrench

Active member
I'm trying to get a Teensy-3.1 talking to an SMBus chip on a board I designed & built myself. I don't have pullups on the SCK and SDA lines; I was planning to bitbang with GPIO and use the internal pullups. (I don't need particularly high speed, and it's only the Teensy and one SMBus slave). However, coding the bitbanging is tedious, and I was wondering if I could use the I2C peripheral to make things easier on myself.

Does anybody know if the Teensy internal GPIO pullups will work with the I2C device?

Thanks!
 
Thanks...I soldered in some pullups and made a little progress with bitbanging code. I can apparently write to the slave registers, but my read code doesn't trigger the slave to deliver data onto SDA when I clock it. I'm using a PAC1720 current monitor, and the manual has this description of the READ_BYTE protocol.
PAC1720-SMBus-Protocol.png
Can anybody explain what the "START 0->1" section means? I send the slave address, the register address, the slave address again with the RD bit set, and then clock 9 more times (expecting to receive data) but I get all 1's, followed by an ACK from the slave in the 9th clock period. Halp!!
 
Haven't worked with I2C at this level but figure 3.1 shows start and stop zero to one and one to zero transitions occurring during clock high times as described para 3.1.1. Normal data transitions happen during clock low period.
 
Got it...the "Start 0->1" calls for a REstart between the two halves of the command. SCK is low between successive 9-bit interactions, so you have to raise it, then pull SDA low as a restart bit, then lower it again. Now that I know what successful SMBus communication looks like, I can try to get the I2C peripheral to do it automatically. Well, as soon as I find & fix all the parts that I let the magic smoke out of just now... :-(
 
Status
Not open for further replies.
Back
Top