PDA

View Full Version : quick question 12F683



peterdeco1
- 29th December 2016, 12:05
Hello all. I'm running a 12F683 at 3.3V. One of the GPIO's is connected to a place in a circuit that rises to only 1.2V when it's activated. Is this enough voltage to reliably support the code "if gpio.X = 1 then..." or does it need higher voltage to detect it consistently? Thank you.

HenrikOlsson
- 29th December 2016, 13:38
Hi,
Looking at page 121 in the datasheet (http://ww1.microchip.com/downloads/en/devicedoc/41211d_.pdf) it says that when Vdd is between 2.0V and 4.5V a TTL input is considered high when the voltage on the pin is 0.25*Vdd+0.8V. With a 3.3V supply this equals 1.625V so 1.2V is not guaranteed to be interpreted as a logic 1. For a schmitt trigger input the number is 0.8Vdd which for 3.3V is 2.64V so even "worse" in your case.

/Henrik.

peterdeco1
- 30th December 2016, 10:05
Thank you Henrik. I need to find another way to detect when the circuit is active.

HenrikOlsson
- 30th December 2016, 10:13
Just use a simple transistor buffer.
Pullup resistor on I/O-pin, NPN transistor pulling I/O-pin to GND when the 1.2V signal drives a small current into the transitors base.

/Henrik.

peterdeco1
- 30th December 2016, 11:00
Unfortunately the circuit board is already manufactured with a pull down resistor network. The switch that activates the circuit which I'm trying to detect goes to ground when pushed. True, I can use an inverter but it needs to be a very simple hook-up. Attach B+, B-, one wire output and one wire detect. I'll probe around more today to see if there's another way around this. Again thank you Henrik.

Charlie
- 30th December 2016, 13:47
Just use the ADC to measure the voltage on the pin and decide in software what is a high and what is a low.

amgen
- 30th December 2016, 13:49
if your pin is an analog pin, use the a/d mode to make a thresh-hold that works.......
(beat me by 2 minutes)

peterdeco1
- 31st December 2016, 11:15
Thank you everyone. I found a spot that goes up to a full 3V when the circuit is activated but is a difficult connection to make. I'm going to use the ADC solution as this connection is much faster and easier.