Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] SPI Problem - CPHA configuration

2006-05-06 by Tom Walsh

rod_linares wrote:

>Hi all,
>Im building a project with an LPC2106 (master) connected with 3 SPI 
>slaves devices,  two with CPOL =0 , CPHA =0 and another device with 
>CPOL=0 ,CPHA=1.
>
>First of all I configured the two devices with CPOL =0 , CPHA =0 and 
>I didn't had problems. But when i tried to include to the system the 
>device with CPOL=0 ,CPHA=1 the problems began to apear.
>
>After some debugging i conclude the problem apears when I configure 
>the CPHA "dinamicaly" in teh code . 
>
>With the same code I initialized (and never change) the CPHA=0 and 
>the 2 devices (CPOL =0 , CPHA =0)  worked  ok. After that I 
>initialized (and never change) the CPHA=1 and the device (CPOL =0 , 
>CPHA =1) and worked OK.
>
>Finnaly , When I changed dinamicaly the CPHA in the code and I 
>conected the three devices  only he "CPHA=1" decvice worked OK.
>This sound familiar?
>any had the same problem?
>
>
>  
>
I will be facing a similar situation: ENC28J60 clocks on rising edge and 
SD card clocking on falling edge.  So, your post is timely for me.  I 
wonder if you might try a dummy SPI cycle after you switch the clock 
configuration?  Don't select anything, just spit a byte out?

TomW

-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.