Page 1 of 2
Internal Pull Down?
Posted:
Sat May 28, 2022 2:24 pm
by L67GS
I've been using INPUT_PULLUP, but I want to use some TP223 sensors and PULLDOWN would be super cool. TTP223 can do an inverted output, or theoretically I could get a 7404 involved or do a bunch of pull down resistors but it would be so much simpler if I could just pull them down internally in code.
PIC12F, I tried INPUT_PULLDOWN and INPUT_PULLDN to no avail, any advice would be appreciated.
Thanks, Tom
Re: Internal Pull Down?
Posted:
Sat May 28, 2022 3:51 pm
by btidey
GPIO 0-15 on the esp8266 only have the hardware to allow configurable pullup. GPIO16 is different and only has the hardware to allow configurable pulldown.
Looking at the Tpp223 chip the output seems to be active high or low so I am not sure why you need a pull up or down anyway.
Re: Internal Pull Down?
Posted:
Sun May 29, 2022 5:23 am
by L67GS
It's battery powered, I'm trying to shave a little power. I'll probably just invert the outputs on the TTP223's. If I remember correctly there's some problem with pulling some of the pins low at boot anyway, like it puts the ESP in programming mode or something.
I may even have to use a BJT with a GPIO to turn them on so they don't mess it up at boot.
Re: Internal Pull Down?
Posted:
Sun May 29, 2022 6:51 am
by btidey
I still don't really understand your concern here.
The pins that control the boot process on the esp8266 are GPIO0,2,15. If you connect the sensor to another GPIO e.g. 12,13,14,4,5 then there will be no conflict.
The TPP223 is a very low power device. To minimise power then you are best not using pull up / down as that is just loading the active output of the sensor unnecessarily. Even so the current consumption is very small.
Are you planning to use deep sleep of the ESP8266? If so are you planning to use the sensor to wake up the ESP8266? If you are then one technique is to connect the sensor to the EN pin of the ESP8266. When the sensor goes high then the esp8266 would wake up, but you would need to also need to feedback a maintaining signal from a GPIO to the EN via a diode to keep the ESP8266 running until it has done its work and can resume sleeping.
if you want any more specific advice then you need to describe a bit more about the overall functionality of your project.