Recent Changes - Search:

Introduction to Microcontroller Programming

About PICmicro Chips

Clocking Your PICmicro Devices

E-Blocks

Flowcode Step By Step

PICmicro Projects

Labs

<^< You try it | Course Index | A Simple Hi-Fi >^>

This is a convenient point to introduce another facility that the PICmicro can offer you: Electrically Erasable Read Only Memory, or EEPROM. All PICmicro devices have Read Only Memory (ROM), Random Access Memory(RAM), and Electrically Erasable Read Only Memory (EEPROM). ROM is where your program is stored and can not be altered whilst the program runs. RAM is where your variables are stored and this can be written to and read from as your program runs, but the contents are lost as soon as the power is removed from the chip. EEPROM can be written to and read from as your program runs: but the contents are preserved when the power is removed. This means that the contents are available again the next time you use the device. EEPROM is useful in many situations where the settings a user makes need to be preserved for the next time the system is used. For example remembering the frequency a television channel is tuned to.

With reference to the previous example:

  1. Add an EEPROM component from the Storage menu to the System Panel.
  2. Add a new Component macro to your program just after the LCD is updated with the key the user presses. In this Component macro use the EEPROM 'Write' macro using the variables 'PTR' as the memory location, and KEY as the data. You can see the window below.
  3. Simulate your program. If you watch the EEPROM Flowcode component then you should see that as you enter numbers they are stored in the EEPROM memory.

Reading data back from the EEPROM is very similar to writing data to it: you simply specify a variable where you want to place the data, specify the address you want to read it from.

<^< You try it | Course index | A Simple Hi-Fi >^>

Print - Search - Login

Page last modified on July 26, 2013, at 11:45 AM