The commonly used chips for expanding program memory are EPROM (Erasable Programmable Read Only Memory) type (UV erasable type), such as 2716 (2K×8), 2732 (4K×8), 2764 (8K×8), 27128 (16K×8), 27256 (32K×8), 27512 (64K×8), etc. In addition, there are +5 V electrically erasable EEPROM, such as 2816 (2K×8), 2864 (8K×8), etc.
UV-erasable electrically programmable read-only memory (EPROM) is a widely used program memory in China. There is a glass window on the EPROM chip. Under ultraviolet light, each bit of information in the memory changes to 1, that is, it is in an erased state. The erased EPROM can be used to fix the application program into the chip through a programmer.
If the total amount of the program does not exceed 4 KB, a microcontroller with internal ROM is generally selected. The internal ROM of 8051 can only be solidified by the manufacturer once, which is not suitable for small batch users and program debugging. Therefore, more users choose 8751 and 8951. If the program exceeds 4 KB, users generally do not choose 8751 or 8951, but directly choose 8031 and use external expansion memory to store the program.
Example: Expanding 4 KB EPROM program memory on an 8031 microcontroller.
Select chip
This example requires the use of an 8031 microcontroller with no internal ROM area. Regardless of the length of the program, the program memory must be expanded (this method is rarely used now, but the expansion method is typical and practical).
When choosing a program memory chip, the program capacity must be met first, and secondly, a chip with large capacity should be selected as much as possible under reasonable price. In this way, fewer chips are used, so the wiring is simple, the chip storage capacity is large, and the program adjustment margin is also large. If the total length of the program is estimated to be about 3 KB, it is best to expand a 4 KB EPROM 2732 instead of using two 2716 (2 KB) chips. In the hardware design of the single-chip microcomputer application system, it should be noted that the number of chips used should be minimized to make the circuit structure simple and improve reliability. This is one of the reasons why 8951 is more widely used than 8031.
Hardware Circuit Diagram
The circuit of expanding the 8031 microcontroller with a 2732 program memory is shown in the figure.
[page]
Chip Description
①74LS373. 74LS373 is an 8D latch with tri-state buffer output. Since the lower 8 bits of the data line and address line share the P0 port in the three-bus structure of the microcontroller, an address latch must be used to distinguish the address signal from the data signal. The latch control terminal G of 74LS373 is directly connected to the latch control signal ALE of the microcontroller, and the lower 8 bits of the address are latched on the falling edge of ALE.
②EPROM 2732. The capacity of EPROM 2732 is 4 K×8 bits. 4 K means there are 4×1024 (22×210=212) storage units, and 8 bits means the width of each unit storing data is 8 bits. The former determines that the number of bits of the address line is 12 bits (A0~A11), and the latter determines that the number of bits of the data line is 8 bits (O0~O7). At present, except for serial memory, we generally use 8-bit data memory. 2732 uses a single +5 V power supply, the maximum static operating current is 100 mA, the maintenance current is 35 mA, and the maximum read time is 250 ns. The package form of 2732 is DIP24, and the pins are shown in the figure.
Among them, A0~A11 are address lines; O0~O7 are data lines; is chip select line; OE/VPP is output enable/programming high voltage. In addition to 12 address lines and 8 data lines, CE is chip select line, and low level is effective. That is to say, only when CE is low level, 2732 is selected, otherwise, 2732 does not work. OE/VPP is a dual-function pin. When 2732 is used as a program memory, its function is to allow data to be read out; when programming EPROM (also called curing program), this pin is used for high voltage input, and the programming voltage of chips from different manufacturers is also different. When we use it as a program memory, we don’t have to care about its programming voltage.
Connection Instructions:
① Address line. When the microcontroller expands the external memory, the address is provided by the P0 and P2 ports. In Figure 6.2, among the 12 address lines (A0~A11) of 2732, the lower 8 bits A0~A7 are connected to the P0 port through the latch 74LS373, and the upper 4 bits A8~A11 are directly connected to the P2.0~P2.3 of the P2 port. The P2 port itself has a latching function. Note that the latch enable terminal G of the latch must be connected to the ALE pin of the microcontroller.
② Data line. The 8-bit data line of 2732 is directly connected to the P0 port of the microcontroller. Therefore, the P0 port is a time-division multiplexed address/data line.
③ Control lines. When the CPU executes the program instructions stored in 2732, the instruction fetching stage is to read the 2732. Note that the CPU can only read the EPROM, not write it. The CPU's read operation control of 2732 is achieved through control lines. The connections of 2732 control lines are as follows:
CE: Directly connected to ground. Since only one program memory chip is expanded in the system, the chip select terminal of 2732 is directly connected to ground, indicating that 2732 is always selected. If multiple chips are expanded at the same time, the chip selection work needs to be completed through a decoder.
OE: Connected to the read enable signal terminal of 8031. When accessing the off-chip program memory, as long as a negative pulse appears at the terminal, the program can be read from 2732.
Determination of extended program memory address range
The key to expand the memory of a single-chip microcomputer is to understand the address range of the expansion chip. The maximum expansion of 8031 is 64 KB (0000H ~ FFFFH). There are two factors that determine the address range of the memory chip: one is the connection method of the chip select terminal, and the other is the connection between the address line of the memory chip and the address line of the single-chip microcomputer. When determining the address range, the chip select terminal must be kept at a low level.
In this example, the address range of 2732 is 0000H~0FFFH:
Uses of EPROM
The memory expansion circuit is the functional expansion part of the single-chip microcomputer application system. Only when the software design of the application system is completed can the program be solidified into 2732 through a specific programming tool (generally called a programmer or EPROM solidifier), and then the 2732 can be inserted into the socket of the user board (the socket must be soldered to expand the program memory).
Previous article:51 MCU timer working mode
Next article:Interface Design between MCS_51 Single Chip Microcomputer and 8255A
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- TI DSP FFT library functions
- See you in April丨The 2021 Munich Shanghai Electronics Show is about to start, and pre-registration is in full swing!
- Live Review: June 28th Datang NXP Semiconductors | Battery Management Chip Solution Design and Precautions
- Dear students, Qorvo 2021 campus recruitment is here, take action now.
- Video tutorial on developing RT-Thread with Bluexun AB32VG1
- Scanning interface for rotary flow meters
- I saw two interesting news this morning: What are the trade-offs in autonomous driving? Is there anything that cannot be changed in the CAN bus?
- Adafruit LED glasses running circuitpython
- Detect and harden against non-invasive tampering attacks
- 128X64 LCD module with Chinese character library