Pic Lab, PIC16, Experiment #23: Saving data to EEPROM before the power off event

I guess, that sooner or later any developer has a question in his head – how do I save the data if the supply shut down?

There are some solutions listed:

  • The reserve battery (the RTC clock, the motherboard);
  • The constant saving to the memory – not nice, the EEPROM has limited cycles;
  • Saving to the external memory – the complication of the PCB and the code;
  • Saving when the lowering of the vdd level is detected – that what I need!
The voltage detector
Continue reading

Pic Lab, PIC16, Experiment #12, EEPROM

Goal: To write and read EEPROM

What we have: PIC16f628a and a simple devboard.

Microcontroller PIC16f628a has 128 bytes of EEPROM memory on board, not too much but we have what we have. Hi-tech PICC compiler has internal functions for work with EEPROM, but here I’m going to make some my personal functions.

Let’s look at the EECON1 register:

from the mikroe resourse
Continue reading