for a pic18f452 you need to use RBC_INT for best results and pins portb.4,5 or portb.6,7 or portb.5,6
this line needs to match chosen p1ns
ev=ev|((porta&12)>>2) ;read enc pins 2,3 mask off others then combine this reading with last reading
for pins portb.4,5 it would be
Code:
INT_LIST macro
INT_HANDLER IOC_INT, _enc_isr,pbp,NO
endm
INT_CREATE
would be
Code:
INT_LIST macro
INT_HANDLER RBC_INT, _enc_isr,pbp,NO
endm
INT_CREATE
IOCAP=12 ;enca porta.2 encb porta.3 pos edge trigger
IOCAN=12 ;enca porta.2 encb porta.3 neg edge trigger
IOCAF=0
INTCON=$C8
would be
dummy_var = portb
INTCON=$C8
any references to IOCAF need to be deleted , trisb must be appropiate
Bookmarks