Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Problem With TWI!
PostPosted: Thu Sep 29, 2011 4:35 pm 
Offline

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: chasmopolitan and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: