Eric, · You need to remove the "GOTO ISR_Exit" lines. ·· They are not needed, and they are outside of the IF..ENDIF. So the first one encountered ends the whole interrupt.
···If you use an array to hold·the·"LEDNum" and "DIGITx" values, the interrupt would be much simpler.
ISR_Start:
INC Counter
Counter.2 = 0 ' Keep counter in range 0 to 3
SEGMENTS = BLANK
LEDNUM = LED_Values(Counter)
READ SEG_MAP + Digits(Counter), SEGMENTS
ISR_Exit:
RETURNINT
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
Note, too, that the COUNT function will be disrupted by the ISR. What is you maximum pulse rate coming in? I have code you can dump into the ISR to do the counting in the background as it's updating the display. Theoretically, your maximum input frequency can be 1/2 the ISR frequency so with your present ISR setting you could count pulses coming in at up to 500 Hz.
INTERRUPT 1000 causes the interrupt to run 1000 times per second -- or every millisecond. There is information on the INTERRUPT settings in the help file. In this case the interrupt is triggered by the RTCC rollover. SX/B simplifies ISR programming by making the correct settings to the OPTION register and reloading the RTCC at the end of the interrupt code.
Comments
· You need to remove the "GOTO ISR_Exit" lines.
·· They are not needed, and they are outside of the IF..ENDIF. So the first one encountered ends the whole interrupt.
···If you use an array to hold·the·"LEDNum" and "DIGITx" values, the interrupt would be much simpler.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
Post Edited (Bean (Hitt Consulting)) : 9/3/2008 12:48:49 PM GMT
Post Edited (JonnyMac) : 9/3/2008 6:32:52 PM GMT
And I noticed INTERRUPT 1000 What does this statement do?
(I am trying to learn about interrupt).