Design of Interface between AT89C2051 MCU and MT8880

Publisher:cocolangLatest update time:2012-03-09 Source: 微计算机信息 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

MT8880 produced by Canada MITEL is a DTMF (dual tone multi-frequency) sending/receiving chip with CPU interface, which can be directly interfaced with 6800 series microprocessors or single-chip microcomputers. However, for users of 51 series single-chip microcomputers who want to use MT8880 chips, they are concerned about how to interface 51 series single-chip microcomputers with MT8880. This article will take the AT89C2051 (2051 for short) single-chip microcomputer with 51 core as an example to introduce the design of the interface circuit between 2051 single-chip microcomputer and MT8880 for reference by relevant users.

1 Interface clock signal
During the use of MT8880, the author found through experimental research that MT8880 does not have very strict requirements on the timing of interface control signals. The key lies in how to provide the interface clock signal CP (pin 12) for MT8880. From the parameters provided in the original device manual of MITEL, it can be seen that the typical value of the CP clock cycle tCYC is 250nS (0.25μS). In fact, when tCYC is between 0.167 and 10μS (6MHz to 100KHz), MT8880 can still work normally, and the range of tCYC is relatively wide. Therefore, the generation of CP is relatively flexible and can be achieved in the following four methods.
⑴ As we all know, the address latch enable signal ALE of the 51 series microcontroller is 6 times the frequency of the crystal oscillator (for example, the crystal oscillator is 12MHz and ALE is 2MHz). Therefore, the address latch enable signal ALE can be used as CP.
⑵ Use the crystal oscillator output signal (3.58MHz) of MT8880 itself as CP, so that the generation of CP does not depend on the microcontroller.
⑶ When the crystal oscillator frequency used by the 51 series microcontroller is below 6MHz, the signal output by the crystal oscillator can be directly used as CP after being driven.
⑷ Use the I/O line to simulate the CP terminal, and cooperate with the SETB and CLR instructions to generate the CP signal required by the chip. It should be noted that some MT8880 chips cannot work properly with this method.
In summary, method ⑴ is the simplest, method ⑵ is the second, and the other methods are slightly cumbersome and have poor effects. That is, methods ⑴ and ⑵ are the best choices for generating CP signals.

2 Interface hardware design
Compared with other 51 series microcontrollers, the 2051 microcontroller mainly lacks a parallel bus for external expansion (no P0, P2 ports and some control lines). Since the 2051 has no ALE control signal, it is best to use the above method (2) to provide the CP signal when interfacing with the MT8880 chip.
The 2051 and MT8880 interface circuit is shown in Figure 1. It can be seen that the clock signal CP is provided from the crystal output terminal OSC2 of the MT8880 through a 30P capacitor. In addition, when interfacing, P1.0~P1.3 of the 2051 are used as data lines, and P1.4 and P1.5 control the R/W and RSO terminals of the MT8880 respectively.

Figure 1 2051 and MT8880 interface circuit

[page]

3 Interface software design
Based on the circuit in Figure 1, when designing the interface software, you only need to simulate the control timing of MT8880, use instructions to read and write the P1 port, and control the CRA, CRB and other registers inside the chip to achieve the send/receive control of MT8880. Here, only the interface program compiled by C51 is given.
3.1 Sending program
After the program is executed, the 7-digit code (5135535) pre-stored in the array W_BUF will be sent in DTMF mode.
#include
#define uc unsigned char
#define ui unsigned int
/* Sub-function (subroutine) description*/
void initialize(void);
void tran_init(void);
void transmit(uc data *p,uc count);
void delay(ui l);
/* Main function (main program) */
void main(void)
{ uc data w_buf[7];
SP=0x5f;
/* Pre-stored digital 5135535 */
w_buf[0]=5;
w_buf[1]=1;
w_buf[2]=3;
w_buf[3]=5;
w_buf[4]=
5; w_buf[5]=3;
w_buf[6]=5;
initialize();
tran_init();
transmit(w_buf,7);
initialize();
for(;;);}
/* MT8880 initialization sub-function*/
void initialize(void)
{ P1=0x3f; /* Read SR */
P1=0x20; /* CRA=0000 * / P1=0x20;
/* CRA=0000 */ P1=0x28; /* CRA=1000 */ P1=0x20; } /* CRB=0000 */ /* Send initialization sub-function*/ void tran_init(void) { P1=0x29; /* CRA=1001 */ P1=0x21; } /* CRB=0001 */ /* Send operation sub-function*/ void transmit(uc data *p,uc count) { uc i; for (i=0;i #define uc unsigned char uc data i,r_buf[7]; /* Sub-function (subroutine) description*/ void initialize(void); void rece_init(void); /* Main function (main program) */ void main(void) { SP=0x5f; i=0; initialize(); rece_init(); for(;;);} /* MT8880 chip initialization sub-function*/ void initialize(void) { P1=0x3f; /* Read SR */ P1=0x20; /* CRA=0000 */ P1=0x20; /* CRA=0000 */ P1=0x28; /* CRA=1000 */ P1=0x20; } /* CRB=0000 */ /* Receive initialization sub-function*/ void rece_init(void) { P1=0x24; /* CRA=0100 */ IT0=1; /* Edge triggered */ IE=0x81; } /* Enable interrupt, open interrupt */ /* Receive interrupt service routine */ void int0(void) interrupt 0 using 1 { P1=0x3f; /* Read SR */ P1=0x1f; /* Read RDR */
















































r_buf[i++]=P1&0x0f; } /* save */

4 Conclusion
In the research of a fund project, the author successfully used the above interface circuit to realize long-distance digital communication. The actual use proved that the interface is simple and reliable, and achieved satisfactory results.

References:
[1] MICROELECTRONICS ANALOG COMMUNICATIONS HANDBOOK. MITEL, 1991
[2] Ma Zhongmei. C language application design for single chip microcomputer. Beijing: University of Aeronautics and Astronautics Press, 1997

Reference address:Design of Interface between AT89C2051 MCU and MT8880

Previous article:Realization of Serial Communication between AT89C52 Single Chip Microcomputer and VB
Next article:Design of Single Chip Microcomputer Development System Based on KEIL 51

Recommended ReadingLatest update time:2024-11-16 22:01

Homemade MCU Part 12… Making and debugging the AT89C2051 programmer
  Now everyone uses S52, why use C2051! The price is similar. But C2051 is much smaller than S51 and S52, and it has only 20 pins. In some simple control, these pins are enough, and the small size is more advantageous. But it seems that there is no S2051 that supports online programming (ISP) at present. So I tried to
[Microcontroller]
Design of building direct-press visual intercom doorbell system based on AT89C2051
0 Introduction Most of the entrances to urban residential buildings are open, which is convenient for residents to enter and exit, but it also brings many inconveniences to residents' lives. For example, since anyone can enter the corridor of a residential building at will, we can see all kinds of paper advertisements
[Microcontroller]
Design of building direct-press visual intercom doorbell system based on AT89C2051
Use 2051 microcontroller to burn 24C02, 04, 08, 16
SCL BIT P3.2; EEPROM mother chip SDA BIT P3.3 SCL1 BIT P1.2; write to target EEPROM SDA1 BIT P1.3 ORG 0000H LJMP A1 ORG 002BH A1: MOV P0,#0FFH MOV P1,#0FFH MOV P2,#0FFH MOV P3,#0FFH A2: CLR P1.7; Programming success indicator SETB P3.7; Burning failure indicator JB P1.6,$;burn button LCALL M001 JNB P1.
[Microcontroller]
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号