I want to retrieve an SPI log from another device. This another device is set in master so I want to use my FEZ Panda II in slave mode.
I found that the only way was to do it inRLP. So I began to write something in C and I tried to read periodically the receive buffer but this solution doesn’t work. When the master send 3000 bytes, I can retrieve just one or two bytes on slave side…
So I decided to use the interruption to read the buffer just when the buffer is half full. But I cannot find the IRQ index in the datasheet to install it with RLPext->interrupt.install()
You need to enable the interrupt for the SPI module that you are using. This is for all interrupts related to that SPI module. This is done with the RLP function as you mentioned.
The interrupt number you are looking for is 10(decimal) for SPI0 and 11(decimal) for SPI1
You also need to select which sub interrupts you want to enable for the SPI module. This is done in SSP0IMSC or SSP1IMSC, bit 2, RXIM.
Then, in your interrupt service routine you must look what the interupt was for, this is done in SSP0MIS or SSP1MIS, also bit 2.
I can’t remember how to reset the interrupt flag though. You need to write a 1 or a 0 to some register.
I suggest you get a kickstart copy of keil-mdk. It is limited to 32KB but that is plenty to debug RLP…
It has an emulator for the LCP2387 so that you can debug your code and see exactly what is going on. It is a bit of a pain to get the emulator working though, but worth it. I used it to develop my RLP servo driver and it helped me find a lot of bugs…
Just don’t know how you emulate the SPI, but I remember a peripheral menu item for things like that…