Why are the port pins high in 8051
The outputs and inputs of the 2051
The output configuration of an 8051-compatible is quite peculiar. If a 0 is written to an I / O port, a transistor opens, which pulls the pin responsible for this directly to GND. This transistor is specified for 20mA, but not protected by a resistor. If you switch the pin to Vcc with a consumer that needs more than 20mA, this transistor will burn out: the controller is damaged.
A pin can be used as a guideline never with less than 330 ohms to switch directly to Vcc. If you want to operate a light-emitting diode directly on the chip, the voltage drop through the diode must of course be subtracted beforehand. The series resistor for a standard LED at 5V is therefore around 180 ohms.
Another limit value has to be observed: for the AT89C2051 the manufacturer only guarantees a total load of 80mA for all pins in total. A 7 segment display with 7x20mA would clearly exceed the maximum value with 140mA. However, in my experience, you shouldn't take this limit value so narrowly, in contrast to the 20mA per pin. The 80mA apply to a maximum working temperature of 125 ° C. If you don't install the chip in your heating system or in your car, you can safely demand a lot more performance at normal room temperature. A 7 segment display with a decimal point can therefore also be implemented without additional power drivers.
If you write a 1 to an I / O port, a transistor (or FET) generates a weak pull-up, as shown in the diagram Depletion Mode FET called, connected to Vcc. This can easily be pulled from a circuit to GND,
One thing in particular follows from this: The high state of the pin is quite unsuitable for applications beyond digital technology, as it is very weak and designed with wide tolerances, and it also changes shortly after activation. If you are not operating with FET circuits that have a very high input resistance, you should use the low state for switching, the 20mA of which is also sufficient for more power-hungry circuits. Apart from that, there is another point that speaks in favor of switching with the 0 instead of the 1:
The reset state for all pins is the logical 1. If 1 were to be used for switching, the motors, pumps or lamps that are controlled with it would start up briefly each time for the moment of the reset, until the program takes control and switches it off again. If a large capacitor is installed in the + 5V supply for support, which is loaded by this brief start-up of the consumer, then under unfavorable circumstances the input voltage can collapse immediately after the reset due to the not yet fully charged capacitor, so that the chip immediately again crashes or gets stuck in reset.
- Is India being treated with nuclear weapons
- Most atheists start out as agnostics
- How to delete Engineering Maths 2
- Why do Mexicans have inferiority complexes
- Why is the brain in the head
- Central Africa is a republic
- What are the health risks of hemorrhoids
- What is the purpose of anger
- What is half of 25 4
- Are psychopaths ever nice to be nice
- Where do surnames come from
- Why is software protected by copyright
- Why are video games so popular
- What are more revolutionary ad tech companies
- What is the saddest folk song
- Who invented serverless computing?
- How does asthma physically affect a child
- MacOS dies
- There are no longer well-paid machining jobs
- What does 3000 BC mean?
- Will fade colored red hair to pink
- How many tried Muoet
- Who is the most famous mathematician in the world
- What are the Kekule structures