AnsweredAssumed Answered

Transmission of additional byte in TWI master receive mode

Question asked by dare on Mar 22, 2011
Latest reply on Mar 22, 2011 by Mitesh



I'm working on the adsp-21369 ez-kit lite and try to connect a 4-channel A/D-converter (PCF8591, see data sheet attached) via TWI/I2C. To receive data from this device, I need to send a second byte (the so called control byte) to it, after having sent the address byte.


Currently I'm using a code example that was provided in the engineer zone previously (see attached file). For the beginning it works fine, the A/D-converter responds with an ACK-bit after being addressed. But in this code, the direction of the transfer is determined by the TWIMDIR bit in the TWIMCTL register, which is set to 1 because of master receive mode. The address byte at the beginning of a transfer is generated by the TWI controller.


How can I manually send a second (or even third) byte after the address byte?


Thanks for your help,