TWI (I2C) slave example for ATxmega32A4U

It has taken me some time to understand how to write a slave driver for this chip so here is a simple example. Every byte received is written to port D so that it can be seen, and when a stop condition is detected all pins on port D are toggled. Reading data from it returns the next value of an 8 bit counter.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s