SPI communication application[SPI of STM32]

Application program to read and write to SPI specification EEPROM. Details of the peripherals are explained in Serial Communication SPI.

For I2C communication, the address is specified in the chip select, but for SPI communication, the chip select signal CS is given (to a "L" level) for each communication.

Commands for writing to and reading from SPI EEPROMs are defined with #define at the beginning of the program. Refer to the data sheet of each EEPROM for the contents.

SPI EEPROM circuit diagram

 Program Description 

Commands for writing to and reading from SPI EEPROMs are defined with #define at the beginning of the program. Refer to the data sheet of each EEPROM for details.

When one of the two character string commands "1@" or "2@" is entered on a PC, the data corresponding to that command is written into the EEPROM, and the stored data is read and displayed.

Data is rewritten each time a command is entered.

It is operated from a PC via serial UART communication to monitor the status of read/write (send/receive functions).

Follow me!