| Home | Price List | Order Info | Microcontrollers | Assembler | C and C++ |
| PIC Memory |
|
Modern PICs PIC16F877, PIC16F872, PIC16F870, PIC16F84,PIC16F627, PIC16F628 etc all have 3 types of memory, FLASH, RAM, and EEPROM. It is important to understand the limitations of each type of memory. FLASH and EEPROM have a limited life. Each time new data is programmed into one of these memories it suffers slight damage and if it is programmed many times it wears out and stops functioning. FLASH memory in a PIC is where the programme code is stored and this memory can be programmed a relatively small number of times (upward of several 100's). EEPROM is used to store semi permanent variables and this memory can be programmed 10 to 100 times more than FLASH memory. RAM is used to store variables which change during the running of the programme. This type of memory has the advantage that it can be programmed with new data any number of times without suffering damage but it looses it data a few milliseconds after the power is removed from the PIC. Data such as look up tables which are programmed into the PIC and not changed during the life of the programme can be stored in the FLASH memory. Variables which are not normally changed when the programme is running which need to be saved during during power down should be stored in EEPROM. All three types of memory can be read any number of times without suffering damage. From this you will understand that EEPROM and FLASH memory must not be used to store variables which frequently change, and in a development situation where the PIC is programmed with new code every few minutes only the memory where the data changes should be written to. When the Brunning Software module programmes a PIC it reads each memory location immediately before it is written to and if the correct data is already stored it is skipped over. This procedure considerably extends the programmable life of the PICs. |