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  [ 5 posts ] 
Author Message
 Post subject: Problem with SPI CS line when using PDC
PostPosted: Mon Feb 27, 2012 1:28 am 
Offline

Joined: Fri Jan 13, 2012 11:06 am
Posts: 7
Hi everyone.

I have a problem when I try to transmit data on SPI using PDC ( let's say array of 32 KB). The problem is next. I want to continuously transmit data on SPI using PDC and my oscilloscope show me that i have signal on MOSI and SCLK line which vary and that is ok. The problem is in my CS line which is always low, and I want to be high after every transmit data.

Also I try to transmit data on SPI without PDC and I didn't have that problem. My CS line was low during transmitting data and became high after data were transmitted.

I configured SPI: LASTXFER=0, PCS=0x0, PS=0, PCSDEC=0, CSAAT=0.
I also try to increase DLYBCT (Delay Between Consecutive Transfers) to 0xFF, I thought SPI will have enough time to put CS line to be high, but that never happened.

I use at91sam7x512 microcontroller.

Can anyone help me? Where I wrong, what do I miss?
Bane


Top
 Profile  
 
 Post subject: Re: Problem with SPI CS line when using PDC
PostPosted: Mon Feb 27, 2012 12:37 pm 
Offline

Joined: Thu Dec 02, 2004 2:28 pm
Posts: 504
hello,
if you software addresses only one spi slave then this behavior is "normal".
the only way to change it is insert a transfer to a not used spi "dummy" slave between each transfer to the regular "slave".
only drawback of this workaround:
it increases the needed memory size for the transfer buffer by a factor 2.

regards
gerhard


Top
 Profile  
 
 Post subject: Re: Problem with SPI CS line when using PDC
PostPosted: Tue Feb 28, 2012 11:37 am 
Offline

Joined: Fri Jan 13, 2012 11:06 am
Posts: 7
Thanks Gerhard,

I will try to change fixed peripheral select to variable peripheral select to see what is happening. I have not tried this feature because I thought it will work fine with only one peripheral. But obviously for fixed peripheral select chip select signal is always low when i use PDC and that is little stupid.

Any way thanks one more time. I'll write what I have achieved when i try it.

Regards
Bane


Top
 Profile  
 
 Post subject: Re: Problem with SPI CS line when using PDC
PostPosted: Mon Mar 05, 2012 10:53 am 
Offline

Joined: Fri Jan 13, 2012 11:06 am
Posts: 7
Hi everyone,

Sorry i was absent, but i had a problem with my oscilloscope, so i couldn't see my signals.

Anyway i change fixed peripheral select (PS=0) to variable peripheral select (PS=1) . I made array of type unsigned int, which is 32 bits wide with the data in the LSBs and the PCS and LASTXFER fields in the MSBs. On every even place of array i put my real data i want to transmit and on every odd place i put "dummy" data i want to transmit to "non-existent SPI" and everything work fine.

Now, i have one more question, something i don't understand from datasheet. When i transmitted data i try every combination of LASTXFER and CSAAT field and my transfer always work.
For: LASTXFER=0 , CSAAT=0;
LASTXFER=0 , CSAAT=1;
LASTXFER=1 , CSAAT=0;
LASTXFER=1 , CSAAT=1;

What is a real difference between LASTXFER and CSAAT and what is meaning of combination of these two fields?
Is it irrelevant combinations of this two field if i use it for SPI transfer with DMA, or combination of these two field is important if i use it for SPI without DMA?

Regards
Bane


Top
 Profile  
 
 Post subject: Re: Problem with SPI CS line when using PDC
PostPosted: Wed Mar 07, 2012 6:18 pm 
Offline

Joined: Thu Dec 02, 2004 2:28 pm
Posts: 504
hello,
regarding your last question:
use the following combination:
LASTXFER=0 , CSAAT=0;

regards
gerhard


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users 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: