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 support@ccsinfo.com

SPI overflow

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



Joined: 10 Aug 2006
Posts: 9

View user's profile Send private message

SPI overflow
PostPosted: Tue Feb 20, 2007 6:05 am     Reply with quote

Hi all,

I wonder if anyone has this info?

I am implementing a system (hardware not available yet) where I will be receiving SPI packets. Most of the time these packets will a fixed length but every 256 packets there will be an extra frame. Under normal conditions this extra frame is to be ignored and so for speed i was not going to read them from the SPI buffer. I will then get overflows. Does anyone know if this will cause any problems when I get the next packet. Do I have to reset any registers and how would I do that?

PS there are 20% dead time between packets for housekeeping.

Thanks and regards
Robert
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 20, 2007 4:41 pm     Reply with quote

Read this slide show presentation from Microchip. It talks about
the SPI buffer overflow condition. See page 26:
http://ww1.microchip.com/downloads/en/devicedoc/spi.pdf

See Ttelmah's post near the end of this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=28698
He has posted some macros to disable and enable the SPI module
(per the info on page 26 of the slide show). You could do that,
with perhaps a short delay of a few microseconds in between
the disable/enable.

Also, Ttelmah's macros use register addresses for 16F PICs.
If you're using an 18F PIC, you will need to change the addresses.
Look in the SFR section in the data sheet to find the register addresses.
robert



Joined: 10 Aug 2006
Posts: 9

View user's profile Send private message

PostPosted: Wed Feb 21, 2007 4:44 am     Reply with quote

Thanks PCM programmer.

Info looks good

Regards
Robert
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