LPC1769 SPI clock for receiving (SOLVED)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1769 SPI clock for receiving (SOLVED)

1,214 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by otxoasound on Mon Mar 23 10:41:16 MST 2015
Hello everybody!

               I need to set up communnications using SPI peripheral. The LPC1769 will work as master and an lcd controller (RA8875) as slave. I try an example and SPI works good if I only have to transmit. The LPC1769 does not generate clock after trasnmission of a byte. I need clock generation after transmit because the slave needs clock to send the information the master requests. So I need the same clock cycles as if I were transmitting 16 bits. I try to set 16 bit mode and the slave sends the information, but maybe there is a more elegant way to do it. Somebody could help?

                          Thank you!!
Labels (1)
0 Kudos
Reply
3 Replies

1,082 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by otxoasound on Wed Mar 25 03:24:05 MST 2015
Hi.
         So, I am doing it correctly. I have to send dummy data (0x00 is what I actually send) on the MOSI line and meanwhile receive the data from the slave on the MISO line. That is what I actually do, but as I am newbie on SPI communnications, I did not know if I was wrong.

                         Thank you everybody!!
0 Kudos
Reply

1,082 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Tue Mar 24 00:02:50 MST 2015
Or to explain things at a slightly higher view point ...

That SPI master clocks out dummy data (usually zeros) after a command send and picks up the returned data
(on MISO) from the slave (however many bits that you are expecting).

I.e the SPI (as a whole) can be considered as a CIRCULAR shift register with half the bits (MSB) physically in
the master and the other half (LSB) in the slave; but treated as a single item.

Wikipedia SPI has some nice pictures.

TTFN, Mike
0 Kudos
Reply

1,082 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Mar 23 11:46:44 MST 2015

Quote: otxoasound
I try to set 16 bit mode and the slave sends the information, but maybe there is a more elegant way to do it.



A read / write function as shown in samples :O
0 Kudos
Reply