Design of interface between MCS-51 single chip microcomputer and PLD programmable device

Publisher:好的哎Latest update time:2012-02-10 Source: 半导体技术 Keywords:MCU  PLD  EDA  VHDL Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

In the field of electronic design technology, the widespread use of programmable logic devices has brought great flexibility to the design of digital systems. Since the device can reconfigure the structure and working mode of its hardware through software programming, the design of hardware can be as convenient and fast as software design. This has greatly changed the traditional digital system design method and design process.

As we all know, the single-chip microcomputer has the characteristics of high performance-price ratio, flexible functions, easy human-computer dialogue, and good data processing capabilities. PLD has the advantages of high integration, high speed, high reliability, and convenient and standardized development. As far as the currently commonly used intelligent instruments and industrial measurement and control systems are concerned, the application field of the integrated electronic system composed of PLD and single-chip microcomputer as core components is very broad. If the flexible control function and good human-computer dialogue function of the single-chip microcomputer are combined with the high speed and high reliability of the PLD, it will effectively break through the obstacles in the design of traditional electronic systems and greatly improve the performance of electronic systems. This article will discuss the interface problem between MCS-51 and PLD.

2 Interface Mode

There are generally two ways to interface a single-chip microcomputer with a PLD device: independent mode and bus mode. The timing of independent communication can be freely determined by the designed software, and the form is flexible and diverse. Its biggest advantage is that the interface logic does not need to follow the fixed bus mode read and write timing in the single-chip microcomputer. The logic design of the PLD and the single-chip microcomputer program design of the interface can be completed relatively independently in sequence. Therefore, the independent mode is relatively simple and will not be introduced in detail here.

The single-chip microcomputer communicates data with the PLD device in bus mode. For the single-chip microcomputer, its programming is simple and reliable compared to the non-bus mode. Only one single-byte instruction is needed to complete the required read and write operations, such as MOV @DPTR, A; MOV A, @DPTR. Its communication is a pure hardware behavior, so it is fast. For PLD devices, I/O port lines can be saved, as shown in Figure 1. Through 19 I/O port lines, various data information can be exchanged between the single-chip microcomputer and the PLD device.


To design the interface logic for the single-chip microcomputer and the PLD device to communicate in bus mode, it is necessary to understand the bus read and write timing of the single-chip microcomputer in detail. Figure 2 is the timing diagram of the MCS-51 single-chip microcomputer. ALE is the address latch enable signal. Its falling edge can be used to latch the lower 8-bit address into the address latch of the PLD through the P0 port. At the same time, the upper 8-bit address is at the P2 port. The microcontroller uses the low level of the read instruction enable signal PSEN to read the instruction from the P0 port. The timing of reading the instruction is before the rising edge of PSEN arrives. Then, the upper 8-bit and lower 8-bit data addresses are output from the P2 port and the P0 port respectively, and the lower 8-bit address of the P0 port is latched into the address latch by the falling edge of ALE. The microcontroller can make RD a low level through the instruction MOV A, @DPTR, and read the data latched in IN1 (or IN2) into accumulator A through the P0 port. If you want to send the data of accumulator A to the PLD, you can generate the write enable signal WR through the instruction MOV @DPTR, A, so that the decoder outputs the WR-ENABLE signal, thereby writing the data into the output latch.

[page]

3 Interface Programming

In recent years, with the continuous development of EDA technology, people generally accept VHDL language among various description languages. This language has the reputation of "World Language" in the field of electronic design. The interface software of this design is written in VHDL language. Due to space limitations, only the VHDL program of the construct is given here: . . . . . .

BEGIN
PROCESS(ALE)
BEGIN
IF ALE'EVENT AND ALE='0'THEN
LATCH-ADDERS<=P0; END IF;END PROCESS; =
' 1';END IF;END PROCESS; PROCESS(WR-ENABLE)
BEGIN
IF
WR -ENABLE'EVENT AND WR-ENABLE='1' THEN OUT1<=P0;END IF;END PROCESS; PROCESS(P2, LATCH -ADDRES,READ,RD) BEGIN IF(LATCH-ADDRES="01101110")AND(P2="11110001")AND(READY='1')AND(RD='0') THEN P0<=IN1; ELSE P0<="ZZZZZZZZ";END IF;END PROCESS; PROCESS(DIN1) BEGIN IF DIN1'EVENT AND DIN1='1' THEN IN1<=DIN1;END IF;END PROCESS; PROCESS(P2,LATCH-ADDRES,READ,RD) BEGIN IF(LATCH-ADDRES="01101010")AND(P2="11110011")AND(READY='1')AND(RD='0') THEN P0<=IN2; ELSE P0<="ZZZZZZZZ";END IF;END PROCESS; PROCESS(DIN2) BEGIN IF DIN2'EVENT AND DIN2='1' THEN IN2<=DIN2;END IF;END PROCESS; DOUT1<=OUT1; . . . . . . For example, the instruction for AT89C51 to send data 4DH to OUT1 is: MOV A, #4DH MOV DPTR, #F5F0H MOVX @DPTR, A When READY is high, the instruction for AT89C51 to read data from IN1 of PLD device is: MOV DPTR, #F16EH MOVX A, @DPTR The instruction for AT89C51 to read data from IN2 of PLD device is similar to that to read data from IN1 of PLD device, the only difference is the entry address.
































4 Conclusion

This article uses the Lattice company's PLD device ISPLSI1032 and the interface circuit designed based on the VHDL description language. It has the advantages of small size, reliable performance, convenient development, and few peripheral components. The circuit design adopts a top-down system design method. Using the software and hardware circuits introduced in this article, combined with specific design occasions, various forms of interface circuits can be transformed.

Keywords:MCU  PLD  EDA  VHDL Reference address:Design of interface between MCS-51 single chip microcomputer and PLD programmable device

Previous article:Design and Application of AC89C2051 in Fully Digital Frequency Conversion Controller
Next article:Application of CRC error checking method in serial communication between PC and 8031 ​​microcontroller

Recommended ReadingLatest update time:2024-11-16 17:48

Design of Image Processing System Based on 89C55 Single Chip Microcomputer
With the popularization of image processing technology, its application scope is getting wider and wider. In the fields of medicine, military, public security, etc., especially in recent years, it has been widely used in industrial automation and industrial detection. Most of the current image processing systems use
[Microcontroller]
Design of Image Processing System Based on 89C55 Single Chip Microcomputer
AVR MCU Voltage Meter Program
AVR voltmeter program: #include iom16v.h #include macros.h #define uchar unsigned char #define uint unsigned int #define setb(val,bitn) (val|=(1 (bitn)))//Set a bit of an IO port to 1 #define clr(val,bitn) (val&=~(1 (bitn)))//Set a bit of an IO port to 0 #define get(val,bitn) (val&(1 (bitn)))//Read a bit statu
[Microcontroller]
PIC12F675 MCU LED control program
//Experiment: key input, LED display status //When KEY1 is pressed, LED1 lights up, when KEY2 is pressed, LED2 lights up, and when the key is released, the LED turns off #include pic.h __CONFIG(0x31B4); //Reference: "PIC12F629/675 Data Sheet" Page 52 9.1 Configuration Bits #define KEY1 GP2 #define KEY2 GP5 #def
[Microcontroller]
MCS51 MCU counter/timer working mode 3 programming example
2 8-bit modes. Mode 3 is only applicable to timer 0. If timer 1 is set to mode 3, timer 1 will be in the off state.  When T0 is in mode 3, THo and TL0 are divided into 2 independent 8-bit counters . Among them, TL0 can be used as both a timer and a counter, and uses all the control bits of the original T0 and its time
[Microcontroller]
MCS51 MCU counter/timer working mode 3 programming example
Microcontroller entry design: a simple and fun heart rate meter
This little thing is simple and fun, and can be used as a course design for beginners of microcontrollers. Place your index finger gently on the sensor and you will see the LED indicator flashing with your heartbeat. After 15 seconds, your current heart rate will be displayed on the digital tube. The core part
[Analog Electronics]
Microcontroller entry design: a simple and fun heart rate meter
C program for microcontroller to control ds1302 clock
/**************************************************/ /* ds1302 real-time clock C program*/ /*51hei.com member classic works have been tested successfully/ /**************http://www.51hei.com/ziliao/file/ds1302c.rar Click this link to download the code of this example****/ #include reg52.h #incl
[Microcontroller]
STC12C2052AD MCU AD conversion C language program
First of all: This little program took me two days to complete, plus soldering the board for three days, of course in my spare time. It's also 24 hours. I stared at the computer for two nights. I disassembled and reassembled it (the downloaded program was not on this board). Finally, today! (“今” pronounced as t
[Microcontroller]
STC12C2052AD MCU AD conversion C language program
Interface Design of Single Chip Microcomputer Queuing System Based on IIC Bus
  0 Introduction   This paper takes the existing queueing system of the bank as an example and proposes the interface design of the single-chip microcomputer queueing system based on the IIC bus. Through the simulation test of the system, it not only simplifies the design circuit, reduces the circuit board area, sav
[Microcontroller]
Interface Design of Single Chip Microcomputer Queuing System Based on IIC Bus
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号