I2C to AVR Xmega
Posted: Fri Apr 09, 2021 12:31 am
I need to send (but not receive) packets over I2C to an AVR Xmega microcontroller, which are both on the same I2C bus. I have I2C (aka TWI in AVR jargon) master and slave code written and thoroughly tested on the Xmega, including an equivalent of the micropython scan() method. At least I assume it is the equivalent; it sends an address and checks for ACK/NACK. That scan successfully returns the (slave) address of itself (the Xmega), which is 3. In addition I know from using the debugger on it that all TWI registers are correctly set (in particular the slave module is enabled with address 3). Heck, if they weren't correct it wouldn't ping ok.
However, scan() on the pyboard does not find the Xmega, i.e., does not list address 3. It continues to list all the hardware I2C chips connected to the bus just fine, just not that of the Xmega. Both Xmega and pyboard are set to use 100 KHz.
I am assuming this is not an impossible thing to do and very probably others have done this, or to another type of micro. Any help or suggestions would be very much appreciated.
Thanks, Steve
However, scan() on the pyboard does not find the Xmega, i.e., does not list address 3. It continues to list all the hardware I2C chips connected to the bus just fine, just not that of the Xmega. Both Xmega and pyboard are set to use 100 KHz.
I am assuming this is not an impossible thing to do and very probably others have done this, or to another type of micro. Any help or suggestions would be very much appreciated.
Thanks, Steve