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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 13<br />

With these added components and Listing B-2, you can program a DS1225 NV RAM, a<br />

28(C)64 EEPROM, or a 27(C)64 EPROM with an Intel Hex file.<br />

One use would be to program an EPROM for a non-BASIC-52 system, where EA is tied low<br />

and on bootup, the 8052 runs a program beginning at 0 in external code memory, instead of<br />

running the BASIC-52 interpreter in internal ROM. For this use, you must add A000h to<br />

the values given in all ORG directives. For example, you would change ORG 0 to ORG<br />

A000h, and change ORG 200h to ORG A200h. You can then use Listing B-2 to copy the<br />

program into the EPROM at A000h, remove the EPROM and install it at 0 in code memory<br />

in your non-BASIC-52 system. On bootup, the 8052 will run the program in EPROM.<br />

Another Way to Program EPROMs<br />

Listing 13-8 is another program that you can use to copy information from external data<br />

memory into an EPROM, EEPROM, or NVRAM. To use this program, you must specify<br />

the locations to copy (the source), the locations to copy to (the destination), and the device<br />

type to copy to. <strong>The</strong> program does the rest. With this program, you can copy information<br />

directly from RAM or other memory to another device, without uploading or translating to<br />

Intel Hex format.<br />

<strong>The</strong> program prompts you for and stores information about the programming algorithm and<br />

addresses to program and copy from. BASIC-52’s PGM instruction then uses this information<br />

to program the selected locations.<br />

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

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

Saved successfully!

Ooh no, something went wrong!