That Horrible Nasty Wicked ON INTERRUPT sets GIE for you.![]()
Hmm! Maybe one more reason I don't use it...;o}
Here's another reason ...,
You can't turn GIE off. If you do, it jumps to the handler then turns GIE back on.
That will flash the LED via the Interrupt handler, even though no interrupts have occured.Code:LED1 VAR PORTB.0 ON INTERRUPT GOTO MyINT Main: PAUSE 500 INTCON.7 = 0 GOTO Main DISABLE MyINT: TOGGLE LED1 RESUME
<br>
DT
One more reason to use DT-INTS ehh..;o}
BTW: Nice work on the new interrupt routines Darrel. Most impressive.
Itīs not working. The INTCON registers seems to be the same, but nothing happens to PORTB change...
Oh i didnīt see your last post.
Is it not possible to work like before with RBCPins ... ?
What does Note1 means?
bit 7 GIE: Global Interrupt Enable bit
1 = Enables all unmasked interrupts
0 = Disables all interrupts
bit 6 PEIE: Peripheral Interrupt Enable bit
1 = Enables all unmasked peripheral interrupts
0 = Disables all peripheral interrupts
bit 5 T0IE: Timer0 Overflow Interrupt Enable bit
1 = Enables the Timer0 interrupt
0 = Disables the Timer0 interrupt
bit 4 INTE: RB0/INT External Interrupt Enable bit
1 = Enables the RB0/INT external interrupt
0 = Disables the RB0/INT external interrupt
bit 3 RBIE: PORTB Change Interrupt Enable bit(1)
1 = Enables the PORTB change interrupt
0 = Disables the PORTB change interrupt
bit 2 T0IF: Timer0 Overflow Interrupt Flag bit(2)
1 = TMR0 register has overflowed (must be cleared in software)
0 = TMR0 register did not overflow
bit 1 INTF: RB0/INT External Interrupt Flag bit
1 = The RB0/INT external interrupt occurred (must be cleared in software)
0 = The RB0/INT external interrupt did not occur
bit 0 RBIF: PORTB Change Interrupt Flag bit
1 = When at least one of the PORTB general purpose I/O pins changed state (must be cleared in software)
0 = None of the PORTB general purpose I/O pins have changed state
Note 1: The appropriate bits in the IOCB register must also be set.
Last edited by Robson; - 31st August 2007 at 00:07.
Oh i get it ;-)
Only to set
IOCB.7 = 1
IOCB.6 = 1
and it works !
Thanks a lot
with
INTCON.7 = 0 in the main loop the interrupt is repeating 2 times. Pushed 1x and release 1x.
With the IOCB only on change till the interrupt is executed.
Last edited by Robson; - 31st August 2007 at 00:36.
Oh, Very good!
I didn't even notice the 913 had individual enable bits for the RBC interrupts.
Sitting here with the datasheet too going, "It should work!" Doh!, wrong.
Nice job.
<br>
DT
Bookmarks