Help with I2C circuit
mynet43
Posts: 644
I have a propeller circuit which is designed to drive two I2C devices:
1. The usual EEPROM AT24C512.
2. A TI Stereo Codec: TLV320AIC3101.
The SCL and SDA lines are tied together on the two devices.
I have both the SCL and SDA lines pulled up to 3.3V with 10K resistors.
The propeller seems to work fine when I download a program to memory and run it. VGA etc. work fine.
The problem is when I try to download to EEPROM, either it gets an error loading to the EEPROM or it appears to load but fails to run from the EEPROM when I do a reset or power cycle. Almost like it's marginal.
Does anyone have experience with this kind of situation?
Is it possible I should lower the pull-up resistance when I have multiple devices? E.g. 5K instead of 10K pull ups?
Any help would be appreciated.
Jim
1. The usual EEPROM AT24C512.
2. A TI Stereo Codec: TLV320AIC3101.
The SCL and SDA lines are tied together on the two devices.
I have both the SCL and SDA lines pulled up to 3.3V with 10K resistors.
The propeller seems to work fine when I download a program to memory and run it. VGA etc. work fine.
The problem is when I try to download to EEPROM, either it gets an error loading to the EEPROM or it appears to load but fails to run from the EEPROM when I do a reset or power cycle. Almost like it's marginal.
Does anyone have experience with this kind of situation?
Is it possible I should lower the pull-up resistance when I have multiple devices? E.g. 5K instead of 10K pull ups?
Any help would be appreciated.
Jim
Comments
I think the power distribution is OK, I have a separate 1.8V regulator for the DVDD line. The others are all driven by the 3.3V rail.
Jim
It's difficult to remove the TI chip, since both it and the Propeller are QFN devices on the circuit board. I can unsolder it but that's kind of a pain with QFN chips (no pins sticking out). And very difficult to resolder [noparse]:)[/noparse]
I may have to do that if Mike's suggestion doesn't work.
Jim
I didn't have any 4.7K resistors so I just soldered 10K SM resistors on top of the existing ones to give my two 10K in parallel, which is 5K pull-up for each I2C line.
When I powered it up, it started running, meaning that the last time I programmed the EEPROM it worked but just couldn't load it back into the memory. Interesting.
Seems to be solid now.
Thanks!
Jim
Are you aware of some guideline or rule for estimating the required pull-up resistance when adding more devices to the I2C buss? The 5K seemed to work fine this time but it's very frustrating to end up with a marginal circuit... I can see where the capacitance would also increase as a function of the trace length and spacing and device type.
Thanks for the help.
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Here www.i2c-bus.org/Termination-versus-Capacitance.530.0.html are diagram's showing the relationships more graphically. It seems that 4k7 is recommended for the worst case 400pF , @100kHz. The overall capacitance in the system of the OP should be 1/10 of this. Thus a 47k pullup should suffice, a 10k should do well.
I am not very happy that is now works. I do not understand why it should in the first place!
The Prop Demo board uses a 10K pull-up, which seems to work fine. I've used this on several Prop boards I've designed that have only one I2C device (24LCXXX) and they always seem to work fine. When I added another device, the I2C became marginal and wouldn't work for the EEPROM. When I reduced the pull-up to 5K, everything worked and became solid. It appears to be related to the number of devices (or total capacitance?). Any thoughts?
@ deSilva,
I liked your link. I used it to find the attached charts in the I2C spec. They show the max and min pull-up values. These seem to make sense. What do you think?
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
I am not happy that all this should work with 4k7 and not with 10k....
The traces are not optimally routed, so they are probably about 2" long. This may account for the added capacitance. When I mod the board, I'll try to minimize the trace length for the I2C.
Right now it's running OK with 5K pull-ups, I can talk to both I2C devices. However, I'll probably lower the pull-up values just to make sure.
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
All I have is a cheap capacitance meter.
With that, I measure about 80nF to ground on both lines (SCL/SDA). This seems about 1000 times too large!
If it's really that high, I don't see how it would work at all. I can't see anything wrong with the traces on a bare board.
It seems to be working fine with the 5K pull-ups.
Sorry I couldn't get you better data. Let me know if you think of anything.
Thanks,
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Thanks for the feedback. The eeprom is located on the BoardTop picture at the top of the board to the left of the Prop. It's an 8 pin SM part.
Good point about the ground pad of the TI chip. I did put solder paste on the ground pad before I soldered it, which should have worked, since the whole board was heated. If you look on the back of the board, you can see four holes thru the board on the back of the TI chip. In looking thru these, it doesn't look like there's much solder there. The good news is that I can solder it thru those holes. I'll try it and let you know if it helps.
The chip does have a digital core / I/O ground (pin 6, DVSS) which is tied to ground. I just noticed that the spec says to connect the thermal pad to DRVSS, the analog output driver ground. I think I probably missed this. Do you think this could cause the problem? I'll connect it and see what happens. Right now it's not connected to anything.
Thanks for your help.
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
These didn't help. The board still works and I still measure about 80nF on the two lines [noparse]:([/noparse]
Here's the schematic. It's basically designed to be an evaluation board for the TI chip running with the Prop but it also has the Prop sound circuit included. Configuration of devices and mic/headphone I/O is handled by jumpers.
FYI, the EEPROM and the TI chip ARE on the same I2C bus.
Here's the schematic. Thanks so much for your help.
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
I think I'll lower the pull-ups to 2.2K to provide a little margin of safety.
Jim
I replaced the 5K I2C pull-ups with 2.2K resistors. When I did this, I immediately started getting EEPROM programming errors and intermittent results. In fact, when it did run, it couldn't always find the TI chip with I2C.
When I replaced the 2.2K with 3.3K resistors, everything started working fine and seems solid.
Food for thought. Don't go too low with the pull-up resistors...
Jim
P.S. Paul, I think you're right about the capacitance on my board, it's really high. Anyone laying out a board with I2C devices should be careful to minimize the I2C trace lengths.
Tom
Well, I did a lot of scoping the last weekend...
The small PASM I2C driver is now running!
Two I2C devices on a very unclean solderless breadboard, 10k pull-up.
There was a rise time of SDA of 3 µs (3µs/10k = 300pF) The (driven) SCL was fine! I increased the clock to 200 kHz (marginaly for that rise time), and the port expander chip I was addressing still worked fine (though specified to 100kHz only). Changing the pull-up to 4k7 reduced the rise time of SDA to 1.5µs as expected, without any good or bad influence.
The funny thing is this above 100pF .. this is MUCH more than I would have expected. I shall test with some more chips....