Joined: Fri Jul 15, 2011 4:55 pm Posts: 1
|
|
hi all! I tried to read Multiple Data Bytes from the TWI. But I always get a value of 0xFF. The program is strictly based on the reference ATMEL company still has problems. my code: [code] AT91C_BASE_TWI->TWI_MMR = 0; AT91C_BASE_TWI->TWI_MMR = (2 << 8) | AT91C_TWI_MREAD | (0x50<< 16);
// Set internal address bytes AT91C_BASE_TWI->TWI_IADR = 0;
// Send START condition AT91C_BASE_TWI->TWI_CR = AT91C_TWI_START;
for(W=0;W<3;W++){ while(!((AT91C_BASE_TWI->TWI_SR&AT91C_TWI_RXRDY)==0)); buf[W]=AT91C_BASE_TWI->TWI_RHR; } TWI_Stop(AT91C_BASE_TWI); [/code] my micro is sam7x256 , EEPROM IC is 24c32.
|
|