- Tue Jan 20, 2015 7:23 pm
#178896
I have tried both the Serial7Segment and the OpenSegment displays on my AVR through the i2c bus and have failed both times. I am NOT using Arduino. I have tried this across two different AVRs with both the hardware TWI library and two different software libraries. This has been the cause of some major headaches for me. Phoenix123 posted a solution on the blue OpenSegment display's comment section that can be found here: https://www.sparkfun.com/products/11647
Essentially, when an Arduino sends the device address through its Wire library, it shifts the address left one bit and then adds the R/W bit. This turns the serial display's address from 0x71 to 0xE2. Since the hardware TWI and software libraries I have tried do not shift the address, the Arduino on the display was not receiving the expected address.
I originally thought this was a bug in the Arduino Wire library, but after thinking about it, I'm not so sure. If this were a bug in the library, no Arduino would work with any i2C device. It would appear that i2c devices are expecting the address to be shifted left by one bit. I just found this information out and haven't had time to research the i2c specifications, so I do not know for sure if this is correct or not.
Anyway, if anyone is having trouble trying to drive these displays with the i2c bus and is not using Arduino, the solution seems to be to simply shift the address left.
Essentially, when an Arduino sends the device address through its Wire library, it shifts the address left one bit and then adds the R/W bit. This turns the serial display's address from 0x71 to 0xE2. Since the hardware TWI and software libraries I have tried do not shift the address, the Arduino on the display was not receiving the expected address.
I originally thought this was a bug in the Arduino Wire library, but after thinking about it, I'm not so sure. If this were a bug in the library, no Arduino would work with any i2C device. It would appear that i2c devices are expecting the address to be shifted left by one bit. I just found this information out and haven't had time to research the i2c specifications, so I do not know for sure if this is correct or not.
Anyway, if anyone is having trouble trying to drive these displays with the i2c bus and is not using Arduino, the solution seems to be to simply shift the address left.