Data buffer transmission and receptionvia SPI using Interrupt mode. This example is based on the STM32C0xx SPI LL API. The peripheral initialization uses LL unitary service functions for optimization purposes (performance and size).
The communication is done with 2 boards through SPI.
This example shows how to configure GPIO and SPI peripherals to use a Full-Duplex communication using IT mode through the STM32C0xx COM_INSTANCE1_TYPE LL API.
This example is split in two projects, Master board and Slave board:
Master Board :
Slave Board :
Example execution:
On BOARD MASTER, LED4 is blinking Fast (200ms) and wait User push-button action. Press User push-button on BOARD MASTER start a Full-Duplex communication through IT. On MASTER side, Clock will be generated on SCK line, Transmission(MOSI Line) and reception (MISO Line) will be done at the same time. SLAVE SPI will received the Clock (SCK Line), so Transmission(MISO Line) and reception (MOSI Line) will be done also.
LED4 is On on both boards if data is well received.
In case of errors, LED4 is blinking Slowly (1s).
Connectivity, SPI, Full-duplex, Transmission, Reception, Master, MISO, MOSI, Interrupt
This example runs on STM32C031C6Tx devices.
This example has been tested with NUCLEO-C031C6 board and can be easily tailored to any other supported device and development board.
NUCLEO-C031C6 Set-up
In order to make the program work, you must do the following :