cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing an EEPROM Driver with Interrupts

akoluacik
Senior

I wanna implement an EEPROM driver but I have some hesitates.
I actually implement a driver in polling mode, and as you might guess, there are some HAL_SPI_Transmit functions to send command, and some data(a buffer, not a single byte). I thought to translate HAL_SPI_Transmit functions to HAL_SPI_Transmit_IT, but now I've some hesitates, should I also translate the HAL_SPI_Transmit function for which I am using to send command, or just the ones for which I am using to send data is enough?

Furthermore, will this work? Or I am thinking completely wrong?

Thx in advance for your responses.

1 REPLY 1
RhSilicon
Lead

EEPROM generally takes a long time to write, if the idea is to release the main code, it may be interesting to use a timer to periodically carry out the tasks of checking whether the writing operation is over and filling the data transmission buffer, or waiting for the time maximum and then send the data. A verification reading can be interesting to know if the data was saved correctly. For example W25Q64 (FLASH):

- Page Program Time

W25Q64.png

A 25Cxx EEPROM has the maximum TWC parameter (5ms, 10ms), which is the time each byte can take to be written into memory. Which can be even worse than FLASH, but on the other hand you don't need to erase the whole sector like W26Q64.

25C128.png

It might be interesting to know about NVRAM (uses RAM memory and a battery) and F-RAM (uses a magnetic cell) memories that have a much shorter writing time.