Usually the test development board provided by our website is a finished board that has been welded and tested. If you are a netizen who purchases a kit, you can start a series of installation and experiments on the 51 single-chip microcomputer experimental board. The experimental board kit ordered by netizens contains the following component list. Please check the component list carefully after receiving the goods:
AT89C51 MCU Experiment Development Board Kit Component List:
A specially designed full-process circuit board
Power supply components:
1. A 9V DC plug-in small power supply with a plug (12V when no load)
2. One power socket
3. One 7805 voltage regulator chip
4. Two 470UF/16V power filter capacitors
5. Two 0.1UF monolithic capacitors
6. One green LED for power indication
7. LED current limiting resistor 560 ohm resistor
Components that are necessary for a microcontroller:
1. One AT89C51 microcontroller chip
2. One 40-pin zero-force ZIF socket
3. One 22UF/16V capacitor for reset
4. Reset resistor 1K
5. 2 30P small capacitors
6. One 12M crystal oscillator
Experimental components:
1. 8 small red rectangular LEDs
2. 8-bit 1K digital tube current limiting resistor
3. One common cathode two-digit integrated digital tube
4. A 5V electromagnetic buzzer
5. 1 8550 driver transistor (e/b/c)
6. Three 1K transistor base drive resistors
7. 4 micro touch switches
8. One 4-digit red dip switch
9. 2 12V JQC-3F relays (one set of normally open to normally closed)
10. 2 IN4148 anti-reverse peak diodes
11. 2 8050 driver transistors (e/b/c)
12. 2 relay status indication red LEDs
1. One piece of original imported MAX232 chip
2. Two 5.1K pull-up resistors
3. 4 10UF capacitors
4. One plastic-sealed integrated infrared receiver
5. One AT24C02 memory chip
6. One 220UF filter capacitor
7. One 0.1UF capacitor
8. One infrared remote control handle with 32 buttons
9. One serial communication cable
10. One 4.7K pull-up resistor for DS18B20
For those who buy finished boards, they get products that have been soldered and tested. Whether they buy kits or finished MCU experimental development boards, the MCU they get has a test program burned into it. The test program is mainly used to test the MCU and related peripheral components of the 51 test board. If this program can run smoothly, it means that all aspects of the experimental board are normal.
The test program may be complicated for beginners, but it is also composed of several small programs on the website. Beginners can master this program by studying the following tutorials.
[page]
The function of this test program is: after the power is turned on, the eight light-emitting diodes of the P0 port light up from bottom to top in turn, then the buzzer beeps, the two relays act in turn, the ones digit of the digital tube displays 8, then changes to the tens digit to display 8, and then continues to cycle. If the button of the infrared remote control is pressed at this time, the buzzer immediately emits a "beep beep" prompt sound, and the key value of this button is displayed on the computer screen through the serial port (serial port debugging software needs to be run). Through this program, it can be judged that the hardware and software of each part of the single-chip microcomputer experimental development board are intact. The specific source program is as follows:
ORG 0000H
AJMP MAIN; enter the main program
ORG 0003H; external interrupt P3.2 pin INT0 entry address
AJMP INT; transfer to external interrupt service subroutine (infrared remote control decoding program)
; The following is the CPU interrupt mode setting for the main program
MAIN:LCALL YS3; Wait for the hardware to be powered on and stable
SETB EA; Open the CPU general interrupt request
SETB IT0; Set the trigger mode of INT0 to pulse negative edge trigger
SETB EX0; Open INT0 interrupt request
MOV SCON, #50H; set to serial port 1 mode
MOV TMOD, #20H; Baud rate generator T1 works in mode 2
MOV PCON, #80H; baud rate doubled to 2400x2=4800BPS
MOV TH1, #0F3H; preset initial value (preset initial value according to baud rate 2400BPS)
MOV TL1, #0F3H; preset initial value (preset initial value according to baud rate 2400BPS)
SETB TR1; Start timer T1
;The above completes the initialization setting of serial communication
START:MOV P1, #01111111B
LCALL DELAY
MOV P1, #10111111B
LCALL DELAY
MOV P1, #11011111B
LCALL DELAY
MOV P1, #11101111B
LCALL DELAY
MOV P1, #11110111B
LCALL DELAY
MOV P1, #11111011B
LCALL DELAY
MOV P1, #11111101B
LCALL DELAY
MOV P1, #11111110B; The LED of P1 port lights up from bottom to top once in a cycle, with a delay of about 250 milliseconds
LCALL DELAY
MOV P2, #11011111B; the buzzer sounds once
LCALL DELAY
MOV P2, #11101111B; relay J1 is energized once
LCALL DELAY
MOV P2, #11110111B; relay J2 is energized once
LCALL DELAY
MOV P0, #0FFH
MOV P2, #01111111B; the digital tube displays 8
LCALL DELAY
MOV P0, #0FFH
MOV P2, #10111111B; Digital tube shows 8 in ten digits
LCALL DELAY
AJMP START; Repeated loop
; The following is the subroutine to enter the P3.2 pin external interrupt, which is the decoding program
INT: CLR EA; Temporarily disable all CPU interrupt requests
MOV R6, #10
SB: ACALL YS1; call 882 microsecond delay subroutine
JB P3.2, EXIT; after a delay of 882 microseconds, determine whether the P3.2 pin has a high level. If so, exit the decoding program.
DJNZ R6, SB; repeat 10 times, the purpose is to detect if a high level appears within 8820 microseconds and exit the decoding program
;The above completes the recognition of the 9000 microsecond initial low-level signal of the remote control signal.
JNB P3.2, $; Wait for high level to avoid 9ms low level boot pulse
ACALL YS2; delay 4.74 milliseconds to avoid the 4.5 millisecond result code
MOV R7, #26; Ignore the first 26 bits of the system identification code
JJJJA: JNB P3.2, $; Waiting for the high level signal of the first bit of the address code
LCALL YS1; After the high level starts, use the 882 microsecond time ruler to determine the high and low level status of the signal at this time
MOV C, P3.2; store the current level of P3.2 pin 0 or 1 into C
JNC UUUA; if it is 0, jump to UUUA
LCALL YS3; if high level 1 is detected, delay 1 millisecond to wait for the pulse high level to end
UUUA: DJNZ R7, JJJJA
MOV R1, #1AH; Set 1AH as the starting RAM area
MOV R2, #2; Receive 2 memories from 1AH to 1BH, used to store the operation code and the inverse operation code
PP: MOV R3, #8; each group of data is 8 bits
JJJJ: JNB P3.2, $; wait for the high level signal of the first bit of the address code
LCALL YS1; After the high level starts, use the 882 microsecond time ruler to determine the high and low level status of the signal at this time
MOV C, P3.2; store the current level of P3.2 pin 0 or 1 into C
JNC UUU; if it is 0, jump to UUU
LCALL YS3; if high level 1 is detected, delay 1 millisecond to wait for the pulse high level to end
UUU: MOV A, @R1; move the address in R1 to A
RRC A; shift the value 0 or 1 in C into the lowest bit in A
MOV @R1, A; temporarily store the number in A in the memory of R1 value
DJNZ R3, JJJJ; receive full 8 bits and change a memory
INC R1; add 1 to the value in R1 and replace the next RAM
DJNZ R2, PP; After receiving the 8-bit data code and the 8-bit data inverse code, store them in 1AH/1BH
MOV A, 1AH
CPL A; invert 1AH and compare it with 1BH
CJNE A, 1BH, EXIT; if not equal, it means an error occurred in receiving data, and give up
MOV P1, 1AH; display the key value through the 8 LEDs of P1 port!
MOV A, 1AH; send the key value of the specific button of the infrared remote control to the serial port
MOV SBUF, A; displayed on the computer screen through the serial port
CLR P2.5; The buzzer beeps, indicating that the decoding is successful
LCALL YS2
LCALL YS2
LCALL YS2
SETB P2.5;Buzzer stop
EXIT: SETB EA; Enable interrupt
RETI ; Exit the decoding subroutine
YS1: MOV R4, #20; (occupying R4/R5) Delay subroutine 1, accurate delay 882 microseconds
D1: MOV R5, #20
DJNZ R5, $
DJNZ R4, D1
RET
YS2: MOV R4, #10; (occupying R4/R5) Delay subroutine 2, accurate delay of 4740 microseconds
D2: MOV R5, #235
DJNZ R5, $
DJNZ R4, D2
RET
YS3: MOV R4, #2; (occupying R4/R5) delay program 3, accurate delay 1000 microseconds
D3:MOV R5, #248
DJNZ R5, $
DJNZ R4, D3
RET
DELAY:MOV R1, #08H; (occupying R1/R2/R3) delay subroutine, 12M crystal oscillator delay is about 250 milliseconds
L3: MOV R2, #0FAH
L1: MOV R3, #0FAH
L2: DJNZ R3, L2
DJNZ R2, L1
DJNZ R1, L3
RET
END
[page]
Installation and debugging of microcontroller power supply and basic parts
1.5V power supply installation and debugging
First of all, we will complete the most basic and necessary installation and debugging of the power supply part. Any circuit cannot be separated from the power supply part, and the single-chip microcomputer system is no exception. Moreover, we should attach great importance to the power supply part. We should not ignore it because the power supply circuit is relatively simple. In fact, nearly half of the faults or production failures are related to the power supply. Only when the power supply part is done well can the normal operation of the circuit be guaranteed.
The AT89C51 experimental development board provides a 9V 400mA external AC power supply, which can output a 12V DC voltage at no load. If some netizens do not need the voltage-stabilized power supply we provide and need to equip themselves, they can choose a power supply with an output DC voltage between 10 and 15V, and the plug polarity is positive inside and negative outside. Remember! The DC voltage output by the voltage-stabilized power supply is introduced into the experimental development board through a special power socket. The two on the left are 12V power filter capacitors. Generally, a small capacitor is connected in parallel next to a large capacitor to reduce the high-frequency internal resistance. Because large electrolytic capacitors are generally manufactured using a winding process, the equivalent inductance is relatively large. Small capacitors can provide a high-frequency channel with a small internal resistance, reducing the full-band internal resistance of the power supply. This is very common in actual circuits~
First, we find the components to be used from the kit, as shown below:
The power supply part is divided into two parts. One part directly provides 12V DC power supply, which is mainly used for relays. The other part is stabilized into 5V DC power supply by three-terminal voltage regulator chip 7805 and provided to the microcontroller system. The two capacitors on the right are filter capacitors of 5V power supply. The resistor and green LED form the working indication circuit of 5V power supply. As long as the power supply part is normal, the green LED1 will light up. We can judge whether the whole power supply part is working properly based on this LED. The power supply part is the component that needs to be installed in the image below.
Note:
1. Do not reverse the positive and negative poles of polarized electrolytic capacitors. The one with the longer pin is the positive pole.
2. Do not install the three-terminal voltage regulator 7805 upside down. You can refer to the position in the picture and follow the instructions.
3. Do not reverse the polarity of the LED, the one with the longer pin is the positive pole
Finally, please use a multimeter to measure whether the +12V and +5V outputs are normal.
2. AT89C51 MCU Minimized System Installation Test
We find the components we need from the kit, as shown below:
The minimized system of the microcontroller refers to the peripheral components necessary for the microcontroller to work properly. It can be mainly divided into the clock circuit and the reset circuit. We use the AT89C51 chip, which has a 4K FLASH program memory inside. Generally, this 4K storage space is enough for us to use, so we fix the 31st pin of the AT89C51 chip to a high level (it has been connected when the PCB is drawn), so we only use the 4K program memory inside the chip. The clock circuit of the microcontroller consists of a 12M crystal oscillator and two 30P small capacitors, which determine the working time accuracy of the microcontroller to 1 microsecond. The reset circuit consists of a 22UF capacitor, a 1K resistor and an IN4148 diode. In the past, textbooks often recommended using a 10UF capacitor and a 10K resistor to form a reset circuit. Here we choose a 22UF capacitor and a 1K resistor based on actual experience. The advantage is that the reset pin's impedance to ground is reduced under the premise of meeting the reliable reset of the microcontroller, which can significantly enhance the anti-interference ability of the microcontroller reset circuit. The function of the diode is to quickly discharge the charge of the capacitor, so that multiple resets can be successful in a short period of time.
There is a simple way to judge whether the microcontroller chip and clock system are working properly, that is, to use a multimeter to measure the voltage of the microcontroller crystal oscillator pins (pins 18 and 19) to ground. Take the measurement of a normally working microcontroller with a digital multimeter as an example: pin 18 is about 2.24V to ground, and pin 19 is about 2.09V to ground. For microcontrollers that are suspected to be unable to work properly due to a reset circuit failure, the analog reset method can also be used to judge. When the microcontroller is working normally, the voltage of pin 9 to ground is zero. You can use a wire to connect it to +5V for a short time to simulate a power-on reset. If the microcontroller can work normally, it means that there is a problem with the reset circuit.
Previous article:Design of water level control system based on single chip microcomputer
Next article:GPS/electronic compass attitude measurement and positioning system based on single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 21:51
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- This is an equalizer. I bought it but never used it. I want to share it with you.
- Join the thread and have a chat: If I give you a motor board, what would you want to do?
- 【China Academy of Electronics Science】Recruitment of embedded/algorithm engineers
- Create a healthy life and achieve powerful tools
- How to distinguish diode overcurrent failure and overvoltage failure?
- Protection methods for low-speed interfaces and power circuits (digital audio, analog video, keyboard, etc.)
- Infineon XMC4800 Relax EtherCAT Kit Review Summary
- Analog Discovery 2 Review (5) Acquisition System Hardware Analysis
- Embedded USB driver-free device communication method based on WinUSB
- Which hero can give me a programming manual for STM32F030XX