USR switch and MAX6816 debouncer

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
smhodge
Posts: 86
Joined: Tue Jan 22, 2019 2:16 am
Location: Kirkland, WA, USA

USR switch and MAX6816 debouncer

Post by smhodge » Fri Jun 19, 2020 5:07 pm

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?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: USR switch and MAX6816 debouncer

Post by dhylands » Fri Jun 19, 2020 7:30 pm

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

smhodge
Posts: 86
Joined: Tue Jan 22, 2019 2:16 am
Location: Kirkland, WA, USA

Re: USR switch and MAX6816 debouncer

Post by smhodge » Fri Jun 19, 2020 7:59 pm

Ah, got it! Thanks

Post Reply