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

1,447件の閲覧回数
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 件の賞賛
返信
3 返答(返信)

1,329件の閲覧回数
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

1,329件の閲覧回数
lajithacs
Contributor II

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

0 件の賞賛
返信

1,329件の閲覧回数
visakhanc
Contributor III

Good to know it helped you!

0 件の賞賛
返信