Switch Bounce?
-
- Posts: 48
- Joined: Tue Dec 22, 2020 7:42 am
Switch Bounce?
Hi all,
I'm having an issue with some buttons on my hardware panel. They're connected to a BU0836X board from Leo Bodnar and are tactile momentary switches. There are other switches and buttons attached to the same board.
At best, I often get a situation where the command is repeated (VNAV turns on then immediately off again for instance) - at worst I get an instant CTD out of x-plane.
Is it possible I'm suffering from switch bounce? The issue is confined to four tactile buttons which are different from the rest of the panel, hence my suspicion.
I'm having an issue with some buttons on my hardware panel. They're connected to a BU0836X board from Leo Bodnar and are tactile momentary switches. There are other switches and buttons attached to the same board.
At best, I often get a situation where the command is repeated (VNAV turns on then immediately off again for instance) - at worst I get an instant CTD out of x-plane.
Is it possible I'm suffering from switch bounce? The issue is confined to four tactile buttons which are different from the rest of the panel, hence my suspicion.
Re: Switch Bounce?
That's why we have debouncing in our Arduino code. But I guess that you'll have to ask Leo Bodnar for a solution.
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Switch Bounce?
Hi
I got this one and just had to use.
Keith
I got this one and just had to use.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
-
- Posts: 48
- Joined: Tue Dec 22, 2020 7:42 am
Re: Switch Bounce?
So there's debouncing written in - I guessed so but it's good to have it confirmed. But would switch bounce cause a crash does anyone know?
I'll try moving the switches over to an Arduino (they're in a Bodnar card as a historical hangover from a previous cockpit) - I need to go "full Arduino" anyway and this will get me going! That way I'll know if it's the Bodnar or the witches.
Cheers,
Roger.
-
- Posts: 48
- Joined: Tue Dec 22, 2020 7:42 am
Re: Switch Bounce?
Keith Baxter wrote: ↑Thu Feb 25, 2021 3:27 pm Hi
I got this one and just had to use.
throwback.gif
Keith
-
- Posts: 48
- Joined: Tue Dec 22, 2020 7:42 am
Re: Switch Bounce?
I've just realised, though, your debounce code is in the Arduino flash rather than in Air Manager, eh?
Re: Switch Bounce?
Yes that's correct.
Re: Switch Bounce?
Hi,
Switch debouncing is done in AM code, not in Arduno code.
Button debouncing is done in Arduino code.
Corjan
Switch debouncing is done in AM code, not in Arduno code.
Button debouncing is done in Arduino code.
Corjan
Re: Switch Bounce?
For Bodner, If you ever wanted an external clean option then you could use an R/C filter, or an RC filter / Schmitt trigger combo, or, a potentially easy way if you must use the Bodner board is an MC14490 IC. (6 Channels)
Datasheet - https://www.onsemi.com/pub/Collateral/MC14490-D.PDF
They are cheap as well .
https://www.onsemi.com/pub/Collateral/MC14490-D.PDF
Haven't personally tried them in anger yet , but have a few on order as it is, potentially, a very nice solution that is as good as an R/C / Diode / Schmitt trigger combo.
just a thought..
Datasheet - https://www.onsemi.com/pub/Collateral/MC14490-D.PDF
They are cheap as well .
https://www.onsemi.com/pub/Collateral/MC14490-D.PDF
Haven't personally tried them in anger yet , but have a few on order as it is, potentially, a very nice solution that is as good as an R/C / Diode / Schmitt trigger combo.
just a thought..
Joe. CISSP, MSc.
-
- Posts: 48
- Joined: Tue Dec 22, 2020 7:42 am
Re: Switch Bounce?
I thinkit's definitely the use of the joystick card.
I'm guessing the switch and button debouncing won't be present, either through arduino or through AM code, as the joystick inputs are handled by the Game Controller interface?
I have a Bodnar card and also a generic 12-button joystick card.
AM doesn't differentiate between the two, so once I'd used up all 12 connections to the generic card, I started using the Bodnar from input 13.
I also had code for the Game Controller interface and an arduino in the same instrument. I separated this into two different instruments earlier today and it's a bit more stable, but I just had another CTD when operating a switch attached to the generic USB joystick card.
I'm feeling, then, that there' something about the game Controller interface regarding switch bounce which is different from the way the Arduino and AM deal with it perhaps? Game Controller inputs don't have a switch_id or button_id...
I have enough spare arduino inputs to move all the switches over - and i will do this in the future, but it's around 30 switches to re-solder, so i kinda want to get this working so i can fly, lol!
I'm using v4 BETA btw.
I'm guessing the switch and button debouncing won't be present, either through arduino or through AM code, as the joystick inputs are handled by the Game Controller interface?
I have a Bodnar card and also a generic 12-button joystick card.
AM doesn't differentiate between the two, so once I'd used up all 12 connections to the generic card, I started using the Bodnar from input 13.
I also had code for the Game Controller interface and an arduino in the same instrument. I separated this into two different instruments earlier today and it's a bit more stable, but I just had another CTD when operating a switch attached to the generic USB joystick card.
I'm feeling, then, that there' something about the game Controller interface regarding switch bounce which is different from the way the Arduino and AM deal with it perhaps? Game Controller inputs don't have a switch_id or button_id...
I have enough spare arduino inputs to move all the switches over - and i will do this in the future, but it's around 30 switches to re-solder, so i kinda want to get this working so i can fly, lol!
I'm using v4 BETA btw.