This example shows how to use the EEPROM Panel to easily view and edit the content of your Arduino EEPROM.
The EEPROM Panel lets you manage data in the EEPROM in 2 different ways :
- By using memory cells
- By using data types (Boolean, Byte, Integer, Long, Float, and String)
Sketch
Upload this sketch : 4_EEPROM \ 1_DefaultSpaceConfig
EEPROM access (reading/writing) is automatically handled by HC_communicate().
#include <HITIComm.h> void setup() { // initialize library HC_begin(); } void loop() { // handle EEPROM access. Set default User Space configuration. HC_communicate(); }
Memory Cells
1) Open the EEPROM Panel (CTRL+E or Tools\EEPROM).
2) The Content Panel initially displays the Memory Cells of the EEPROM.
3) At communication start-up with your Arduino, HITIPanel automatically reads all the cells values. It does it once. If you need to refresh the display, you can perform this reading by clicking on the “Read ALL” button.
3) If this is the first time you access and see the content of your EEPROM, you may be surprised to find out that all the cells have their bits set to 1 instead of 0. This is normal, EEPROMs are produced and shipped in this state. However, you surely prefer to work with all the bits set to 0. To do that, click on button “Clear ALL to 0” to set all the bits to 0. You should notice that the writing process takes few seconds. Again, this is normal as writing to a cell is extremely slow. Also, note that in order to save EEPROM lifetime, writing to a cell is only performed if the data inside this cell needs being updated. Which means that if you click a second time on button “Clear ALL to 0”, no writing will be performed.
4) Each memory cell is located by an address and has a size of 1 byte. Go to address 122 by using either the address selector or the navigation arrows.
5) Change the cell value at address 122 to A2.
6) Then change the value of bit 5 inside the same cell (bit 0 starts at right).
Data Types
The Content Panel displays data stored as Booleans, Bytes, Integers, Longs, Floats, or Strings.
These data are stored in a pre-defined area of the memory space called the User Space. This area is booked and managed by our Arduino library. The User Space is divided into 6 sub-spaces, one for each data type. Each sub-space is used to store a specific data type and only contains elements of this specific data type.
Each element is located by an index and its size depends on its data type. It will 1 or several memory cells to store its value, depending on its data type.
The sizes of the sub-spaces can be configured. In the current example, we are using their default sizes (see default configuration for details).
Integer Space
1) Display the Integers (“Integer” button).
2) As we are using the default configuration, the Integer Space has a size of 200 bytes and contains 100 elements (index 0 to 99). Set the value of Integer 32 to 4863.
3) An Integer element uses 2 memory cells to store its value. To find these cells addresses, put your mouse cursor over the index of Integer 32. The tooltip indicates address 214 which is the address of the main cell (the one which holds the Least Significant Bits of Integer 32). This means Integer 32 stores its value in cells 214 and 215.
4) Display the Memory Cells (“Cell” button) and go to cell 214 and 215. The main cell is in Yellow and the second cell is in Black. The Yellow color indicates these cells hold the value of an Integer element.
5) Put your mouse cursor over address 214 or 215. A tooltip appears and shows that these cells hold the value of Integer 32 (which is 4863).
Float Space
1) Display the Floats (“Float” button).
2) As we are using the default configuration, the Float Space has a size of 250 bytes and contains 62 elements (index 0 to 61). Enter value -43.189 for Float 14.
3) A Float element uses 4 memory cells to store its value. To find these cells addresses, put your mouse cursor over the index of Float 14. The tooltip indicates address 656 which is the address of the main cell (the one which holds the Least Significant Bits of Float 14). This means Float 14 stores its value in cells 656, 657, 658 and 659.
4) Display the Memory Cells (“Cell” button) and go to cells 656, 657, 658 and 659. The main cell is in Red and the others are in Black. The Red color indicates these cells hold the value of a Float element.
5) Put your mouse cursor over one of the addresses. A tooltip appears and shows that these cells hold the value of Float 14 (which is -43.189).
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article