This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5438: ACLK not triggering capture of Timer B

Part Number: MSP430F5438

With Timer B driven by SMCLK configured for DCO at 12 MHz, and ACLK driven from XT1 crystal at 32768 Hz, using capture/compare module block 6 with CCIS = CCI6B, trying to latch TB0R into TB0CCR6 at every falling edge of ACLK.

No joy; CCI never appears non-0 (in debugger); interrupt for TB0CCR6 capture never fires.

Manually (in debugger) toggling CCIS from 10 to 11 and back, forcing CCI source from VCC to GND and back, forces falling edge detection in CCI and TB0R value gets latched into TB0CCR6.

Plenty of evidence elsewhere (Timer A sourced from ACLK) that ACLK is running and falling edges should be available.

static void vInitializeTimerB0CCR6( void ) {
    // Disable Interrupts
    _DINT() ;
    // run TB0R from SMCLK continuous
    /* [Already done by osal_init_system()->osalTimerInit()!]
    TB0CTL = TBSSEL__SMCLK + MC__CONTINUOUS + TBCLR ;
    */
    // set CCR6 to latch TB0R on falling edges of ACLK
    TB0CCTL6
        = CAP // Capture mode
        + CCIS_1 // Capture input (trigger) select: 1 - CCIxB ( = ACLK )
        + CM_2 // Capture mode: 1 - neg. edge */
        + CCIE // Capture/compare interrupt enable
        + SCS // Capture sychronize
        ;
    // "Setting the SCS bit to synchronize the capture signal with the timer clock is recommended."
    // Enable Interrupts
    _EINT() ;
}

  • A-huh. And harrumph!

    This code derived from one of the recommended mitigations of erratum UCS10 in TI document SLAA489A "Application Report UCS10 Guidance", because we are indeed suffering from UART framing errors caused by DCO frequency glitches due to the FLL errors described by the erratum.

    HOWEVER, the suggested remediation is essentially MOOT, because the key ingredient of the fix, namely latching of SMCLK counts by ACLK edges, is ITSELF victim of another erratum: TB20:

    TB20 TIMER_B Module

    Category Functional
    Function ACLK cannot be used as an internal capture input
    Description The capture compare input of Timer_B7, CCI6B, is not connected internally to ACLK, as
    in previous device families.

    I am surprised and disappointed that the erratum Application Report was never updated to take into account that its guidance was broken by another erratum.

  • Hi

    Thank you for your comments here.

    Best regards

    Gary

**Attention** This is a public forum