The common MSC-51 microcontroller generally uses a dual in-line (DIP) package with a total of 40 pins. The picture shows the pinout diagram. The 40 pins can be roughly divided into four categories: power, clock, control and I/O pins.
1. Power supply
Vcc: chip power supply, generally +5V;
Vss: ground terminal.
2. Clock
XTAL1 and XTAL2: the inverting input and output terminals of the crystal oscillator circuit. When using the internal oscillator circuit, an external crystal oscillator is required, such as 4M, 6M, 11.0592M, 12M, etc. When using external oscillation input, XTAL1 is connected to ground, and XTAL2 is connected to external oscillation pulse input.
3. Control line
The MCS-51 microcontroller has a total of 4 control lines, 3 of which are multiplexed lines with two functions.
(1) ALE/PROG: Address latch enable/programming pulse.
ALE: ALE function during normal use, mainly used to latch the 8-bit address sent from the P0 port. Port P0 generally transmits the lower 8-bit address and data signals in a time-sharing manner, and they are all binary numbers. To distinguish whether it is the lower 8-bit data signal or the address signal, look at the ALE pin. When the ALE signal is valid, the P0 port transmits the lower 8-bit address signal; when the ALE signal is invalid, the P0 port transmits the 8-bit data signal. Generally, the content transmitted by the P0 port is locked on the falling edge of the ALE pin, that is, the low 8-bit address signal.
When the CPU is not executing instructions to access external RAM (MOVX), ALE is output at a fixed frequency of 1/6 of the clock oscillation frequency, so the ALE signal can also be used as the clock signal of the external chip. But when the CPU performs access to external RAM (MOVX), ALE will skip an ALE pulse.
PROG: When the microcontroller is programming, this pin inputs programming pulses (provided by the programmer).
(2) PSEN: External ROM read strobe signal.
When the microcontroller reads the external ROM, PSEN is effectively output twice in each machine cycle. PSEN is equivalent to the allowed strobe signal output by the external ROM chip. But it is invalid when reading on-chip ROM and reading off-chip RAM.
(3) RST: reset pin.
RST is the power-on reset input terminal of the microcontroller. As long as this pin is kept at a high level for more than two machine cycles, the microcontroller can achieve a reset operation. After reset, the program starts executing from 0000H. In general applications, RC circuits can be used to implement power-on reset of microcontrollers. In some industrial control and other demanding situations, special watchdog chips are generally used for reset and power supply monitoring. A typical RC power-on reset circuit is shown in the figure. Show:
(4) EA/VPP: Internal and external ROM selection/EPROM programming power supply.
EA: During normal operation, EA is the internal and external ROM selection terminal. The addressing range of the MCS-51 microcontroller is 64KB, of which 4K is on-chip and 60K is off-chip. When EA is high, the on-chip ROM is accessed first. When the program length exceeds 4K, it will automatically transfer to the external ROM for execution. program. When EA is low, the microcontroller only accesses the external ROM. For the old 8031 microcontroller (because there is no ROM on the chip), EA must be connected to ground. Most of the current microcontrollers come with their own ROM, so EA is also connected to high level in general applications.
VPP: For microcontrollers with internal EPROM, this pin is used to apply programming power during on-chip EPROM programming.
4. I/O pins
The MCS-51 microcontroller has four 8-bit parallel I/O ports and a total of 32 programmable I/O pins. Each of the four I/O ports has its own function. Under normal circumstances, P0 is dedicated to transmitting the lower 8-bit address signal and 8-bit data signal in a time-sharing manner, the P2 port is dedicated to transmitting the upper 8-bit address signal, and the P3 port most of the time Used for secondary functions. Of course, all I/O ports can be used as ordinary input/output ports.
Previous article:51 Single-chip automobile window defrosting system design case
Next article:Summary of 5 common problems in 51 microcontroller applications
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- [Elective course to get a gift] Keysight's new "Test and Measurement" series of courses, reservations open in the hot summer! Master-level lecturers live online~
- AD chip output digital signal problem
- AVR assembler, paid help
- What is a smart WiFi module? What are the types and functions of wireless router gateway control modules?
- Comparison of several MicroPython IDEs
- [RVB2601 Creative Application Development] @fxyc87 RVB2601-Snake Game
- Qinheng USB PD and other fast charging protocol power receiving chip CH224 evaluation - the first data study and unboxing
- Analysis of the working principles of seven triode collector DC circuits 4
- Based on IPM05F 3Sh board: FOC motor control 400V non-sensing sensory encoder all design data summary (schematic diagram/BOM table...
- AD7190 Issues