18.11.2014 Views

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Saving Programs<br />

4<br />

Saving Programs<br />

In Chapter 3’s experiments, the BASIC-52 programs that you wrote were stored in RAM.<br />

This is fine for temporary use, but every time you power down, your program disappears<br />

and you have to start over.<br />

This chapter shows you two ways to save BASIC-52 programs more permanently: by adding<br />

nonvolatile memory to the BASIC-52 system, and by downloading your programs to your<br />

host system’s disk. <strong>The</strong> nonvolatile memory may be battery-backed RAM, EEPROM, or<br />

EPROM. You can also use this memory for storing assembly-language programs or data<br />

that you want to save when you power down or reset. Disk storage is a convenient way to<br />

save programs if you want to edit them off-line, upload them to a different BASIC-52 system,<br />

or just save back-up copies.<br />

Nonvolatile Memory Options<br />

One of BASIC-52’s handiest features is its programming commands that store programs in<br />

nonvolatile (NV) memory: EPROM, EEPROM, or battery-backed RAM. <strong>The</strong> commands<br />

assume that the NV memory is addressed beginning at 8000h in external data memory.<br />

With the addition of NV memory, you have two areas that may contain BASIC-52 programs:<br />

the NV memory, addressed beginning at 8000h, and the RAM, addressed beginning at 0. To<br />

distinguish between the two areas, you can call the memory beginning at 8000h the EPROM<br />

<strong>The</strong> <strong>Microcontroller</strong> <strong>Idea</strong> <strong>Book</strong> 47

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!