There is no INTCON1 register. That would be why you get the error. Look at your datasheet.
To monitor interrupt "flag bits" you do not need to enable any interrupt enable bits or global interrupts.
Any event or condition that will trigger the interrupt, will set the interrupts flag bit. This happens regardless of whether you have "any" interrupt enabled or disabled.
A "Flag bit" indicates that an interrupt event occurred.
The interrupt "Enable bit" allows program execution to branch to the interrupt vector address (if global interrupts are enabled) when the flag bit is set by the event that caused the interrupt.
You can setup the RB0/INT0 on the 18F4520 to set the interrupt flag bit on a low-to-high or high-to-low transition on RB0/INT0. See the datasheet under INTCON2.
Then all you need to do is monitor INTCON.1 (this means INTCON register bit #1 NOT INTCON1) which is the "flag bit" inidicating the transition (event) on RB0/INT0 has occured.
After reading this bit, then reset it (clear it to 0) so you can check it again later to see if the event has happend again.
Bookmarks