The minimum system of a single-chip microcomputer, or the minimum application system of a single-chip microcomputer, refers to a system that can work with a single-chip microcomputer composed of the least components. For the 51 series single-chip microcomputer, the minimum system should generally include: single-chip microcomputer, crystal oscillator circuit, reset circuit.
1. Let's talk about the pins of 51 single chip microcomputer:
Bus type DIP40 pin package
Power and clock pins, 4
VCC: power supply pin
VSS: Ground pin
XTAL1: A pin to which the crystal oscillator is connected
XTAL2: Another pin to which the crystal oscillator is connected
Control line pins, 4
RST/VPD: reset signal input pin/backup power input pin; ALE/PROG: address latch enable signal output pin/programming pulse input pin
EA/VPP: Internal and external memory selection pin. When connected to a high level, the microcontroller starts executing from 0000H of the internal ROM after reset; when connected to a low level, it starts executing directly from 0000H of the external ROM after reset.
PSEN: External program memory select signal output pin
Parallel I/O pins, 32, divided into 4 8-bit ports
P0.0 ~ P0.7: General I/O port pins or data/low address bus multiplexing pins
P1.0 ~ P1.7: General I/O port pins
P2.0 ~ P2.7: General I/O port pins or high address bus pins
P3.0 ~ P3.7: General I/O port pins or second function pins
2. The following is a minimum system circuit diagram of a 51 single-chip microcomputer built in the proteus environment. Proteus software is an EDA tool software published by Labcenter electronics in the UK. It can mainly simulate single-chip microcomputers and peripheral devices. In terms of compilation, it also supports multiple compilations such as IAR, Keil and MATLAB.
Crystal oscillator circuit:
There are crystal oscillators in the microcontroller system. The crystal oscillator plays a very important role in the microcontroller system. The full process is called a crystal oscillator. It combines with the internal circuit of the microcontroller to generate the clock frequency required by the microcontroller. The higher the clock frequency provided by the microcontroller crystal oscillator, the faster the microcontroller runs. The typical crystal oscillator takes 11.0592MHz (convenient for serial port baud rate setting) or 12MHz (produces accurate uS-level pauses, convenient for timing operations). The capacitor here is 22pf (15~33pF is fine, empirical value), and the closer the capacitor is to the crystal oscillator, the better. The closer the crystal oscillator is to the microcontroller, the better. Ceramic chip capacitors or non-polar chip capacitors are selected according to the type of circuit board being manufactured.
Reset circuit:
When the microcontroller system is running and the program runs away due to environmental interference, press the reset button and the internal program will automatically start from the beginning. To reset the 51 microcontroller, just connect a high level to the RST pin for 2 US.
The working principle of the reset circuit is as follows:
In the circuit diagram, the size of the capacitor is 10uF and the size of the resistor is 10k. According to the formula, it can be calculated that the time required for the capacitor to charge to 0.7 times the power supply voltage (the power supply of the microcontroller is 5V, so charging to 0.7 times is 3.5V) is 10K*10UF=0.1S. That is to say, within 0.1S of the computer startup, the voltage across the capacitor increases from 0~3.5V. At this time, the voltage across the 10K resistor decreases from 5~1.5V (the sum of the voltages at each point in the series circuit is the total voltage). Therefore, within 0.1S, the voltage received by the RST pin is 5V~1.5V. In the 51 microcontroller that works normally at 5V, a voltage signal less than 1.5V is a low-level signal, and a voltage signal greater than 1.5V is a high-level signal. Therefore, within 0.1S of startup, the microcontroller system automatically resets (the high-level signal time received by the RST pin is about 0.1S). It will also reset when the button is pressed. After the microcontroller starts for 0.1S, the voltage across the capacitor C is continuously charged to 5V. At this time, the voltage across the 10K resistor is close to 0V, and RST is at a low level, so the system works normally. When the button is pressed, the switch is turned on. At this time, a loop is formed across the capacitor, and the capacitor is short-circuited. Therefore, during the process of pressing the button, the capacitor begins to release the previously charged electricity. As time goes by, the voltage of the capacitor is released from 5V to 1.5V or even smaller within 0.1S. According to the series circuit voltage being the sum of all points, the voltage across the 10K resistor is 3.5V or even larger at this time, so the RST pin receives a high level again. The microcontroller system automatically resets.
Download Circuit:
We can connect P3.0 (RXD), P3.1 (TXD) and the power ground to a 3p header to facilitate program downloading and serial port communication.
3. Finally, let's briefly talk about the output drive capability of the microcontroller:
The pins of the microcontroller can be controlled by the program to output high and low levels. When the microcontroller outputs a low level, it will allow external devices to inject current into the microcontroller pins. This current is called "sinking current" and the external circuit is called "sinking current load". When the microcontroller outputs a high level, it allows external devices to pull current from the microcontroller pins. This current is called "pulling current" and the external circuit is called "pulling current load". When each single pin outputs a low level, the maximum current allowed to be injected into the pin by the external circuit is 10 mA; each 8-bit interface (P1, P2 and P3) allows a maximum total current of 15 mA to be injected into the pin, while P0 has a stronger ability and allows a maximum total current of 26 mA to be injected into the pin; the sum of the maximum current allowed by all four interfaces is 71 mA. When these pins "output a high level", the "pulling current" capability of the microcontroller can be said to be too poor, less than 1 mA. The conclusion is: when the microcontroller outputs a low level, the driving capability is acceptable, but when it outputs a high level, it has no ability to output current. When designing the load circuit of the microcontroller, the circuit form of "current sinking load" should be used to avoid unnecessary current consumption. So here we use the "current sinking" method to connect an LED lamp. At this point, a minimum system of a 51 microcontroller is built, and the journey of learning microcontrollers begins~~~
Attached is a small program to control the flashing of an LED through P1.0
#include sbit led=P1^0; void delay(unsigned int i) { unsigned int j; unsigned char k; for(j=i;j>0;j--) for(k=125;k>0;k--); } void main(void) { while(1) { led=~led; delay(2000); } }
Previous article:Study Notes - 51 MCU Serial Communication
Next article:Study Notes - 51 MCU Special Function Registers
- Popular Resources
- Popular amplifiers
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
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- [TI recommended course] #Zero-based entry: Hand-in-hand teaching you how to quickly develop MSP430? Project#
- [Free Trial] Submit your application here and have a chance to win an Infineon drone~~
- About TL431: Questions about TL431 and TL432
- Texas Instruments uses 20 million hours to make the case for using gallium nitride (GaN)
- Who knows this digital tube?
- Comparison of UWB and its related technologies
- MSP430 upgrade boot program writing and upgrade firmware production
- Using FPGA to scan LED large screen.pdf
- I would like to ask about the random way, that is, writing the last 64 bytes of 24C256 by byte and writing its last 64 bytes by page.
- Leading with technology, sensing a new future. Download ams Semiconductor's "High-precision Short-distance Measurement Solution" and answer the questions to win prizes!