AnsweredAssumed Answered

FRDM-K20D50M SPI Driver (non-PE)

Question asked by Mehmood Nurmohamed on Oct 22, 2013

Hello,

 

I am new to the Freescale K20 family and currently working with the FRDM-K20D50M board.  I have written a SPI driver from scratch (ie not using ProcessorExpert) since I am using IAR for my IDE.  It is a simple driver in that it only transmits data and doesn't care about what is received.  I have the SPI configured as a Master but things don't seem to be working quite right.  The driver uses interrupts (but not DMA) to transfer bytes to a slave.  When I attempt to send a buffer I can see two issues:

 

  • CLK signal is correctly functioning, however, the outgoing bytes (MOSI) don't coincide with the clock signal
  • the time between each byte transmission is relatively large (~1.85ms) [not very obvious from the Saleae trace attached but was the case when I expanded the view]

 

I have double- and triple-checked the connections to make sure my pin configuration and signal test points are correct.  Are there any ideas as to what is wrong with the driver?  I have also enclosed a main() application that sends [0x01, 0x02, 0x03, 0x04, 0x05] about every 1s that illustrates the issue.

 

Feedback is greatly appreciated.


Regards

Original Attachment has been moved to: blink_rgb.cpp.txt.zip

Original Attachment has been moved to: LDSpi0.cpp.txt.zip

Original Attachment has been moved to: LDSpi0.h.txt.zip

Attachments

Outcomes