AnsweredAssumed Answered

SPI2_CLK on TWR-K60F120M (MQX 3.8)

Question asked by Lisa Fu on Aug 2, 2012
Latest reply on Aug 8, 2012 by Lisa Fu



I have problem to make SPI2 on TWR-K60F120M working. There is no SPI2_CLK signal.


My application needs SPI master. I have checked MQX 3.8 source code. There is an example code under \Freescale 3.8\mqx\examples\spi. This example code is very simple. I don't have flash memory card, so I can't directly use this code. But I have a SPI to UART adapter card and I can follow this example code and use MQX 3.8 API functions to configure SPI registers and use write() and fread() to do data send and receive. My problem is that there is no SPI2_CLK signal. I have used oscillate scope to monitor it. Of cause, SPI2 doesn't communicate. I believe that fopen() function should take care port register configuration. Should I configure those port registers (which is described in K60 data sheet chapter 11)?


The connection of SPI2 pins and SPI to UART adapter card is described in attached file SPI_2_UART_INFTERFACE.pdf. My source code is in attached file spi2_code.txt. Most of code is for debugging purpose, not for real application.


Could somebody help me to find out what I have missed to make this SPI2 code work?