Hi all,
I'm currently working with the SSP0 peripheral on a LPC1857 and a LPC1837. On both chips, I've not been able to get the MISO line to read anything besides a high value (255) no matter what is written to the line. I am able to read the correct values however when the loopback is enabled or when I use the SSP1 peripheral. I've tried getting the receive data through the DMA peripheral as well with similar results. As far as I can tell, the receive FIFO is only ever receiving a value of 255. Here are a few things I've tried:
All the other lines (MOSI, CLK, SS) work as expected.
I have attached an example program I have written to demonstrate the misbehavior, the program simply sends 1 byte with value 100 over SPI and reads 1 byte. If you tie the MISO and MOSI lines together, one would expect a byte of 100 to be read. However, this only works with SSP1; SSP0 shows that the value 255 has been read. If you enable the loopback on SSP0 however, it works as expected and you read a value of 100.
Any help would be appreciated, thanks!
Update: I've figured out the problem (after posting the question naturally). Turns out PF_2 was at some point being set to function 2 which is also SSP0_MISO. I'm not sure where this is happening as it's not in any of the BSP code or my code, but after setting PF_2 to the default func 0, SSP0_MISO now works on my desired pin setup.
Yep, also described here in this thread: https://community.nxp.com/thread/462334
If you don't do anything on the pin configuration, maybe the BootROM code configures this pin.
Regards,
Bernhard.