Hi,
I'm trying to develop a link between the ADSP 21489 and ADT7411. I have to use the I2C protocol. Could someone point me to a C code example demonstrating an I2C transaction for the ADSP 21489.
Thanks!
Hi,
I'm trying to develop a link between the ADSP 21489 and ADT7411. I have to use the I2C protocol. Could someone point me to a C code example demonstrating an I2C transaction for the ADSP 21489.
Thanks!
Hi Jeyanthi,
Thanks again for your response. I'm trying to write to and read from a Analog Devices Temperature Sensor. The file I attached in previous post was for attempting to read a register from Sensor…
I'm qutie new to this forum, why I can't see your excample code? where could I get it? Thanks
I cannot see it, either.
Hi Deco,
To answer your questions:
1. The TWI hardware takes care of sending the slave address once the register is programmed. The user need not have to send the address everytime. The code I have shared sends N bytes as programmed.
2. If you want to use the Repeated Start condition then you can set this bit.
I had gone through the code you have sent. I am not clear on what exactly you are trying to do. I can see that the master is enabled multiple times as below:
*pTWIMCTL = TWIMEN | (1<<6);
*pTWIMADDR = device_address;
*pTWIMCTL = TWIMEN | (1<<6) | TWIRSTART;
while(*pTWIFIFOSTAT & TWITXS) {};
// enable rx transfer
*pTWIMCTL = TWIMEN | (1<<6) | TWIMDIR;
Can you enable the master only once for more no of data and check what happens to the TWITXS status? Also check for the error conditions in the current code which might explain on why the data is not transferred.
I would also recommend you to use the interrupt mode of operation.
Best Regards,
Jeyanthi
Hi Deco,
To answer your questions:
1. The TWI hardware takes care of sending the slave address once the register is programmed. The user need not have to send the address everytime. The code I have shared sends N bytes as programmed.
2. If you want to use the Repeated Start condition then you can set this bit.
I had gone through the code you have sent. I am not clear on what exactly you are trying to do. I can see that the master is enabled multiple times as below:
*pTWIMCTL = TWIMEN | (1<<6);
*pTWIMADDR = device_address;
*pTWIMCTL = TWIMEN | (1<<6) | TWIRSTART;
while(*pTWIFIFOSTAT & TWITXS) {};
// enable rx transfer
*pTWIMCTL = TWIMEN | (1<<6) | TWIMDIR;
Can you enable the master only once for more no of data and check what happens to the TWITXS status? Also check for the error conditions in the current code which might explain on why the data is not transferred.
I would also recommend you to use the interrupt mode of operation.
Best Regards,
Jeyanthi