Sir Darrel Taylor.
my counter code is working well.
I want to counts the rising edge on INT0 and falling edge on INT1 of the pulse trains from encoder.
How i configure interrupt on the INT1 as Falling edge and INT0 as rising edge.
I short both pin but dont'know how to config. edge bit.
code.
Code:
' chip PIC18F4550
DEFINE OSC 48
INCLUDE "MODEDEFS.BAS"
include "MYLCD.BAS"
CMCON = 7
ADCON1 = 15
CVRCON = %00000000 'CVref turned off
TRISB = %11111111
w0 var word
pause 500
'-------------------------[ INT0 Interrpt setting ] -----------------------------
INCLUDE "DT_INTS-18.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler INT0_INT, _ToggleLED1, PBP, yes
INT_Handler INT1_INT, _ToggleLED2, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE INT0_INT
@ INT_ENABLE INT1_INT
'__________________________________________________________________________________
start: lcdout $fe,1
lcdout "count = ",dec5 w0
pause 200
goto start
ToggleLED1:
w0 = w0+1
@ INT_RETURN
ToggleLED2:
w0 = w0+1
@ INT_RETURN
Bookmarks