Read-out current GPIO status

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

Moderator: hvxl

Read-out current GPIO status

Postby jvandenbroek » Mon Oct 19, 2015 12:42 pm

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? :)
jvandenbroek
Starting Member
Starting Member
 
Posts: 3
Joined: March 2014

Re: Read-out current GPIO status

Postby hvxl » Tue Oct 20, 2015 5:20 pm

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
hvxl
Senior Member
Senior Member
 
Posts: 1201
Joined: June 2010

Re: Read-out current GPIO status

Postby jvandenbroek » Sat Dec 12, 2015 10:59 am

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 :)
jvandenbroek
Starting Member
Starting Member
 
Posts: 3
Joined: March 2014


Return to Opentherm Gateway Forum

Who is online

Users browsing this forum: No registered users and 1 guest