Read-out current GPIO status

This Forum is about the Opentherm gateway (OTGW) from Schelte

Moderator: hvxl

Post Reply
jvandenbroek
Starting Member
Starting Member
Posts: 3
Joined: Wed Mar 12, 2014 10:34 am

Read-out current GPIO status

Post by jvandenbroek »

Is it possible to include some command to probe the GPIO A/B current status? I had some leakage near my boiler, which got me thinking to connect a water sensor which shorts as soon as water hits it (no kiddin' :D), so when GPIO is pulled down I can read this status and let the alarm bell ring. Since I really don't want to install an additional controller (KISS), I thought to use the OTGW build-in GPIO for this purpose. Unfortunately I figured out that setting it to high and manually pulling it down doesn't change it's status.

What do you think? :)
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Read-out current GPIO status

Post by hvxl »

There's not a lot of space left in the PIC for new features, but this one only took 6 instructions to implement. That was acceptable. So, firmware version 4.2.5 now supports the PR=I command which will give you a 0 or 1 for both GPIO A and GPIO B. Enjoy.

By the way I don't suggest to set the GPIO pins high and then pulling them low. That will result in the maximum current out of the pin (something like 25mA). Instead set the function of the pin to 0 ("None") and use a pull-up resistor. Then you can pull it low without drawing a lot of current.
Schelte
jvandenbroek
Starting Member
Starting Member
Posts: 3
Joined: Wed Mar 12, 2014 10:34 am

Re: Read-out current GPIO status

Post by jvandenbroek »

It has been a while, but I wanted to thank you for implementing this. Very useful. Thanks for your suggestion, in my tests I got a reasonable amount of resistance when shorted by water, so that should not be a problem. But it's good practice to always use resistors, I agree :)
Post Reply

Return to “Opentherm Gateway Forum”