-
Not at all contradictory. The purpose of each port of the single-chip microcomputer is different, the structure is also different, you say that the current of the LED MA level can make it brighter, which refers to the rated brightness, different power has different brightness, you can't compare the 1 mm patch with the 10 mm one, can you understand? If you want to use LEDs at the P2 port, there are two ways.
1.It is to connect a current-limiting resistor of the LED string to the P2 port, and the resistor is terminated to the power supply. Connect a pull-up resistor to the LED, and connect the LED between the P2 port and the ground.
-
No,51The leakage current of the IO port of the single-chip microcomputer can light up the diode,I tried,Although it is not very bright,But the current is also UA level。 This is normal, it can only be avoided by isolation design, and the leakage current must be avoided by mistake when it is properly designed, such as field tube or switch tube, etc., and some UA level will respond.
-
The landlord uses the "limit measurement" method, and the actual current of the chip obtained must be larger than that written in the manual.
This is not surprising. The instructions show a current that works stably for a long time and basically does not lose life.
Only a current of the MA level can brighten it ,..
There is a bright light, that's for sure.
It's just a faint light, and it's a question of whether it can be considered "bright".
The testing methods and evaluation standards of the landlord should be in line with the standards of various manufacturers.
-
Both P0 and P2 have an open-drain output mode, so why don't you use the LED cathode connected to the IO (anode connected to the capped current resistor and power supply) to drive it?
Is your 15UA measured when the LED is bright?
-
The circuit is correct.
The landlord's circuit is to light up the diode when the output level is high, which is to add a "source current" load to the single-chip microcomputer.
However, the general single-chip microcomputer, when the output is high, does not have the ability to output current, so it needs to be assisted by an external "pull-up resistor".
The light-emitting diode emits a high light-emitting voltage, which can be calculated as 2V, and a pull-up resistor of 1K can produce a current of 3mA.
So, this circuit is correct.
However, if the output level is low and the diode is not allowed to emit light, a pull-up resistor of 1K can cause a current of 5mA!
Moreover, this "larger" current is all poured into the pins of the microcontroller, although it may not burn out, it is also a needless energy consumption.
Judging from this phenomenon, this circuit is not reasonable enough.
If possible, a "sink current" load circuit should be used as much as possible.
Regarding the output drive of the MCU pins, etc., can be seen:
-
It is not correct to connect it like this, and it is easy to damage the single-chip microcomputer.
A resistor should be inserted in series in the LED circuit, and the resistance should be selected according to the LED parameters, generally 5mA can be used, such as 1K resistor in series.
When the 5V voltage is directly applied to both ends of the diode, the current will be very large, and the diode may be burned out, and even if it is not burned, the voltage difference rule will no longer be observed.
If the parameters of the single-chip microcomputer allow direct driving, the IO port can be connected to a resistor and then connected to the LED to the ground, and the output level is high and the LED is lit at this time.
If the single-chip microcomputer cannot be driven, the voltage positive termination diode can be used and then connected to the resistor to the IO port, and the output level is low and the LED is lit.
void key0()
if(p1_0!=1) *If the key 0 is pressed. >>>More
Crash, it may be that the on-site interference is too severe. Anyway, even have abandoned chips that don't have internal program memory and EEPROM. The reason is that it is often not a program problem, but a board and PCB design problem. >>>More
For how to learn single-chip microcomputer, I think it is still necessary to master its hardware, storage structure, assembly must be proficient, because the introduction of assembly is very helpful and understand the hardware, if you learn single-chip microcomputer, and then learn other, such as arm, at this time you can only be familiar with the assembly, but the first time to learn single-chip microcomputer, assembly, must be proficient, I mean at first do not use c to write programs, write with sinks, write can 10 20 assemblers, your assembly will go to the next level, In the future, you'll be using C for development, and you'll see how comfortable it is to optimize C with a solid foundation for assembly. Regarding the study of microcontrollers, I think it is necessary to have: >>>More