NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » I2C via interrupts define addresses for the Mega 168

September 11, 2011
by jstockma
jstockma's Avatar

I am trying out the TWI I2C libraries and code. In the Master Code section there are two define statements assigning addresses to two variables. Nunchk and TWI328SLV_ADR. I would like to implement this code on the Mega 168. Can you tell me if the addresses would be different on the 168, and if so, where in the 168 data sheet would I find those addresses? I basically understand how the code works but I am not proficient on memory address assignments. Thanks, jstockma

September 11, 2011
by jstockma
jstockma's Avatar

After looking at the C code some more,I see that these assignments are typical alias assignments and not memory address assignments. The slave address must be specified on both devices.

September 12, 2011
by Rick_S
Rick_S's Avatar

If you are trying to interface a WII nunchuk, search the forum. There are full code examples available. One Nunchuk thread


Post a Reply

Please log in to post a reply.

Did you know that two resistors plus a transistor can be used to make a better voltage supply? Learn more...