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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

712 次查看
lajithacs
Contributor II

Code is attached

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

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

标记 (1)
0 项奖励
3 回复数

594 次查看
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

594 次查看
lajithacs
Contributor II

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

0 项奖励

594 次查看
visakhanc
Contributor III

Good to know it helped you!

0 项奖励