2
votes

I'm developing an embedded system on STM32 F107 that communicates via i2c with 2 slave devices: a rfid reader rfid manual and a eeprom module eeprom manual. These two devices have the same slave address A0 (for write operations) and A1 (for the read operations). If a use only one device it works fine. But if I use both of them I have a problem. First I read the card id from rfid reader, then I write it in the eeprom (up to here it is all ok), when I try to read again from the rfid reader I get input data that are wrong and always the same even if I change the card. What is happening and what I can do to solve the problem?

2
Can't you modify the address of one of the devices using the jumpers?Nick
rfid module Are jp1 and jp2 the jumpers that are you talking about?Mario Lepore
Yes, page 6 of the manual.Nick
While changing the address of one device is the best choice, if for some reason you can't do that, then moving one of the devices to a different set of pins might be an option - either another I2C interface engine if available, or just bit banging on GPIOs if not.Chris Stratton

2 Answers

9
votes

Devices must have different addresses. You should reconfigure either device to use a different address to avoid the clash. This is typically done with jumpers (JP1, JP2 on the rfid reader) or by hardwiring some address pins on the chip (A0 and A1 pins on the eeprom chip).

1
votes

If there is no extra pins available to move the I2C device, try using i2c buffer or i2c MUX.