[M031] SPI Slave Fastest Speed Transfer

Post Reply
chhsieh3
Posts: 275
Joined: 13 Mar 2020, 09:08

06 Oct 2022, 13:58

  • 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
This example code is used for the M031 series microcontroller (MCU) as an SPI slave to receive and send data at the fastest speed.

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
Nuvoton

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 5 guests