Page 1 of 1

USR switch and MAX6816 debouncer

Posted: Fri Jun 19, 2020 5:07 pm
by smhodge
I an using an external USR switch connected to X17. On an early version of my motherboard I simply put another circuit in parallel with the one on the pyboard v1.1 schematic, complete with 4.7K resistor in series. I could use both the pyboard USR switch and the external switch to trigger the callback, which is what I wanted, but the external push-button switch I used turned out to be *very* bouncy. I added some debouncing code but even that didn't take care of it 100% of the time, so on the next version of my motherboard I added a MAX6816 switch debouncer in series, again with a 4.7K resistor between the output of the MAX6816 and X17. I have used these IC's quite successsfully in the past with no problem.

The external switch w/ MAX6816 works to trigger the callback, and does it nicely without any debouncing code needed, as desired, but the pyboard switch no longer triggers the callback! However, it still works to do the various pyboard resets in conjunction with the RST switch. I also have this added to (yet another) version of my motherboard and it is the same result with that, so I'm sure there is nothing wrong with the hardware circuitry. It seems like the MAX6816 is messing up the pyboard USR switch, which I find very weird.

Might somebody have a clue why this is happening?

Re: USR switch and MAX6816 debouncer

Posted: Fri Jun 19, 2020 7:30 pm
by dhylands
The max6816 output appears to be push-pull rather than open-drain, which is why the on-board button no longer works (the 6816 is driving the signal high).

So you need to have the 6816 drive a transistor or using an open-drain buffer like the 74LVC1G07

Re: USR switch and MAX6816 debouncer

Posted: Fri Jun 19, 2020 7:59 pm
by smhodge
Ah, got it! Thanks