An example of extending the EPROM program memory of 8031 ​​single-chip microcomputer

Publisher:WhisperingHeartLatest update time:2013-05-14 Source: 21IC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

8031 single chip microcomputer expands a 2732 program memory circuit[page]

Chip Description

8031 MCU 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).

Reference address:An example of extending the EPROM program memory of 8031 ​​single-chip microcomputer

Previous article:51 MCU timer working mode
Next article:Interface Design between MCS_51 Single Chip Microcomputer and 8255A

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号