I'm really struggling with a VHDL implementation of a debouncing circuit for 2-position slider switches.I had initially planned to use an SR latch to do this but couldn't figure out how to make it work. (I'm using a Basys 3 board with Artix-7 FPGA).
I believe the problem is the way that the switches are connected to the FPGA. I found this video to be very helpful in explaining the SR latch, but he has an active low SPDT switch with two outputs. My switches appear to be connected the opposite way round, as shown in the image below which is from the Basys 3 datasheet.
One switch position is powered, and the other is grounded. Then there's a single output to the FPGA. Firstly, if this kind of switch has a particular name, can someone tell me what that is? I assumed these were SPDT switches but this configuration makes me think they're not, and I also don't know what the arrows on the switches indicate? Does it mean that the default position is grounded?
Either way, since the switch doesn't have 2 outputs to the FPGA, using an SR latch doesn't seem viable as it requires two inputs - one for each NAND gate.
Can anyone provide some info on these switches so I can research some more, since I don't seem to be able to find any info about this configuration, and the datasheet doesn't provide any info except this image. And if possible, can you suggest a method to debounce a switch like this, either in VHDL or hardware(a circuit at the switch output, not a change to the existing hardware)?
Edit: one method I've tried is using a counter which allows 10ms for the input to settle. If the input changes due to switch bounce, it will restart this counter. This works, but it means that there's a delay which I'm worried will cause timing issues. As you can see in the simulation below (which has simulated bounces for 10ms), the debounced output is unbounded until about 20ms, because it has counted 10ms after the final rising edge of the bounces. I'd prefer a method which works more like the SR latch, where it latches the input straight away. Is this possible?