SPI_TwoBoards_FullDuplex_IT_Slave_Init Example Description

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:

Example execution: On BOARD MASTER, LED1 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.

LED1 is On on both boards if data is well received.

In case of errors, LED1 is blinking Slowly (1s).

Note

You need to perform a reset on Master board, then perform it on Slave board to have the correct behaviour of this example.

Keywords

Connectivity, SPI, Full-duplex, Transmission, Reception, Slave, MISO, MOSI, Interrupt

Directory contents

Hardware and Software environment

How to use it ?

In order to make the program work, you must do the following :