Using Oscillator to Implement Clock Configuration of High-speed Serial Communication for 8051 MCU

Publisher:亚瑟摩根Latest update time:2012-02-01 Source: 机电之家 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
introduction

In many real-time monitoring systems and communication equipment fields today, long-distance data transmission is often required. Therefore, how to achieve high-speed, reliable and low-cost data transmission is a new technology that the 8051 microcontroller as the front-end or sending stage urgently needs to solve. Based on this, we use the chip DSl075--Econ oscillator (high-efficiency oscillator) from Dallas Semiconductor Company to provide a clock configuration design for the DS87C520 high-speed microcontroller of the 8051 series, achieving a high-speed baud rate for the microcontroller serial communication.


The Econ oscillator contains an internal oscillator to generate a basic frequency and a built-in frequency division chain to reduce the basic frequency to the required speed. Each model of the Econ oscillator provides four basic frequencies (60MHz, 66.67MHz, 80MHz, 100MHz) and an adjustable frequency division factor of up to 2052. The Econ oscillator can be configured as any type of clock control logic according to system needs, including microcontrollers (microprocessors), FPGAs, CPLD circuits, etc.

8051 microcontrollers and RS-232 serial communications

When selecting a clock, two factors should be carefully considered, namely, the clock frequency and the clock accuracy within the working period. In an 8051 microcontroller system, the clock frequency depends on the serial communication RS-232 used. For example, consider an asynchronous mode 1 serial communication using a 12MHz clock (the highest clock frequency of the early 8051). Table 1 lists the Timer 1 auto-reload values ​​required to establish a standard baud rate.


The actual baud rate in Table 1 is calculated according to the following formula: baud rate required timer 1 automatic reload value.


Where: BaudRate is the baud rate; SMOD is the baud rate multiplication bit; fosc is the oscillation frequency; TH1 is the timer 1 automatic reload value.

The values ​​in Table 1 are based on the following Timer 1 states:

The timer increments by 1 every 12 clock cycles (the timer of the DS87C520 microcontroller can increment by 1 every 4 or 12 clock cycles).

Automatic reload mode.

Disable baud rate multiplication (SMOD=0).

Table 1 shows the baud rate and baud rate error of early single-chip microcomputers using crystals.

In general, RS-232 serial communication, once the baud rate error exceeds 3%, communication errors may occur even if there are start bits or stop bits for synchronization in data transmission. The 3% allowable error limits the maximum communication rate of 12MHz crystal to 2400 baud, which was not bad in the early 1990s, but it is a big problem that cannot be ignored by today's standards.
Now, crystals suitable for serial communication of 8051 microcontrollers: 11.059MHz or 22.118MHz have been developed. The baud rate of microcontrollers has been greatly improved after using this crystal, as shown in Table 2. The data transmission rate can reach 57.6kps (doubling the baud rate of DS87C520 microcontrollers, which can reach 115.2kps when SMOD=1). Such a high communication rate - baud rate is already very impressive for most current microcontroller (or microprocessor) systems. With the gradual marketization of crystal 11.059MHz or 22.118MHz products, the application system of microcontrollers has been greatly broadened.

Timer 1 auto-reload value
Baud rate when Fosc = 11.059MHz Baud
rate when Fosc = 22.118MHz
255
28,799.5
57598.9
254
14399.7
28799.5
253
9599.8
19199.6
250
4799.91
9599.83
244
2399.95
4799.91
232
1199.98 2399.95 208
599.98 119.98 160 299.99 599.99 64 149.99 299.99 Note: The 3% deviation of the baud rate from the specified rate puts forward requirements for clock accuracy. Even if the clock frequency optimized for RS-232 serial communication is used, if the clock frequency changes by more than 3%, it will still affect the stability of communication.









Using DS1075 to provide clock for 8051 microcontroller

Why is it the best choice to use the new chip DSl075 chip - Eco oscillator to provide clock for 8051 microcontroller? Because its biggest advantages are convenience, flexibility, simplicity and reliability.

This model can provide four basic oscillation frequencies (60MHz, 66.67MHz, 80MHz, 100MHz). And the internal frequency divider can reduce the oscillation frequency to a low enough level to meet the application requirements of the 8051 microcontroller system. Theoretically, all four basic oscillation frequencies can be used in the 8051 system. However, if you plan to use the serial port of 8051, the base frequency should be selected to meet the crystal model required by the microcontroller, which depends on the required baud rate and the format of the baud rate generator provided by the microcontroller.

For the 8051 microcontroller, the crystal oscillator frequencies of 11.059MHz and 22.118MHz are satisfactory, and the resulting baud rate meets the tolerance requirement of nearly 3%. If an oscillator with a base frequency of 66.667MHz is selected, the base frequency 66.667MHz is divided six times to obtain a clock signal of 11.111MHz, which is very different from the ideal frequency of 11.059MHz (0.47%). Even in the worst case, the deviation from the setting is 1%, and the error value remains within the acceptable 3% range. The maximum deviation of DS1075-66 from the ideal frequency of 11.059MHz is 1.47%, which meets the communication rate requirement of 28.8kbps.

Because one of the great benefits of using the DS1075 chip-Econ oscillator is flexibility. In the design of 8051 applications, if the early 8051 or similar single-chip microcomputer or microprocessor (maximum clock frequency is 12MHz) was used, now you only need to reprogram the oscillator to upgrade it very simply. In some designs, you can even reprogram the DS1075 online; if you are using the early 40-pin dual-row 8051 single-chip microcomputer, now in addition to Dallas Semiconductor, there are many other companies that can provide a variety of models and fully compatible chips to replace them. Among them, the typical chip is the DS87C520 produced by Dallas Semiconductor, which uses the architecture of the world's most popular 8051 microcontroller. It is easy to use and has rich I/O resources, making it deeply loved by designers and widely accepted. Its popularity has already entered the portable field. Compared with the early 8051, it is not only faster, but also has an 11-fold improvement in performance indicators, and does not use a dual-row 40-pin package.

Therefore, by choosing the DS87C520 microcontroller of the 8051 series with a higher clock rate (maximum clock rate of 33MHz), the clock base frequency can be simply divided into three parts to 22.222MHz. At this time, the maximum error is 1.47%, which is still suitable for the application of 22.118MHz crystal baud rate. Higher processor performance can be obtained by selecting a higher clock frequency as needed.

Hardware Setup

When using DS1075, you need to establish a way to program the EEPROM memory contained in DS1075. The simple method is to directly purchase the DS1075K programming/evaluation board. The evaluation board with samples and Windows 2000 or XT (genuine) software will greatly simplify the programming of the device and provide a shortcut for design. That is, as long as the chip DS1075 is inserted into the DS1075K programming/evaluation, and then connected to the application board that can provide +5V power supply and oscillation source, programming can be established. After completing the DS1075 programming, connect the DS1075 with the DS87C520 microcontroller as shown in Figure 1.

Note: The output of DS1075 is connected to XTAL1 pin, while XTAL2 pin is floating. Generally, XTAL2 pin is the crystal output terminal of 8051, so if any component is connected to this pin, it will only increase the load of 8051 microcontroller. Therefore, when any additional clock device can be connected in parallel with XTAL1 pin of 8051 microcontroller, XTAL2 pin should be floating, and then 8051 will not exceed the output current specified by DS1075.

Conclusion

Using DSL075 chip Econ Oscillator to provide clock for 8051 series microcontrollers is a new technology to solve the high-speed data transmission in industrial control and communication fields using 8051 series microcontroller serial communication. The implementation of this design can achieve a higher performance-price ratio.

Reference address:Using Oscillator to Implement Clock Configuration of High-speed Serial Communication for 8051 MCU

Previous article:Headlight automatic positioning system based on C8051F020
Next article:New Clock Configuration for Serial Communication of 8051 High-speed Single-chip Microcomputer Based on DS1075

Recommended ReadingLatest update time:2024-11-16 16:40

MCP41010 digital potentiometer driver source code based on C8051F310
C Code #include "mcp41010.h"      void  MCP41010_init()   {       //P2MDIN // Power-on default digital       P2MDOUT = setBits(P2MDOUT,pin4|pin5|pin6|pin7);     // port2  4567  push-pull   }      #define  mcp_setCS()   {P2=setBits(P2,csx);}   #define  mcp_clCS()    {P2=clrBits(P2,csx);}   //cmd=0x11 Potentiometer 0 w
[Microcontroller]
C8051F MCU usage precautions
Each I/O pulls 50mA current, sinks 100mA current, and has a total current of 800mA. 1. Power and ground processing 1. The analog power supply and digital power supply should be powered separately. Two voltage regulators can be used to supply power separately, but the voltage difference between the two power supplie
[Microcontroller]
Design of intelligent node of vehicle CAN bus based on C8051F040
The electrical and electronic system is an important part of the vehicle, and its working state directly affects the performance of the vehicle. When designing the vehicle electrical system according to the traditional design concept, various subsystems are often piled up to improve the performance of the system. Th
[Microcontroller]
Design of intelligent node of vehicle CAN bus based on C8051F040
Multi-channel data acquisition range control system based on C8051F000
1 Introduction   In practical applications, controlling the physical parameters of the controlled object (temperature, humidity, displacement, current, voltage, etc.) within a certain range is one of the typical applications of microcontrollers. In many situations where precise control is required at the macro level,
[Microcontroller]
How to control LED lights using touch sensor and 8051 microcontroller
In this project we are interfacing touch sensor with 8051 microcontroller AT89S52. If you are new to 8051 microcontrollers then you can start the 8051 by blinking an LED. What is a capacitive touch sensor? Capacitive touch works on the electrostatic charges available on our bodies. The screen is already filled with
[Microcontroller]
How to control LED lights using touch sensor and 8051 microcontroller
Design of portable physiological parameter monitor based on C8051F330
    As people's living standards improve, more and more people want to understand their basic physical conditions in a simple way. Therefore, human physiological monitors have begun to appear and are increasing in number, and have developed from single testers in the past to multi-parameter monitors today.     In re
[Medical Electronics]
Design of portable physiological parameter monitor based on C8051F330
Clock synchronization technology between C8051F120 and RS422 information line
Introduction As the speed of instructions continues to increase, the performance of microcontrollers has been greatly improved in various aspects, such as clock synchronization between multiple microcontrollers. The execution speed of Silicon Labs' C8051F series microcontrollers can reach up to 100MIPS, which ma
[Microcontroller]
Clock synchronization technology between C8051F120 and RS422 information line
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号