Capture Custom Interrupt Code
Posted: Mon Sep 09, 2019 3:44 pm
Hello all,
I am trying to use the two Capture modules CCP1 and CCP2 on a PIC18F2550 to measure the time difference between two pulses. The rising edge of the first on CCP1 clears Timer 1 and the rising edge
on CCP2 saves Timer 1 value to variables HIGH and LOW. This value is sent out over UART1.
In practice 0x00 is sent out on UART1 at 1mS intervals until the first pulse is received. UART1 output then ceases. The interrupt looks like it is being called but not cleared. This should be done in the Interrupt Handler code.
Could someone have a look please?
I am trying to use the two Capture modules CCP1 and CCP2 on a PIC18F2550 to measure the time difference between two pulses. The rising edge of the first on CCP1 clears Timer 1 and the rising edge
on CCP2 saves Timer 1 value to variables HIGH and LOW. This value is sent out over UART1.
In practice 0x00 is sent out on UART1 at 1mS intervals until the first pulse is received. UART1 output then ceases. The interrupt looks like it is being called but not cleared. This should be done in the Interrupt Handler code.
Could someone have a look please?