I've been having problems with the I2C/TWI bus on my AT91RM9200DK. I've
been looking at the code in at91_i2c.c and something doesn't look right.
Looking at the full datasheet for the at91rm9200, and correct me if I am
wrong, but it appears that the TWI bus on the at91rm9200 works a little
differently to most other ATMEL microcontrollers. The differences are
that you have to set registers for the device slave address
(TWI_MMR.DADR) *and* the device's internal data address (TWI_IADR) i.e.
the address of the register that you want to access in the I2C device
itself. Therefore the transmit register is only ever loaded with the
*data* to be written, it should never need to be loaded with any address
information. Am I correct?
What I appear to be seeing in at91_i2c.c:at91_xfer() is that, during a
write, the address and the data are being written to the transmit
register. Short of actually looking at the bus on a logic analyser, I'd
say that this function isn't separating the data from the address
properly. Comments?
I am running linux-2.4.27-vrs1, do I have up-to-date I2C code? Has
anyone else had success with the I2C bus on this processor?
regards,
Aras Vaichas