Hello there,
I'm looking to hook up a p1020 to a Kinetis K60 over SPI. Now, on the P1020, I'm running VxWorks and I have a function spiWriteReadCmd () whixch allows me to send data from an argument provided and at the same time, it will copy the datra in the incoming buffer into an other argument provided.
Now, I'm looking for a similar function on my Kinetis part but have not been able to find it. I have tried around quite a bit already but have not been able to get the SPI on my K60 going yet. I coudln't find much SPI examples for Kinetis, how do I get this going the best?
Thanks everyone for the replys!
We got it working now! :smileyhappy:
Hi Ron
Can you share your writeread function ? Thanks in advance
Kind Regards
Amit Kumar
Hello
If you are using MQX on K60, try the spi example in "installDirectory/freescale_MQX/mqx/examples/spi".......
rw.BUFFER_LENGTH = 10; | |
rw.WRITE_BUFFER = (char_ptr)send_buffer; | |
rw.READ_BUFFER = (char_ptr)recv_buffer; | |
printf ("IO_IOCTL_SPI_READ_WRITE ... "); | |
if (SPI_OK == ioctl (spifd, IO_IOCTL_SPI_READ_WRITE, &rw)) |
This ioctl call, writes commands to spi as well as reads its response....
There is a SPI demo code for TWR-K60D100M board communication with TWR-MEM Serial Flash device.
Customer can download KINETIS512_V2_SC (Kinetis 100MHz Rev 2 Example Projects) [spi_demo] from below link:
Wish it helps.
Hi, Ron
Do you need sample code for bare board or a RTOS? If first one, I can provide one for you.
Best Regards
Paul