Problems setting INTCONx registers in 18F4550
I am coding for a PIC 18F4550 with PBP 2.6. I need to set some of the bits in the INCON2, INCON3 and RCON registers and keep getting syntax errors at compile time for the following statements. As far as I can see in the Datasheet and the PBP manual these are correct syntax yet the errors. Can anyone tell me what is wrong with these?
Code:
' Interrupts Settings
RCON = %10000000 ' Set Interrupt Priority Enable bit (Bit7=IPEN)
' to enable priority levels on interrupts
INTCON.7 = 1 ' Set Global Interrupt Enable bit
INTCON2.7 = 1 ' Enable PORTB Pull-ups (Bit7-high), set INT2 for
' falling edge (Bit4-low) on RTC's interrupt.
INTCON3 = %10010000 ' Set INT2 high priority (Bit7-high), enable INT2
' (Bit4-high)
RTC_INT_FLG VAR INTCON3.1 'Alias for RB4 INTA interrupt from RTC
Duhh...that was it...senior moment!
Quote:
Originally Posted by
Bill Legge
have you selected the chip type as 18F4550 in the 'chip select' box?
Thanks, Bill. . Even experienced programmers have their senior moments. I should have looked at the device setting all along