SPI communication application[SPI of STM32]
![](https://en.depfields.com/wp-content/uploads/2020/06/fiber-4814456_640.jpg)
Application program to read and write to SPI specification EEPROM. Details of the peripherals are explained in Serial Communication SPI.
![](https://en.depfields.com/wp-content/uploads/2020/05/instructor.jpg)
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.
![](https://en.depfields.com/wp-content/uploads/2020/05/instructor.jpg)
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.
![](https://en.depfields.com/wp-content/uploads/2020/06/spi-eeprom_NUCLEO_en.jpg)
Program Description
![](https://en.depfields.com/wp-content/uploads/2020/05/instructor.jpg)
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.
![](https://en.depfields.com/wp-content/uploads/2020/05/instructor.jpg)
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.
![](https://en.depfields.com/wp-content/uploads/2020/05/instructor.jpg)
Data is rewritten each time a command is entered.
![](https://en.depfields.com/wp-content/uploads/2020/05/instructor.jpg)
It is operated from a PC via serial UART communication to monitor the status of read/write (send/receive functions).