| ??? 11/26/01 05:38 Read: times |
#16920 - RE: creating an intrupt driven counter |
Hi Pat:
Building upon the advice from Eric and Duh, your basic problem (once isolated and debounced by whatever) is what is is generally called an "external interrupt." Thus, you might focus on the [not]INTO and [not]INT1 pins, as "input response" pins. These can be used to set bit flags, IE0 and IE1, in the timer control register(TCON) to "1", when the INT(X) pin(s) goes low or sense a high-to-low transition. Then, you can read the chosen bit flag(s) IE(X)with your interrupt handler routine and decrement or manipulate the count. Yet, I will point-out an important consideration with this operation in that, the "low" signal must be returned to a "high" before your handler encounters the return instruction (RETI). So, you will need to consider using a branched routine to "force" this, or make some provision within the circuit you use to trigger the interrupt. Otherwise, the handler will act again on the same interrupt, as long as the pin is held low, for as many program loops it can cycle thru, before the interrupt signal is removed. I hope that helps . . . . Regards -- Ev |
| Topic | Author | Date |
| creating an intrupt driven counter | 01/01/70 00:00 | |
| RE: creating an intrupt driven counter | 01/01/70 00:00 | |
| RE: creating an intrupt driven counter | 01/01/70 00:00 | |
| RE: creating an intrupt driven counter | 01/01/70 00:00 | |
RE: creating an intrupt driven counter | 01/01/70 00:00 |



