CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

SPI problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Thomasn101
Guest







SPI problem
PostPosted: Sat Mar 27, 2004 10:49 am     Reply with quote

Hi,
If a Master PIC wants to send multiple bytes of data to a Slave PIC (with SS enabled) using SPI, does it have to pull the SS line high at the end of every byte? The slave receives data perfectly with this:
- SS low
- Send data
- Delay 10ms
- SS high
- SS low
- Send data
- Delay 10ms
- SS high

However, The slave doesn't receive data properly with this:
- SS low
- Send data
- Delay 10ms
- Send data
- Delay 10ms
- SS high

Both the slave and the master are F877 @ 20Mhz. Did I do something wrong?
Regards,
Thomas
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Sat Mar 27, 2004 1:33 pm     Reply with quote

The master should puase between bytes but only a very short time. The delay between bytes allows the slave to move bytes into and out of the SPI hardware buffer after each byte finished. Around 10 instruction cycles is plenty usualy. Maybe more if you are loading an array. The SS signals the start of a new packet of data. It allows the slave to be the only recieving device as well as keeping it in sync. Post your code. Get specific help.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group