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
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 4<br />
because of its longer write times. <strong>The</strong> program erases all of the stored programs and any<br />
options selected with FPROG1-6 in U8.<br />
Adding more NVRAM or EEPROM<br />
If you want to add an additional 8K of NV RAM or EEPROM, wire another circuit exactly<br />
like Figure 4-3’s, except connect pin 20 of the new NVRAM or EEPROM to A000h (pin<br />
10 of U4) ORed with RESET, so that the chip will be accessed from A000h to BFFFh.<br />
Adding EPROM<br />
Adding EPROM requires more circuitry than NVRAM or EEPROM, because an EPROM<br />
must have a programming voltage at its VPP pin during programming. To use the faster<br />
FPROG commands, which follow Intel’s Intelligent programming algorithm, you should<br />
also raise the EPROM’s supply voltage (VCC) to +6 volts during programming.<br />
Although EPROMs do require additional components, once you have them in the circuit,<br />
you can use the 8052-BASIC system as a general-purpose EPROM programmer, as<br />
described in Chapter 13. You can store assembly-language programs or any information that<br />
you want to save in EPROM, whether it’s for use by the 8052-BASIC system or another<br />
project.<br />
EPROM Types<br />
Since EPROMs were first developed in the 1970’s, each generation of devices has allowed<br />
larger capacities, faster programming, and reduced programming voltages. Although the<br />
recommended programming algorithms, or procedures, for EPROMs are alike in many<br />
ways, the details often vary, depending on the device and manufacturer.<br />
Programming Algorithms<br />
For critical applications, there is no substitute for consulting the EPROM’s data sheet and<br />
following its recommendations exactly. But for general use, you can get reliable results with<br />
most EPROMs by using one of the two algorithms supported by BASIC-52.<br />
50-millisecond programming. This algorithm is an older, slower procedure. To program a<br />
location in the EPROM, you apply a programming voltage to the VPP input, set the address<br />
and data lines to the desired values, and apply a 50-millisecond programming pulse at the<br />
PGM input to write the data into the EPROM at the selected address. You then increment the<br />
address, apply the new data and programming pulse, and continue in this way until all<br />
locations are programmed. After programming, you compare the EPROM’s contents to the<br />
programming data to verify that all locations programmed correctly. (BASIC-52 varies from<br />
this standard by verifying each location immediately after programming.)<br />
56 <strong>The</strong> <strong>Microcontroller</strong> <strong>Idea</strong> <strong>Book</strong>