If a logic high signal (+5V) comes from another IC or from a power source continuously via a resistor to the PIC input pin, do I still need another resistor between the PIC input pin & GND?
If a logic high signal (+5V) comes from another IC or from a power source continuously via a resistor to the PIC input pin, do I still need another resistor between the PIC input pin & GND?
Yes the power source is 5V not 12V.I need to detect it is available or not by every time polling that pin.In this case do I need another resistor between the PIC input pin & GND?
Yes the power source is 5V not 12V.I need to detect it is available or not by every time polling that pin.In this case do I need another resistor between the PIC input pin & GND?
Hi its a 4.7K.I need to detect if the 5V source is there or not, so it can activate the battery backup in my timer project when power goes down.So I'm polling a pin every time.
Hi its a 4.7K.I need to detect if the 5V source is there or not, so it can activate the battery backup in my timer project when power goes down.So I'm polling a pin every time.
If the source end of the 4K7 went to an open circuit, then the PIC pin would be effectively 'floating'.
To avoid this, add a resistor to 0V from the PIC pin, use a value such that when the +5V
is present at the Vsource the voltage at the PIC pin is say +4V.
A resistor value of about 22Kish should give +4V which the PIC will see as a high.
The pull down resistor is needed to avoid the input from floating. I'm just wondering why do you need another resistor connected from the power source to the input pin?
The pull down resistor is needed to avoid the input from floating. I'm just wondering why do you need another resistor connected from the power source to the input pin?
Assuming it's always 5v (or 0v) source then you don't really need a series resistor. However most microprocessor these days have diode clamping on their I/O pins, and if the source voltage into a pin is higher or lower then the micros Vcc & Vdd then damage can happen due to over current drawn into the pin. One cheap insurance against accidental over or under voltage from being applied to the micro I/O pin is a series resistor that limits the maximum current flow when a clamping diode conducts.
So a series resistor can be useful and a pull down resistor is needed to insure that a input doesn't 'float' if the external unit is powered off or disconnected. Some of the newer micros have the ability, under program control, to set a soft pull down or soft pull up resistor internal to the chip. If available and used then there would be no need for a external pull down or up resistor, but the series protection resistor would still be useful.
If you use both a series and pull down resistor at the same time you must insure that the resulting 'voltage divider' action does not reduce the 5v down to a level less then the input will treat as a 1 or high. The pull down should be higher value then the series resistor.
If you use both a series and pull down resistor at the same time you must insure that the resulting 'voltage divider' action does not reduce the 5v down to a level less then the input will treat as a 1 or high. The pull down should be higher value then the series resistor.
That should work OK, It should read about 4vdc when high and I think that is above the I/O pin threshold, but you could check it's datasheet if you want to be sure. The 4.7K could be as lowered to say 2K and still give enough current protection.