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  [ 2 posts ] 
Author Message
 Post subject: spi CS not working well
PostPosted: Sat Jun 18, 2011 9:48 pm 
Offline

Joined: Fri Oct 24, 2008 5:31 pm
Posts: 31
hi, at the code blow i want to toggle PA13 for using mmc cs, but when i toogle it in loop it will be done but when i toggle it once time no toggle, download my code from attachment and tell me where is the problem, i used cs1 for mmc but init cs0 for spi to spi send data, beacuse i must change cs value manually. thanx a lot.


Attachments:
main.rar [2.27 KiB]
Downloaded 18 times
Top
 Profile  
 
 Post subject: Re: spi CS not working well
PostPosted: Mon Jun 20, 2011 5:11 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
I sure wouldn't be using this OR type action on the Clear and Set registers.

AT91C_BASE_PIOA->PIO_CODR |= (1 << 13);

Just write the single bit you want to change the state on, don't do a read-modify-write, it's pointless and somewhat dangerous.


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 4 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: