Use the ALE signal as the latch control signal for the lower 8-bit address. When ALE is connected to an external latch, during the high level period, the p0 of 51 outputs the address, and during the low level period, the latch latches the address. When ALE is low (PSEN is low), the p0 port can transmit data (instructions), so that address/data multiplexing is possible.
The PSEN signal is used as the read select signal of the extended program memory. When reading the external ROM, PSEN is valid at a low level to implement the ROM read operation.
The EA signal is used as the selection control signal for the internal and external program memory. When it is at a low level, the read operation of the ROM is limited to the external program memory. When it is at a high level, the read operation of the ROM starts from the internal memory and can be extended to the external program memory.
The RD and WR signals are used as read enable and write enable signals for the extended data memory and I/O port.
The EA signal is a control signal indicating whether the current instruction is to read the internal or external memory. For example, when a microcontroller without internal memory is selected, or when the internal memory is not to be used, EA must be connected to a low level. In addition, the starting address of the external program memory should be arranged after the internal memory.
The RD and WR signals are relatively easy to understand, that is, they are valid when reading data (regardless of internal or external, RAM or ROM). The same is true for WR.
The instruction fetching and execution sequence of 80C51 single-chip microcomputer instructions
Now we will introduce the CPU timing according to the four types of instructions. Because the CPU works by fetching and executing instructions, the CPU must first fetch instructions before it can execute them.
1. Double-byte single-cycle instructions
Since the double-byte single-cycle instruction must fetch the machine code twice in one cycle, the operation of reading the opcode twice must be arranged in one machine cycle, which occurs at S1P2 and S4P2 respectively. The machine code 74 is read in S1P2 and sent to the instruction register IR, and the data 03 is read in S4P2 and sent to the accumulator A, that is, read 2 and take 2. During the execution of the instruction, the P0 port must transmit the address and data in time. Therefore, when the address of the opcode is output from the P0 port, the address latch signal ALE must be sent to the 74LS373 latch to latch the address in the 74LS373, freeing up the P0 port to read the machine code 74. The ALE signal must also be sent when fetching data 03. Therefore, the address latch signal is valid twice in one machine cycle, see the 80C51 timing diagram 2-13.
2. Single-byte single-cycle instruction
For single-byte single-cycle instructions, since the opcode is only one byte, the first read opcode is valid, while the second read opcode will be discarded, that is: read 1 and discard 1, and the program counter PC will not increase by 1.
3. Single-byte two-cycle instruction
For single-byte two-cycle instructions, since the opcode is only one byte and the execution time is as long as 2 machine cycles, the opcode is discarded except for the first read opcode, that is: read 1 and discard 3.
4. Access external memory instruction MOVX
When executing the instruction MOVX to access external memory, the instruction is first fetched from the program memory, and then the data is fetched from the external data memory, so the execution timing diagram of this instruction is different from the previous three types of instructions. Since MOVX is a single-byte two-cycle instruction, it reads 1 and loses 1 in the instruction fetch stage (i.e. S1P1 to S4P2 of the first machine cycle), and the operations completed in the instruction read data stage (i.e. S5 of the first machine cycle to S3 of the second machine cycle) are as follows:
(1) First, the address ADDR of the external data storage unit is output from the P0 and P2 ports by DPTR, which is the S5P1 to S6P2 stage in the timing diagram. And in the S4P2 to S5P2 stage, the ALE signal is sent to latch the address.
(2) In the second machine cycle S1P2 to S2P2, ALE and program selection signal PSEN are canceled (i.e. instruction fetch operation is canceled), so that port P0 is used exclusively for data transmission. At the same time, a read signal is sent to transfer the data in the external data storage unit to accumulator A through port P0. That is, the S6P2 to S4P1 stage of the timing diagram. [page]
(3) Since the latched address is the address of the external data storage unit, the instruction fetch operation is canceled in the second machine cycle S4, that is, the program selection signal PSEN is no longer sent.
Note: Since the ALE signal is sent one less time in the second machine cycle when executing the MOVX instruction, the frequency of ALE is unstable.
Previous article:Detailed explanation of the working principle of 51 single-chip microcomputer P0 port
Next article:Brief description of microcontroller reset circuit
Recommended ReadingLatest update time:2024-11-16 22:28
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- How to read electrical control circuit diagrams (Classic best-selling books on electronics and electrical engineering) (Zheng Fengyi)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- What is a hysteresis comparator?
- Eliminate distractions
- 【Maturity Cycle】Maturity Cycle of Automotive Electronics Engineers
- A collection of ESP32 experience posts. Netizens who are learning ESP32 can take a look.
- 883 Q What does Q stand for in the device identification?
- Received the prize, I feel the delivery speed is very fast now
- LM358 op amp problem, please give me some advice
- How to Measure Circuit Current Using a Shunt Resistor
- TI's ultra-low power solution gives birth to TWS true wireless
- 【TI millimeter wave radar evaluation】+SDK development environment