I'm pulling my hair out trying to track down a problem I've encountered using two 28x2 chips. I have one set up as a master and the other as slave. I have the master periodically check slave status by reading scratchpad location 0 and I have the master send commands to the slave by writing to location 1. So far so good. It worked great on my breadboard and "sometimes" works on my PCB board. When it works, it works well. However, on my PCB board, when it doesn't work, my master keeps reading either 255 or 0, neither of which values are at the slave location. I know the 255 is documented as an "error" condition. But I see no reference to 0.
The mystery is, why should it 'sometimes' work. I've checked that I have the proper pullups and even went so far as to replace them. I swapped out the 28x2 chips for new ones, which worked at first and then seemed to "degrade" to the same problem. I have a DS1307 RTC on the same i2c bus and both master and slave can talk to that just fine. I've checked and double checked that master and slave are both in the correct mode when communicating and that the scratchpad addresses are correct. I even had the master read the first 25 scratchpad locations, which all return the same nonsense 255 or 0 when the problem occurs.
I'm at wits end trying to track down this problem and would appreciate any suggestions anyone can think of. I'd share the circuit and code, but it's somewhat complex as I'm using 3 slots on the master and 2 slots on the slave all matched up to one controller board running 3 output boards. So maybe we can start with some general ideas to see if we can't home in on the problem. Just for information, I also have a 74150 multiplexer, a CD4060 counter, and a LM1117 voltage regulator on the PCB. And one final point. My master runs at the 8MHz default speed, but my slave idles at 8MHz, but "works" at 64MHz using an external 16MHz resonator. Slave speed seems to have no impact on reading the scratchpad, and neither do the i2vslow_8 or i2cfast_8 settings on the master (either one produces the same result .. good or bad).
I'm not expecting anyone to solve my problem, although that would be nice. I'm really looking for suggestions from those who have experience with master/slave communications as to what else I can look at.
John
The mystery is, why should it 'sometimes' work. I've checked that I have the proper pullups and even went so far as to replace them. I swapped out the 28x2 chips for new ones, which worked at first and then seemed to "degrade" to the same problem. I have a DS1307 RTC on the same i2c bus and both master and slave can talk to that just fine. I've checked and double checked that master and slave are both in the correct mode when communicating and that the scratchpad addresses are correct. I even had the master read the first 25 scratchpad locations, which all return the same nonsense 255 or 0 when the problem occurs.
I'm at wits end trying to track down this problem and would appreciate any suggestions anyone can think of. I'd share the circuit and code, but it's somewhat complex as I'm using 3 slots on the master and 2 slots on the slave all matched up to one controller board running 3 output boards. So maybe we can start with some general ideas to see if we can't home in on the problem. Just for information, I also have a 74150 multiplexer, a CD4060 counter, and a LM1117 voltage regulator on the PCB. And one final point. My master runs at the 8MHz default speed, but my slave idles at 8MHz, but "works" at 64MHz using an external 16MHz resonator. Slave speed seems to have no impact on reading the scratchpad, and neither do the i2vslow_8 or i2cfast_8 settings on the master (either one produces the same result .. good or bad).
I'm not expecting anyone to solve my problem, although that would be nice. I'm really looking for suggestions from those who have experience with master/slave communications as to what else I can look at.
John