Tool/software:
Dear Support Team,
I am encountering difficulties while developing firmware to retrieve the counter value from the Timer B0 Capture input (TB0.2, pin #33) on my MSP430FR6047 device.
Specifically, although the Timer B0 settings appear correct and the timer register TB0R
increments as expected, both the CCI (Capture/Compare Input) signal indication and the capture compare register TB0CCR2
consistently read as zero. I suspect there might be an error in my configuration.
I am utilizing the TI DriverLib libraries (from: MSPDRIVERLIB Driver or library | TI.com).
Below is the relevant code segment for the Timer B0 capture mode initialization:
Timer_B_initCaptureModeParam Timer_B0_Param = {0}; Timer_B_clearTimerInterrupt(TIMER_B0_BASE); Timer_B0_Param.captureInputSelect = TIMER_B_CAPTURE_INPUTSELECT_CCIxA; Timer_B0_Param.captureInterruptEnable = TIMER_B_CAPTURECOMPARE_INTERRUPT_DISABLE; Timer_B0_Param.captureMode = TIMER_B_CAPTUREMODE_RISING_EDGE; Timer_B0_Param.captureOutputMode = TIMER_B_OUTPUTMODE_OUTBITVALUE; Timer_B0_Param.captureRegister = TIMER_B_CAPTURECOMPARE_REGISTER_2; Timer_B0_Param.synchronizeCaptureSource = TIMER_B_CAPTURE_ASYNCHRONOUS; TB0CTL = TB0CTL | CNTL_0 | TBSSEL_1 | ID__8; //Counter Length 0xFFFF, Clock Source ACKL (32kHz), Clock Divider = /8 -> Period 16s Timer_B_selectCounterLength(TIMER_B0_BASE, TIMER_B_COUNTER_16BIT); Timer_B_initCaptureMode(TIMER_B0_BASE, &Timer_B0_Param);
After applying these settings, I toggle the TB0.2 input (pin #33) and then attempt to read the captured value using:
Timer_B_getCaptureCompareCount(TIMER_B0_BASE, TIMER_B_CAPTURECOMPARE_REGISTER_2);
However, this function call consistently returns zero.
Hope it is clear. I am looking forward to hearing from you.
Kind regards,
Vladimir Zitoli