Hello!
Sorry for the late reply. i have to use this 0 to 25.5 msec for debounce the input.
Debouncing suggest that you want to use a button and prevent it to bounce, right?
I don't quite understand why you would use a potentiometer for that, but I will suppose
you want to use the potentiometer value to setup the delay used to debounce the button.
1. Setup a timer with interrupt, let's call it TimerA. Don't start it now.
2. Read the value of the potentiometer, set its value (or something proportional) to timerA.
3. Setup your pushbutton with an interrupt
4 on Button interrupt, disable button interrupts so that you cannot have a second edge,
and then fire TimerA (the time of which is proportional to your pot)
5. On TimerA interrupt, enable button interrupts again, and process your button event.
That's about it.
Dora.