I m working on FRDM-KE06Z brd. I have written a simple code to configure SPI0 as master and to transfer 1 byte of data to the spi data buffer. I m not getting any output for the SPI0(none of the signals are coming out when probed). codeattched. plz help

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

I m working on FRDM-KE06Z brd. I have written a simple code to configure SPI0 as master and to transfer 1 byte of data to the spi data buffer. I m not getting any output for the SPI0(none of the signals are coming out when probed). codeattched. plz help

696 Views
lajithacs
Contributor II

Code is attached

Original Attachment has been moved to: SPI.c.zip

Original Attachment has been moved to: main.c.zip

0 Kudos
3 Replies

578 Views
visakhanc
Contributor III

Hi, 

The initialization of SPI0 module pins and clock seems right. One problem can with the comparison in register_write()

if(SPI0_S == 0x20)‍‍‍‍

Instead of this comparison, try:

if((SPI0_S & 0x20) == 0x20)‍

(Because other bits in SPI0_S like SPRF, SPMF can also be 1. Then SPI0_S may not be 0x20 always)

Good luck

578 Views
lajithacs
Contributor II

Thanks Vishakhan C. SPI0 working fine now!!!!

0 Kudos

578 Views
visakhanc
Contributor III

Good to know it helped you!

0 Kudos