I need some sample code to:
1. Accept incoming data on SPI DIN
2. Store the SPI DIN in a buffer on the ADuCM4050. Verify buffer content using IAR workbench
3. Externally Loop back the SPI DIN to the DOUT pin again (looped back to another SPI peripheral)
4. The ADuCM4050 also needs to be configured to accept a clock input at 12 MHz from the connected SPI device.
I have studied the spi_loopback.c file and associated header files.
I have been unsuccessful in several attempts to modify this code to produce something like 1-4 described above.
Can you please provide some sample code?
I have attached an example code to do Master slave loop back. SPI0 and SPI1 instances are configured in the code. This example code demonstrates SPI data transmit/receive both in master and slave mode.
In your usecase, the slave SPI instance (SPI1) in the code can be removed if you are connecting a slave device to SPI0.