Hello,
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?
Thanks!
Lisa
Solved! Go to Solution.
OK, with the help from Freescale's Clark, the answer is that I connect my SPI to UART adapter to wrong SPI port.
Instead of secondary elevator D side expansion port SPI2, I should connect my SPI to UART adapter card to primary elevator B side expansion port SPI0. It is primary elevator B side expansion port SPI0 connected to K60 processor SPI2! Now I can see SPI2_CLK signal with oscillate scope.
Please ignore my source code.
OK, with the help from Freescale's Clark, the answer is that I connect my SPI to UART adapter to wrong SPI port.
Instead of secondary elevator D side expansion port SPI2, I should connect my SPI to UART adapter card to primary elevator B side expansion port SPI0. It is primary elevator B side expansion port SPI0 connected to K60 processor SPI2! Now I can see SPI2_CLK signal with oscillate scope.
Please ignore my source code.