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  [ 3 posts ] 
Author Message
 Post subject: Flaky SPI Chip Select! Help!
PostPosted: Sun Jul 31, 2005 4:44 am 
Offline

Joined: Wed Jan 05, 2005 11:38 pm
Posts: 305
Location: San Diego, California
There are two things I have observed when sending data out via SPI. One case is when I am blasting data out on the buss and when I am slowly sending data out manually by using the debugger.

All my settings are correct for the chip select and I have CSAAT=0 so the line should pull high after the last transfer. I also set LASTXFER high in the tx register to ensure that chip select will be deasserted after data has been transferred. I have verfied that all the data looks good on the scope.

1.)

The chip select is supposed to idle high, go low , and then back up when data has been sent. If I send out data quickly I never see my chip select being pulled high after each transfer. I just stays low for all the data. Even though I have all the settings set correctly.

2.)

To verfify that I have not messed something up with the above I fire up the debugger and I step through each command one at a time. I watch CS carefully during each transfer on my oscilloscope and I see the CS pin now being pulled low and then back up high! This is excellent! The problem is that when I keep stepping through 1/2 of the time I don't see the CS pin being pulled down!

For example this is similar to what is happening:
spi_pt->SPI_TDR = 0x010e00026; // I'll see a good CS toggle
spi_pt->SPI_TDR = 0x010e00045; // No CS toggle at all
spi_pt->SPI_TDR = 0x010e00081; // Good CS toggle
...


I've looked at the AT91SAM7S64 errata sheet and I don't see anything under SPI that relates to my issue.

Thanks for any info!

-Henk


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 3:15 pm 
Offline

Joined: Wed Jun 22, 2005 5:14 pm
Posts: 27
Location: NJ
if this is exactly what you have in your source code:
Code:
spi_pt->SPI_TDR = 0x010e00026;

you have an extra zero between e and 2


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 6:38 pm 
Offline

Joined: Wed Jan 05, 2005 11:38 pm
Posts: 305
Location: San Diego, California
jihwan,

Thanks for post.

I have it correct in my debugging code:

spi_pt->SPI_TDR = 0x010e0055;


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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: