Hi,
This is probably more a Microchip question rather than a PBP question, but seeing as im writing in PBP, I'll ask here 1st.
Basically what im trying to find out is whether the TMR1L and TMR1H are reset when the timer is activated by T1CON.0 = 1 or if i need to reset them manually as i have in my code below?
Code:startloop: CCP1CON = %00000110 ' Enable the CCP1 capture, 4th rising edge T1CON.0 = 1 ' start the timer loop: IF (capture = 0) Then loop ' Wait here until captured period.lowbyte = CCPR1L ' Store the captured value in period.highbyte = CCPR1H ' period variable T1CON.0 = 0 ' stop the timer CCP1CON = %00000000 ' Disable the CCP1 capture TMR1L = 0 ' Clear Timer1 low register TMR1H = 0 ' Clear Timer1 high register




Bookmarks