
Originally Posted by
Darrel Taylor
John,
On the 16F88x's use IOC_INT (Interrupt On Change).
Set the pins you want to monitor in the IOCB register.
OK, Darrel...I got rid of the On Change interrupt related statements in my code and set up for the IOC_INT per following.
Code:
;--- Setup Interrupts ----------------------------------------------------
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler IOC_INT, _Alarm, PBP, yes
; INT_Handler LVD_INT, _VoltLow, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE IOC_INT ; enable IOC interrupts
' Per DT, DT_INTS already takes care of setting registers
' but this code doesn't work unles below registers set as indicated:
IOCB.2= 1 ' ENABLE IOC INERRUPT ON PORTB.2 (RB2) for Alarm1
TRISB = %00011100 ' RB2 & RB3 set as RTC Alarm1 & Alarm2 inputs
' PORTB.2 is also an interrupt from manual switch GND
' PORTB.4 is set for input as A/D Channel 11
WPUB = 0 ' DISABLE all PortB pull-ups
CM1CON0 = 0 ' DISABLE COMPARATORS
CM2CON0 = 0 ' DISABLE COMPARATORS
However I get the following assembler errors which made me go into the .lst file to see where the problem was but I can't locate what is causing these errors. Can you tell me?
Warning[205] C:\PBP26\ELLIS_CODES\RTC\16F886\0SETDS1337CLOCK.AS M 364 : Found directive in column 1. (endm)
Warning[207] C:\PBP26\ELLIS_CODES\RTC\16F886\0SETDS1337CLOCK.AS M 551 : Found label after column 1. (INT_ENABLE)
Error[122] C:\PBP26\ELLIS_CODES\RTC\16F886\0SETDS1337CLOCK.AS M 551 : Illegal opcode (IOC_INT)
Bookmarks