PDA

View Full Version : Problems setting INTCONx registers in 18F4550



jellis00
- 7th December 2009, 06:50
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?



' 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

Bill Legge
- 8th December 2009, 02:05
I hesitate to say this as I guess you must be an experienced PBP programmer - have you selected the chip type as 18F4550 in the 'chip select' box?

Regards Bill legge

jellis00
- 8th December 2009, 21:09
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