Datasheet
Chapter 2: EEPROM Tricks and Program Tips ยท Page 75
SUMMARY
This chapter introduced a variety of EEPROM and program management techniques.
EEPROM management focused on declaring and naming
DATA directives for all
EEPROM bytes and groups of bytes used in the program. Techniques for counting resets
were introduced for both toggling between different SumoBot program modes and for
selecting from a list of program modes. Programming focused on adhering to code
conventions for the sake of making large programs easy to build from smaller programs
in your library.
A
DATA directive is a compile-time command that pre-stores values to EEPROM when
the program is downloaded.
DATA directives can also be used to organize the portion of
EEPROM used for storing values. An optional
Symbol name preceding the DATA
keyword can be used to give a meaningful name to the starting address of each group of
bytes. Since this Symbol name represents an address in EEPROM it simplifies
READ and
WRITE operations in programs that maintain more than one group of EEPROM
DataItems.
A procedure was introduced for merging components of smaller programs into larger
programs. It depended on keeping programs organized in common sections: Title,
Compiler Directives, I/O Definitions, Constants, Variables, EEPROM Data,
Initialization, Main Routine, and Subroutines. It also depended on using a common
naming convention for temporary and counting variables.
Questions
1. How many bytes are in the BASIC Stamp 2's EEPROM memory?
2. If your program took 20 bytes, what would be the addresses of the bytes that
store the program?
3. If your program takes 1024 bytes, how many bytes are available for EEPROM
storage of values?
4. If your program has a
DATA directive Values DATA 1, 2, 3, and DEBUG DEC
Values
displays the value 100, what does that mean?
5. What does EEPROM stand for?
6. What's does compile-time mean?
7. What number system does the BASIC Stamp's EEPROM map use to display the
byte addresses and contents?
8. What is the hexadecimal number for decimal-15?