Latched inputs?
potatohead
Posts: 10,261
in Propeller 2
Have we done this already? Would be nice to have a latched mode for easy debounce. (Saw something on Hack a Day and remembered this nice mode available on some PIA chips I've worked with in the past. Program sets the latch, and user input changes it. Once changed, it stays changed, until the program sets the latch again.
Comments
ie Pin edges to a change in flags or register values, is naturally 'sticky'.
My old Atari offered that option on its bi-directional game ports. At a little south of 2mhz, it was nice to not worry about polling and or some ISR to manage inputs. If it happened, the state change was there, no worries on CPU intensive code.
Figured we are making the pins do lots of cool stuff, why not?
- or you could use a SPCO micro switch, combined with such a pin-keeper feedback, for debounce.
A downside is you need to wait for the user to release, before you can re-arm, and that means a regular retry.
So debounce is not eliminated, just moved from leading edge, to trailing edge.
For some designs, the leading edge is more important.