This is an experiment that everyone who learns 51 single-chip microcomputers will do, and it should be the first experiment. It is so simple and popular that there is nothing much to say, but I thought of some things that can be put together and talked about. First, here are the pictures:
This is the schematic diagram of the LED part on a certain experimental board. When conducting LED experiments, J1 must be connected, otherwise VCC cannot power the LED. RP1 is a resistor array. Our common resistors are all separate, while a resistor array is 8 resistors connected together, and these 8 resistors have a common section. In this figure, the common end is connected to VCC.
Then there is the resistance value of 102. Here it does not mean that the resistance value is only 102 ohms, but 10*102, which is 1000 ohms. The main function of this resistor is to limit the current, so how much current flows through the resistor? Assuming VCC is 5V and the voltage drop of the light-emitting diode is 1.7V, there is a voltage of 3.3V on the resistor. According to Ohm's law, voltage/resistance=current, we get 3.3ma. This is the current flowing through the LED. Don't think that the power consumption is small. Among the commonly used handheld instruments, they are generally powered by four Nanfu batteries. The power consumption of this instrument is required not to exceed 50ma.
Imagine that the CPU + peripheral circuits + several LEDs must be controlled within 50ma.
I have another question. Has anyone noticed that we need an external power supply to light up the LED instead of using the internal power supply of the microcontroller?
There are two reasons: 1. If the microcontroller is used for power supply, the load on the microcontroller is relatively large; 2. After the microcontroller is powered on and reset, the initial level of the pin is high. The above circuit just ensures that the LED is dark. Otherwise, there will be a process of pulling the level down. For patients with obsessive-compulsive disorder, this process is very disgusting. Here is a piece of code:
#include
//#include "stc.h"
void main() //void
{
P1=0xfe; //1111 1110B
while(1)
{
}
}
Previous article:Wireless Bluetooth car based on 51-gesture remote control is awesome
Next article:Radio based on STC89C52RC+TEA5767
- 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
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- Hard disk control and encryption based on FPGA
- Causes of color difference between different batches of LCDs
- Is there no one in the forum?
- What exactly are S parameters?
- Can the current direction of a MOS tube be reversed? How much current can a body diode carry?
- EEWORLD University ---- TI Battery Management In-depth Analysis Series
- Introduction to FPGA CLB LUT to implement logic functions
- Is the IoT card a data card? What is the difference between it and a mobile phone data card?
- Introduction to 10G Ethernet Test Solution
- Raspberry Pi Pico Tutorial