Hi team,
Here're some issues from the customer may need your help:
Q1.Timer B uses the capture function and is set up as rising edge capture. The following are two ways to write the interrupt program:
A.
#pragma vector = TIMER0_B0_VECTOR
__interrupt void timer_b0_isr(void)
{
if( TB0CCTL0 & CCI ){ //low level captured
//Process
TB0CCTL0 &= (~CCIFG) ; //clear interrupt flag
}
}
B.
#pragma vector = TIMER0_B0_VECTOR
__interrupt void timer_b0_isr(void)
{
//process
TB0CCTL0 &= (~CCIFG) ; //clear interrupt flag
}
If set to only the rising edge capture, they can no longer judge it in the interrupt program and process it directly, i.e. you don't have to use the "if( TB0CCTL0 & CCI )" statement. Is that right?
Q2. When Timer B is selected for pulse count, P4.7 is used as the clock input and P4.0 is used as the input square wave as the capture signal. When TBSSEL = 0, an external clock input is selected. Is the count based on the rising or falling edge of the external signal?
Could you help check this case? Thanks.
Best Regards,
Cherry