IP2022 Users ManualInstruction Set Architecture
www.ubicom.com
97
3.7
Self-Programming Instructions
The IP2022 has several instructions used to read and write the
program RAM and the program flash memory. These instructions
allow the program flash memory to be read and written through
special-purpose registers in the data memory space, which allows
the flash memory to be used to store both program code and data.
Because no special programming voltage is required to write to
the flash memory, any application may take advantage of this
feature at run-time. Typical uses include saving phone numbers
and passwords, downloading new or updated software, and
logging infrequent events such as errors and Watchdog Timer
resets.
The self-programming instructions are not affected by the code-
protection flag (the CP bit of the FUSE1 register), so the entire
program memory is visible to any software running on the IP2022.
There are five instructions used for self-programming, as shown in
Table 3-9. Certain uses of the instructions are not valid. In these
cases, the instruction is executed as though it were a nop
instruction (i.e. the program counter is incremented, but no other
registers or bits are affected).