Maker Pro
Maker Pro

PiC micro I/O line states

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Hi all.
I have a voltage divider connected to a PIC I/O line. A pulse comes in at the top of the divider network, scaled downand fed into the PIC. I am inly detecting for a high to low edge usibg interrupts.
This happens only once a day for 4ms then off.
I am finding that i am getting a current draw of 50uA when in the idle state. It is from the PIC to the bottom resistor of the divider to 0V.
When i check my pulse, i make the port as an input. Should i make this as a output driven low when i am not checking for my pulse train or tri state to avoid current drain?
Please could soneone explain what happens internally to the PIC lines at FET level too. I presume we have n and p type FETs to sink and source current through the I/O line.
Thanks in advance
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Why can't you leave the PIC I/O as an input all of the time? The input current is in the nanoamp region.

Bob
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
If it is an input all the time is there any way that the output can be driven high. I do not think it can. But i have narrowed it down as when i remove the bottom resistor of my voltage divider as an test, the current consumption falls to less than 2uA.
I thought about input tri state but not sure how to configure this, all i know it is that it becomes a floating input.
Would you recommend against setting as an output and then output a logic 0?
Thanks in advance
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
If it is an input all the time is there any way that the output can be driven high.
I have no idea what you are talking about. If the pin is an input, it is not an output. It will be at the voltage supplied externally and source or sink a very small (nano amps) current. A PIC digital input that has an external voltage of about 1/2 supply can cause shoot through current in the input circuit. Is that what you are talking about?

Please post a schematic, I don't think you are talking about the same circuit I am imagining.

Bob
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
I assume the OP means that he could set the pin as an output when not looking for the input.
Rajinder, what PIC are you using?
And pin #?
M.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Something must be driving the voltage divider. What is it? What are the values of the resistors? If there is a voltage driving the resistors, you can use Ohm’s law. What is that current?

The PIC input is not drawing 50uA unless it is damaged.

Making the PIC pin an output and setting it low will not reduce the current, in fact it should increase the current since it shorts the lower resistor.

Please give us enough information to help you!

Bob
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Hi
The resistor values are 15K and 10K on the bottom side.
The middle of these is connected to the PIC. The Top resistor is 15K and has a 1N4148 diode before it. A pulse waveform of 6.38V is input to the diode, 3KHz even mark to space but inly 2 pulse duration thst drives a piezo buzzer. The diode was used as 0.6V of the pulse is negative. To remove this negative voltage.
The PIC then detects high to low transitions using interrupts.

Is there a better way of me optimising the signal? As the PIC input from the potential divider is about 1.5V going to about 0.6V. This will not be recignised by the PIC as an high to low transition. I need a better way if doing this perhaps with a zener at say 3V3 before the voltage divider?

I have made the PIC as an output and driven low when i am not doing any measurements. This has reduced tbe current to around 2uA.

Thanks in advance.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Why are you dividing it down to a voltage that is too low to be recgnized as a high?

What is Vdd on the PIC?

Once again, a PIC input will never source or sink 50uA, so either it is damaged, or you are not measuring this correctly. How are you measuring this current? What is the voltage at the PIC pin when you are measuring it?

Bob
 
Top