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!
KCC's Quizzes AQQ305 about a mutual exponentiation equation
1. Quote of the month: "A train station is where a train stops. A bus station is where a bus stops. I have a work station on my desk, so..." - unknown
2. Quiz AQQ305 about finding a mutual exponential equation
Good luck, and try to be among the
View All
September Monthly Blog Quiz! Read the blog, take the quiz, and you could win a gift card
Quiz: How Well Do You Know Adaptive Power Switching?
Is your I/O module overheating? The AD74416H's Adaptive Power Switching (APS) can cut heat dissipation by up to 40% — but how well do you really understand how it works?
Read the blog first: Cooling
View All
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 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