Hi all,
I'm trying to use a eeprom with my evaluation board (the one in the
subject),
so I added the code from the atmel site (AT91-AN01: Using the Two-wire
interface (TWI) in Master Mode on AT91SAM Microcontrollers) to my
adjusted
version of FreeRTOS.
In order to make things working, I have added lib_AT91SAM7S256.h to my
project. This header is a set of inline functions useful to initialize
and
use the processor, without directly use the processor register.
It does compile, but the problem now is that the example code downloaded
from Atmel site stops working during the execution of
AT91F_AT24C_WritePage(). It loop forever just here (into the while):
[..snip..]
/* Send the buffer to the page */
for ( Count=0; Count < NumOfBytes ;Count++ )
{
____AT91C_BASE_TWI->TWI_THR = *Buffer++;
____/* Wait until TXRDY is high to transmit the next data */
____status = AT91C_BASE_TWI->TWI_SR;
____while (!(status & AT91C_TWI_TXRDY)) <---- it loops here
____status = AT91C_BASE_TWI->TWI_SR;
}
[..snip..]
It seems that AT91C_TWI_TXRDY (or AT91C_BASE_TWI->TWI_SR) never becomes
0, but I can't wonder whi..
Anybody known the solution?
Thanks a lot
g4b0