NEGEDGE detector w/ feedback?
Steve Andrues
Posts: 29
in Propeller 1
This is a documented feature of the propeller (table 2-7 in the manual) without any documentation. Does anyone know how to make this work? It looks like the perfect solution for switch closure detection which I have previously had to code around. Ideas??
Comments
If you wanted to use this to detect a switch state change, you'd need to clear the associated phsx register before checking. I don't know if this is any less code than standard debouncing, and, in fact, does not debounce the switch input.
The feedback is negative, not positive. Adding the feedback, via a resistor and to a capacitor on the input pin, causes the input to hover at the input switching threshold. If you then apply a small mV level AC signal to the input (via a capacitor) the Prop can count the frequency. However, there are caveats. At zero signal it defaults not to zero frequency, but to a very high noisy frequency, so the signal has to be “big enough” to override the noise. And there is a low frequency limit, as the feedback tries to track the input. Kind of specialized, not helpful I think for switch inputs.
Maybe if you run the feedback through another inverter, giving positive feedback, it could give snap action hysteresis to help with slower noisy transitions.