I would use the ISR attached to the Status Register instead of the Debouner. Then it will fire on input signals changing status only.
I thought of that, but then you would get an interrupt, read the status register which would clear the register, exit the interrupt, the next rising edge of the bus clock would again alter the status register and you would get another interrupt - so on and so on until the debounce signal went low.
One other thought would be to leave it as Figure 13 in AN60024 with the status register sticky bits and when you get the interrupt you read the status register (basically clearing the register) - wait a small amount of time for the next bus clock rising edge, and then read the status register again which should give you the actual state of the inputs to the status register. Seems a but clunky to me, but I guess it beats sampling the switches in code.
Again, it is odd to me that this has not come up earlier - so I was thinking I must be doing something incorrect.
I just got back to this project after a long hiatus working on another project... I thought it would be a good idea to kind of round out this post with what I finally found out.
The switches that I am using on the prototype board are quite old (found in the junk box), and as it turns out they are very bouncy. Putting an oscilloscope on the switch and trigging off of the first transition I am seeing bounce activity in excess of 300 milliseconds - crazy long. They are conductive rubber push button switches, and most likely the rubber has either deteriorated or the contact surface has gotten contaminated.
My interim fix for the prototype was to put in an RC network and connecting that to a 74HC14 Hex Inverting Schmitt Trigger. I set the time constant so that after 200 milliseconds the voltage will hit the lowest specified voltage of the high input transition of the Schmitt Trigger. The 200 to 300 millisecond delay incurred is well within typical user expected button press/release response time. I know that the PSoC inputs have hysteresis, but the hysteresis window is fairly narrow and not as well defined as it is in the 74HC14.
Of course the ultimate solution is to use a much better and newer switch, but this is a good lesson on how bad a switch can get over time with a solution that can be used to compensate. Now on to ordering new switches
Thank you for this. I appreciate the links in the documentation giving the background information. Software versus hardware based solutions, the age old argument. Back in the day when I made a living doing engineering work a hardware based solution was generally given more weight in the decision process as the microcontrollers had very limited speed and memory to work with (i.e. Intel 8748 and Motorola 68HC05 type of devices) I will most definitely give this a good looking at before I commit to the PCB layout and fabrication.