Some differences between 51 MCU and AVR MCU

Publisher:浊酒Latest update time:2012-12-18 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Most of the I/O ports of 51 MCU are quasi-bidirectional ports. During reset, all ports output high level. The input and output operations of the ports are also directly performed through the address of the I/O port. The I/O ports of AVR are standard bidirectional ports. During reset, all ports are in the input state without pull-up resistors (high impedance state, the pin level is completely determined by the external circuit), which is very useful in situations where the reset state is emphasized. Each port of AVR corresponds to three addresses, namely DDRX, PORTX and PINX.

DDRX is the port direction register. When a certain position of DDRX is set to 1, the pin of the corresponding port is used as an output; when a certain position of DDRX is cleared to 0, the pin of the corresponding port is used as an input. PORTX is the port data register. When the pin is used as an output, the data of PORTX is output by the corresponding pin; when the pin is used as an input, the data of PORTX determines whether the pull-up function of the pin of the corresponding port is turned on. PINX is the input pin address of the corresponding port. If you want to read the logic level value of the corresponding pin, you must read PINX instead of PORTX.

2. There are two basic usages of the timer/counter of the 51 single-chip microcomputer, namely, the timer working mode with the 12-frequency signal of the crystal frequency as the input, or the counter working mode with the input signal on the external pins INT0 and INT1. When the AVR timer/counter is used as a timer, its input signal can be selected as a frequency-divided signal of the crystal frequency, and the frequency-dividing ratio is 1, 8, 64, 256, and 1024. When used as a counter, it can be triggered by either the rising edge or the falling edge.

3. The 51 MCU has 6 interrupt sources (5 interrupt entry addresses), which are divided into two priorities. The IE register controls the interrupt enable and the IP controls the interrupt priority. The AVR has different numbers of interrupt sources according to different MCUs.

4. The baud rate generation of the 51 single-chip microcomputer Kawaguchi communication requires the use of a timer, and the supported baud rate is relatively low. The AVR single-chip microcomputer can have a higher baud rate, up to 115200bps. And it has a dedicated baud rate generator.

Reference address:Some differences between 51 MCU and AVR MCU

Previous article:Hardware Design of Digital Sensor System Based on C8051F060 MCU
Next article:What is 51 single chip microcomputer?

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

At89c51 MCU keyboard scanning and display program
;****************************************************** ;* Name: kbd ;* Function: Read key value from keyboard and store it in register A: r*4+c ;* Input: ;* Output: A=key value ;**********************************************************   org 0000h   ljmp main   org 0200h main: init:   MOV 60H,#10h   MO
[Microcontroller]
Pushing floating point numbers onto the stack -- Practical subroutines for MCS-51 microcontrollers
Label: FPUS Function: Push floating point numbers onto the stack Entry condition: Operand is in . Exit information: Operand is pushed to the top of the stack. Affected resources: A, R2, R3 Stack requirement: 5 bytes FPUS: POP ACC ; Save the return address in R2R3 MOV R2,A POP ACC MOV R3,A MOV A,@R0 ; Push the o
[Microcontroller]
AVR single chip microcomputer and LCD liquid crystal module to control the information monitoring terminal design
At present, with the rapid development of the information industry, all kinds of ships are in urgent need of being equipped with more high-quality and low-cost small and medium-sized information monitoring terminals to monitor weather conditions and obtain navigation information to ensure navigation safety. 32-bit pro
[Microcontroller]
AVR single chip microcomputer and LCD liquid crystal module to control the information monitoring terminal design
51 MCU internal EEPROM read and write
#include reg52.h #include intrins.h //Define the type to facilitate code transplantation typedef unsigned char UINT8; typedef unsigned int  UINT16; typedef unsigned long UINT32; typedef char INT8; typedef int  INT16; typedef long INT32; static     UINT
[Microcontroller]
51 MCU internal EEPROM read and write
Design of Laser Code Controller Based on AT89C51 Single Chip Microcomputer
This password controller is a photoelectric remote control type, which combines the above two advanced technologies. A specific password is arranged with illumination or no illumination as the basic code, and laser is used as the carrier, and then it is recognized by the receiver, analyzed and judged by the single-chip
[Microcontroller]
Design of Laser Code Controller Based on AT89C51 Single Chip Microcomputer
51 MCU ~ Timer and external interrupt (detailed explanation of each bit control function)
1. Interruption (ii) Timer and counter interrupts The lower eight bits of TL0 are stored first, and when they reach 0XF, they are incremented until the upper and lower eight bits are full, an interrupt can be generated or the TF0 port can be controlled. (1). The lower four bits of TMOD control T0, and the
[Microcontroller]
51 MCU ~ Timer and external interrupt (detailed explanation of each bit control function)
Is the 51 microcontroller easy to learn? What will you learn after learning the 51 microcontroller?
As a senior engineer, I still have to answer this question objectively. I still disagree with some related topics such as "Learning a Microcontroller in 15 Days from Zero Basics". If you have zero foundation and don't have 1-2 months, it is impossible to master the development of microcontroller, and it will even take
[Microcontroller]
Design of measuring light curtain for object classification equipment using C51 single chip microcomputer
1. Introduction Light curtain is a kind of equipment that is widely used in electronic measurement systems. It can be used to measure a series of data such as the height, length or width of objects on a constant speed conveyor belt, so as to provide corresponding parameters for the subsequent electronic sys
[Microcontroller]
Design of measuring light curtain for object classification equipment using C51 single chip microcomputer
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号