The operation sequence of the program memory based on AT89S51

Publisher:SereneSerenityLatest update time:2017-12-28 Source: eefocusKeywords:AT89S51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Control signals for   accessing program memory
  
When the   AT89S51 microcontroller accesses the external program memory, the following three control signals are used.
  
  (1) ALE - used for low 8-bit address latch control.
  
  (2) PSEN (the inverse) - the "read enable" control signal for the external program memory. It is connected to the OE (the inverse) pin of the external EPROM.
  
  (3) EA (the inverse) - the control signal for accessing the internal and external program memory. When EA (the inverse) = 1, when the address sent by the microcontroller is less than the maximum address of the internal program memory, the internal program memory is accessed; when EA (the inverse) = 0, only the external program memory is accessed.
  
  If the instruction is read from the external EPROM, in addition to ALE for the low 8-bit address latch signal, the control signal also includes PSEN (the inverse), which is connected to the OE (the inverse) pin of the external EPROM. In addition, the PO port and the P2 port are also used. The PO port is used as the low 8-bit address bus and data bus in time sharing, and the P2 port is used as the high 8-bit address line.
  
  2. Operation timing
  
  The operation timing of the AT89S51 microcontroller on the external ROM is divided into two types, namely, the timing of executing non-MOVX instructions and the timing of executing MOVX instructions, as shown in the figure below.
  1
  (1) There is no external RAM in the application system When there is no external RAM (or I/O) in the hardware system, there is no need to execute the MOVX instruction. When executing non-MOVX instructions, the operation timing is shown in the figure below (a). The PO port is used as a bidirectional bus for address/data multiplexing, which is used to input instructions or output the low 8-bit address PCL of the program memory. The P2 port is specifically used to output the high 8-bit address PCH of the program memory. The P2 port has an output latch function. Since the PO port is time-division multiplexed, the low 8-bit address PCL output by the PO port must first be latched in the latch using ALE, and then the PO port is used as a data port. In each machine cycle , the address latch is allowed to be valid twice. When ALE is at the falling edge, the low 8-bit address PCL on the PO port is latched in the latch. At the same time, PSEN (the inverse) is also valid twice in each machine cycle, used to select the off-chip program memory and read the instruction into the chip.
  
  When the system has no off-chip RAM (or I/O), this ALE valid signal appears on the pin at 1/6 of the oscillator frequency
  
, which can be used as an external clock or timing pulse signal.   (2) When the application system is connected to an off-chip RAM, when executing the MOVX instruction to access the off-chip RAM (or I/O), the operation timing of the program memory changes. The main reason is that when executing the MOVX instruction, the 16-bit address should point to the data memory instead. The operation timing is shown in the following figure (b). Before the instruction is input, the addresses PCH and PCL output by the P2 port point to the program memory; after the instruction is input and determined to be a MOVX instruction, ALE latches the low 8-bit address of the off-chip RAM (or I/O) issued by the PO port in the S5 state of this machine cycle. If the instruction "MOVX A, @DPTR" or "MOVX @DPTR, A" is executed, the address is DPL (low 8 bits of data pointer); at the same time, DPH (high 8 bits of data pointer) appears on port P2. If the instruction "MOVX A, @R/" or "MOVX @R/, A" is executed, the content of R/ is the low 8 bits of address, and the content of the latch of port P2 will be on the line of port P2. The PSEN valid instruction fetch signal will no longer appear in the same machine cycle, and the ALE valid latch signal will no longer appear in the next machine cycle; and when RD/WR is valid, port PO will read/write the data in the data memory.
  
  It can be seen from the above figure (b):
  
  (1) When ALE is used as a timing pulse output, one ALE pulse will be lost when a MOVX instruction is executed.
  
  (2) Only in the second machine cycle when the MOVX instruction is executed, the data memory (or I/O) is read/written, and the address bus is used by the data memory.

Keywords:AT89S51 Reference address:The operation sequence of the program memory based on AT89S51

Previous article:Software and Hardware Design of 51 Single Chip Microcomputer Matrix Keyboard
Next article:51 MCU output and input interface expansion program design

Recommended ReadingLatest update time:2024-11-16 19:26

Precision measurement of belt speed based on photoelectric mouse sensor and its control system
introduction Belt drive is a common transmission device used in industrial production. Its commonly used speed detection device is a photoelectric encoder installed at the rotating end of the motor. However, in the long-term use of the equipment, due to unpredictable conditions such as wear, the motor speed a
[Microcontroller]
Precision measurement of belt speed based on photoelectric mouse sensor and its control system
Design of AT89S51 microcontroller multi-channel switch to control light-emitting diode display
1. As shown in Figure 4.3.1, P1.0-P1.3 of the AT89S51 microcontroller are connected to four light-emitting diodes L1-L4, and P1.4-P1.7 are connected to four switches K1-K4. Program the switch status reflected on the light-emitting diode. (When the switch is closed, the corresponding light is on; when the switch is ope
[Microcontroller]
Design of AT89S51 microcontroller multi-channel switch to control light-emitting diode display
AT89S51/52 MCU minimum system circuit schematic
    The minimum system of a single-chip microcomputer refers to the circuit system composed of the minimum devices required to make the single-chip microcomputer run. If the minimum system you build is used for research and study, it should meet the following requirements: 1. Power supply; 2. Single-chip microcomputer
[Microcontroller]
AT89S51/52 MCU minimum system circuit schematic
AT89S51 arithmetic instructions
  In the AT89S51 instruction system, there are single-byte addition, subtraction, multiplication, and division instructions, and the arithmetic operation function is relatively strong. Arithmetic operation instructions are all for 8-bit binary unsigned numbers. If you want to perform signed or multi-byte binary number
[Microcontroller]
AT89S51 arithmetic instructions
Design of single chip computer password lock
1. Experimental tasks According to the set password, two buttons are used to realize the password input function. When the password is entered correctly, the lock will be opened. If the password entered three times is incorrect, the buttons will be locked for 3 seconds and an alarm will be heard at the same time. The
[Microcontroller]
Design of single chip computer password lock
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号