- Application: This example code is used for the M031 series microcontroller (MCU) as SPI slave to transfer data at the fastest speed.
- BSP Version: M031_Series_BSP_CMSIS_V3.05.000
- Hardware: NuMaker-M031SE V1.1
There are two projects in the example. SPI_Master is an SPI master project, which sets SPI clock frequency to 16 MHz, sends 256 bytes of data to slave, reads back the data, compares it with the sent data, and checks whether the data sent and received by slave is correct. SPI_Slave is an SPI slave project, which receives, saves and prints the data sent by master after receiving “write” command from master; after receiving “read” command from master, the data will be sent back to master. This document introduces the example code of SPI clock frequency and role setting, increasing the suspend interval to prevent RX FIFO overflow, and filling in TX FIFO before communication and adding dummy to prevent TX underflow.
You can download the sample code at https://www.nuvoton.com/resource-downlo ... 2106084521