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 with 18F8722

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



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Aug 11, 2006 3:02 am     Reply with quote

I can recommend you to read http://www.ucpros.com/work%20samples/Microcontroller%20Communication%20Interfaces%202.htm. This is a short article on several microcontroller Interfaces including SPI.

CPOL = Clock Polarity, it defines the clock's logic level in idle state. Working is identical to the Microchip CKP bit.

CPHA = Clock Phase, it defines on which clock edge the data is shifted out for sending and shifted in for reading. The Microchip CKE bit has the same functionality but... it is defined inverted, so CKE = ! CPHA.
See also http://www.ccsinfo.com/forum/viewtopic.php?t=8747

CPOL =0, CPHA = 0 translates to --> CKP = 0, CKE =1
SMP is always set to 0, only for some very rare non-standard communications it has to be set to 1.
mkr



Joined: 08 Aug 2006
Posts: 49

View user's profile Send private message

perfect its working
PostPosted: Fri Aug 11, 2006 8:41 am     Reply with quote

Thanks a lot. I changed the CKE =1 and CKP =0 and also followed the errata for F8722 for BF on SSP2STAT.0. I am not polling this bit.[/quote]
_________________
Thanks

mkr
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