ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Aug 11, 2006 3:02 am |
|
|
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. |
|