51 MCU Introduction - Basic Knowledge Summary

Publisher:rockstar6Latest update time:2022-11-10 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Part 1 Introduction to MCU

MSC-51 microcontroller refers to a microcontroller with 8051 as the core, which was launched by Intel Corporation of the United States in 1980. 80C51 is a typical variety in the MCS-51 series; CMOS process microcontroller products developed by other manufacturers with 8051 as the base core are collectively referred to as the 80C51 series.


Single chip microcomputer: A microprocessor (CPU), memory (ROM and RAM), and I/O interface circuits are integrated on an integrated circuit chip, thus forming a single-chip microcomputer, also called a microcontroller (MCU).


CPU (Central Processing Unit): It consists of operation and control logic, as well as an interrupt system and some external special function registers;

RAM (Random-Access Memory): used to store data that can be read and written, such as intermediate results of calculations, final results, and data to be displayed;

ROM (Read-Only Memory): used to store programs, some raw data and tables;

I/O (input/output) port: Four 8-bit parallel I/O ports, which can be used for both input and output;

T/C (timer/counter): two timers/counters, which can work in both timing mode and counting mode;

 There are only two levels in digital circuits: high and low

The microcontroller is TTL level: high +5V low 0V

RS232 level: Computer serial port high -12V low +12V

Therefore, when the computer communicates with the microcontroller, other chips such as max232 and other level conversion chips are needed.

The evaluation characteristics of digital circuits are determined by the two-level system:

Binary logic operations, AND, NOT, and XOR

type of data:

Because the 51 microcontroller is 8-bit, its data type is generally unsigned char. 

 

Part 2 Pin Introduction

1. Power pin: Vcc (pin 40): power supply terminal, connected to +5V power supply.

Vss(Gnd) (pin 20): ground terminal, connected to +5V power supply ground terminal

2. External crystal pins: XTAL1 and XTAL2

The 89C51 has an oscillator and clock generation circuit inside.

XTAL1 (pin 19): On-chip oscillator circuit inverting amplifier input

XTAL2 (pin 18): Output of the inverting amplifier of the on-chip oscillation circuit. When the internal clock is used, a quartz crystal and a fine-tuning capacitor are connected outside the chip to generate the original oscillation pulse signal.


When using an external clock, XTAL1 inputs the external clock pulse signal and XTAL2 is left floating.

3. Control signal pins: RST, ALE, PSEN, EA

RST (pin 9): Reset signal input terminal, high level is valid.

When the high level is maintained for two machine cycles, the reset operation is completed.

ALE/PROG (30 legs) :

Address latch enable output terminal/programming pulse input terminal

Under normal circumstances, it continuously outputs a positive pulse signal of 1/6 of the oscillator frequency.

When accessing off-chip memory:

As the control signal for latching the low 8 bits of the address of port P0.

When programming the ROM on the 8751 chip: it serves as the programming pulse input terminal.

PSEN (pin 29): External program memory read select output signal

When accessing the off-chip ROM, a negative pulse is output as a read ROM strobe.

It is often connected to the output enable terminal (OE) of an off-chip ROM chip as the read select signal of the external ROM.

EA/Vpp (pin 31):

External program memory address enable input/programming voltage input. Normally, when connected to "1", the CPU accesses the 4KB ROM on the chip. When the address exceeds 4KB, it automatically switches to the program in the external ROM. When connected to "0", the CPU only accesses the external ROM. The second function Vpp is the programming voltage input when programming 8051.

4. Input/output port pins P0, P1, P2, P3

Four 8-bit parallel input/output ports, a total of 32 pins. As a general-purpose input/output port

General purpose input/output ports

     Quasi-bidirectional port: When inputting, you must first write "1" to the latch. The default startup is initialized to a high level

P0 port (P0.0-P0.7, pins 39-32):

      Quasi-bidirectional port with open drain, no internal pull-up resistor, in the resistance state, can not output high and low levels normally, need to connect pull-up resistor (10K) when used as I/O

P1 port (P1.0-P1.7, pins 1-8):

      Quasi-bidirectional port with internal pull-up resistor.

P2 port (P2.0-P2.7, pins 21-28):

      Quasi-bidirectional port with internal pull-up resistor, similar to P1

P3 port (P3.0-P3.7, pins 10-17):

      Quasi-bidirectional port with internal pull-up resistor, similar to P1 when used as I/O, with a second function

The second function of P3 port


Reference address:51 MCU Introduction - Basic Knowledge Summary

Previous article:51 MCU Introduction - Register Function List
Next article:The production process of the minimum system board of 51 single-chip microcomputer

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号