Introduction to MCU Software Addressing Technology

Publisher:bln898Latest update time:2018-04-11 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  In the data acquisition system with 80C31 as the control core, a large external RAM is often needed to store data. As we all know, 80C31 is an 8-bit CPU with a 16-bit address bus width. Its external RAM and ROM can directly address 64k bytes each (0000H-FFFFH). In the working process of 80C31, the addresses of ROM and external RAM are overlapped, but different control signals and instructions are used, while the extended I/O port and external RAM are uniformly addressed, occupying the address unit of the external RAM and using the same read/write control signals and read/write instructions of the external RAM.


  In data acquisition systems, large-capacity external RAM is often required, and external devices such as displays, A/D converters, and printers must also be expanded with I/O. In the process of designing an intelligent sound level meter, the author requires that the 80C31 expand the external RAM to 64kB bytes, and the expansion I/O port uses the 82C55 chip to connect the character LCD, keyboard, A/D converter input, and printer. A software logic switch is used to achieve the overlapping use of the addresses of the 64k bytes of external RAM and the expansion I/O port, making full use of the data storage space directly addressed by the 80C31. The circuit is shown in the figure below.

      

33

   80C31 expands a program memory (EPROM) 27C64. The P0 port of 80C31 provides the low 8-bit address line through the address latch 74HC373, and the P2.0-P2.4 of 80C31 are the high 5-bit address lines, a total of 13 address lines (213=8k). Data reading is controlled by PSEN of 80C31, using MOVC instructions. Since only one EPROM is expanded, the chip select terminal CE of 27C64 is grounded.

  80C31 expands 2 data memory chips 62256. 62256 is a 32kx8-bit static random access memory chip, made with CMOS technology and powered by a single power supply +5V. It has 15 address lines (215=32k), of which the lower 8 bits are provided by the P0 port of 80C31 through the address latch 74HC373. The P2.0-P2.6 address lines of the P2 port of 80C31 supply the higher 7 bits of address. The P2.7 line is connected to the chip select terminal CE1 of 62256 (1) and 62256 (2) without or through an inverter. When P2.7=0, 62256 (1) is selected and the address is 0000H-7FFFH. At this time, P2.7 is 0, and the chip select terminal CE1 of 62256 (2) is high through the inverter, and 62256 (2) is disabled. When P2.7=1, the chip select CE1 of 62256(1) is high, 62256(1) is disabled, and after inversion by 74HC04, the chip select CE1 of 62256(2) is low, 62256(2) is enabled, the address is 8000H-FFFFH, and the 80C31 expands the external RAM to 64k bytes (32KX2).

  In order to meet the working requirements of the intelligent sound level meter, it is also necessary to expand the I/O port to connect the A/D conversion input, keyboard, display and printer. The author uses the 82C55 chip in the programmable parallel I/O port. Its A port is connected to the parallel output of the MC14433 dual-integral A/D conversion chip and programmed as input mode. Port B is connected to the printer and programmed as output mode. Port C is connected to the keyboard P6.0-P6.3 and programmed as input mode, as keyboard input line. P6.4-P6.7 is programmed as output mode and used as scan output line. The display uses DMC16230 character LCD, whose bus is connected to the 80C31P0 port data bus, the 82C55's port address selection terminals A0 and A1 (the registers of port A, port B, port C and control port can be selected respectively through programming A0 and A1) and the LCD's RS terminal (low level selects instruction register, high level selects data register) and R/W terminal (read and write selection) are respectively connected to the low address lines A0 and A1 of the address bus, the P1.0 line of 80C31, the A2 line of the address bus and the OE terminal (read control terminal) and WE terminal (write control terminal) of 62256, the chip select terminal CS of 8255 and the chip select terminal E of LCD are connected to the software logic switch.

  The software logic switch is composed of logic elements and is controlled by software. Its working principle is as follows: when the program sets P1.0=1 of 80C31, an OR gate is connected to the chip select terminal CS of 82C55. When CS=1, 82C55 is disabled (low level selection). The signal of P1.0 port is connected to the chip select terminal E of LCD through two inverters and a NAND gate. When the chip select terminal E=0, LCD is also disabled (high level selection). The signal of P1.0=1 is low level through the inverter, and then connected to the OE and WE terminals of 62256 through two OR gates. In this way, the RD and WR signals of 80C31 can control the OE and WE terminals of 62256 respectively through two OR gates, and read and write operations are performed normally, so it is disabled when P1.0=1. 82C55, LCD only operates 62256, and when P1.0=0, the signal is high level through the inverter, and the OE and WE levels of 62256 are high level through two OR gates, thereby prohibiting the RD and WE terminals of 80C31 from reading and writing 62256 (low bit is valid). The selection of 82C55 or LCD by the signal of P1.0=0 depends on the level state of A2 in the address bus. When A2=1, the signal is low level through the inverter and the signal at P1.0, and then input to the CS terminal of 82C55 through the OR gate is low level, and 82C55 is selected. At this time, the signal of A2=1 and P1.0=0 is input to the E terminal of LCD through the inverter and the NAND gate at a low level, and LCD is prohibited. The port address of 82C55 is FFFCH-FFFFH. When A2=0, the signals of A2=0 and P1.0=0 are input to the CS terminal of 82C55 through the inverter and the OR gate as high level, and 82C55 is disabled. At this time, the signals of A2=0 and P1.0=0 are input to the E terminal of LCD through the inversion and the NAND gate as high level, and LCD is selected, and its address is FFF8H-FFFFBH. Through the above circuit analysis (the logical relationship is shown in Table 1), it can be clearly seen that the selection of P1.0 and address line A2 of 80C31 by software operation through the software logic switch effectively selects 62256, 82C55, or LCD respectively, realizes the overlapping use of addresses between them, and achieves the purpose of 80C31 expanding the direct addressing range of all external RAM.

Logic
Device ModelP1.0=1P1.0=0address
A2=0A2=1
62256Strobeprohibitprohibit0000H—FFFFFH
LCDprohibitStrobeprohibitFFF8H—FFFFBH
LCDprohibitprohibitStrobeFFFCH—FFFFFH


Keywords:MCU Reference address:Introduction to MCU Software Addressing Technology

Previous article:Design of Simple Signal Source Based on Single Chip Microcomputer
Next article:Security demonstration of single-chip electronic password lock based on infrared module

Recommended ReadingLatest update time:2024-11-23 11:18

Design ideas for single chip microcomputer precision voltage source/current source
1. Main hardware parts:                1 Human-computer dialogue Main control MCU ATMEGA32A (ATMEGA16).               2 Positive power control MCU ATMEGA32A (ATMEGA16).              3 Negative power control MCU ATMEGA32A (ATMEGA16).              4 Two main power transformers Czech talema 333VA 37V 9A as positive an
[Microcontroller]
Simulation design of automatic street light switch control based on 51 microcontroller
Simulation diagram proteus7.8 and above Program compiler: keil 4/keil 5 Programming language: C language Design number: S0052 1. Main functions: Perpetual calendar clock simulation design based on 51 microcontroller Simulation design of automatic street light switch control based on 51 microcontroller 1. Measure the
[Microcontroller]
Simulation design of automatic street light switch control based on 51 microcontroller
Design of three-phase half-controlled rectifier circuit for PIC microcontroller chip
Rectification circuits are widely used in DC motor speed regulation, DC voltage regulation and other occasions. The three-phase half-controlled rectifier bridge circuit structure is a common rectifier circuit, which is easy to control and has low cost. This article introduces a three-phase half-controlled rectifier
[Microcontroller]
Design of three-phase half-controlled rectifier circuit for PIC microcontroller chip
Detailed explanation of 51 single chip microcomputer program execution process
    The microcontroller does not have an operating system. The codes written in Keil are all bare-metal codes. In-depth writing of bare-metal codes helps to understand the characteristics of the hardware.     If the hardware characteristics are not fixed, the other processes are all caused by the code. I suddenly thou
[Microcontroller]
Detailed explanation of 51 single chip microcomputer program execution process
Design of Carbon Monoxide (CO) Concentration Alarm Based on 51 Single Chip Microcomputer
The CO concentration alarm design based on 51 single chip microcomputer was successfully tested. MQ series gas sensors are universal! The simulation schematic diagram is as follows (the proteus simulation project file can be downloaded in the attachment of this post). The actual picture produced is as follows: Car
[Microcontroller]
Design of Carbon Monoxide (CO) Concentration Alarm Based on 51 Single Chip Microcomputer
Design and Implementation of Interface Between SST89C54 Single Chip Microcomputer and CF Card
1 Introduction The emergence of electronic storage devices has made it possible for many portable devices to process and store large amounts of data in real time. CF cards (Compact Flash cards) have been widely used in data acquisition systems and many consumer electronic products due to their large capacity,
[Microcontroller]
[51 single chip microcomputer] The problem of erasing of data tube
Disappearance of digital tube Not faded code #include reg52.h   sbit wela=P2^7; //bit selection   sbit dula=P2^6; //segment selection void main() {       while(1)       { //Always show            dula=1;            P0=0x06; //Display 1            dula=0;                       wela=1;            P0=0xfe; //Sele
[Microcontroller]
[51 single chip microcomputer] The problem of erasing of data tube
Design of Carbon Monoxide Monitoring and Alarm Instrument Based on ADuC834 Single Chip Microcomputer
Introduction With the rapid development of industry, there are more and more occasions where humans are exposed to harmful gases, which causes more and more harm to humans themselves. In steel mills and iron mills, the blast furnace gas (mainly composed of CO), a byproduct of blast furnace production, i
[Microcontroller]
Latest Microcontroller Articles
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号