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.

MSP430G2553 Timers

Other Parts Discussed in Thread: MSP430G2553

From my understanding Timer A is used by the hardware UART(which I am using) and there is another timer, Timer B.

I am using CC5 and have tried simply using TBCTL to access Timer B's registers, however this is not a correct nemonic.  What are the correct registers to set up Timer B on the G2553?

Thank you

John

  • Hi John,

    your msp has two Timer A modules, TA0 and TA1. So you are looking for these names:

    SFR_16BIT(TA1IV);                             /* Timer1_A3 Interrupt Vector Word */
    SFR_16BIT(TA1CTL);                            /* Timer1_A3 Control */
    SFR_16BIT(TA1CCTL0);                          /* Timer1_A3 Capture/Compare Control 0 */
    SFR_16BIT(TA1CCTL1);                          /* Timer1_A3 Capture/Compare Control 1 */
    SFR_16BIT(TA1CCTL2);                          /* Timer1_A3 Capture/Compare Control 2 */
    SFR_16BIT(TA1R);                              /* Timer1_A3 */
    SFR_16BIT(TA1CCR0);                           /* Timer1_A3 Capture/Compare 0 */
    SFR_16BIT(TA1CCR1);                           /* Timer1_A3 Capture/Compare 1 */
    SFR_16BIT(TA1CCR2);                           /* Timer1_A3 Capture/Compare 2 */

    The same set exists for TA0, but there also exist alternate names (if you use both, I would suggest to use TA0xxx and TA1xxx for easier distinction):

    /* Alternate register names */
    #define TAIV                   TA0IV          /* Timer A Interrupt Vector Word */
    #define TACTL                  TA0CTL         /* Timer A Control */
    #define TACCTL0                TA0CCTL0       /* Timer A Capture/Compare Control 0 */
    #define TACCTL1                TA0CCTL1       /* Timer A Capture/Compare Control 1 */
    #define TACCTL2                TA0CCTL2       /* Timer A Capture/Compare Control 2 */
    #define TAR                    TA0R           /* Timer A */
    #define TACCR0                 TA0CCR0        /* Timer A Capture/Compare 0 */
    #define TACCR1                 TA0CCR1        /* Timer A Capture/Compare 1 */
    #define TACCR2                 TA0CCR2        /* Timer A Capture/Compare 2 */
    #define TAIV_                  TA0IV_         /* Timer A Interrupt Vector Word */
    #define TACTL_                 TA0CTL_        /* Timer A Control */
    #define TACCTL0_               TA0CCTL0_      /* Timer A Capture/Compare Control 0 */
    #define TACCTL1_               TA0CCTL1_      /* Timer A Capture/Compare Control 1 */
    #define TACCTL2_               TA0CCTL2_      /* Timer A Capture/Compare Control 2 */
    #define TAR_                   TA0R_          /* Timer A */
    #define TACCR0_                TA0CCR0_       /* Timer A Capture/Compare 0 */
    #define TACCR1_                TA0CCR1_       /* Timer A Capture/Compare 1 */
    #define TACCR2_                TA0CCR2_       /* Timer A Capture/Compare 2 */

  • Hi Jan
    I'm having the same problems as John.
    All the registers and definitions that I'm using for Timer B are giving me errors.
    "../main.asm", ERROR! at EOF: [E0300] The following symbols are undefined:
    1 Assembly Error, No Assembly Warnings
    TBCTL
    CNTL_0
    TBCL0
    TBCL1
    TBSSEL_2
    TBCCTL1"
    I'm writing them as they appear on the user's guide. And it's almost the same as the ones you need for timer A.
    Do you know if I need to initialize any other registers, different from timer A? Or what could be the problem.

    Thanks, Diego.
  • >TimerA is used by the hardware UART

    In what way?
    G2553 have hardware uart and don't need some timers do to software uart.

    And it does not have timerB it have two timerA, 0 and 1

    TA1CTL = TACLR;
    TA1CCR0 = TA1second/8;                         // Set Timer to 8Hz
    TA1CTL = TASSEL_1 + MC_2 + ID_2 + TAIE;  // ACLK source, Continous up, input divider /4, rollover irq

  • Diego Vallejo said:
    I'm writing them as they appear on the user's guide.

    The User's Guide you refer is probably for the entire MSP430F2xx Family. It describes all kinds of features that family members may have. A particular member of that family may not have all the features describe there. In your case, the member MSP430G2553 does not have Timer-B and hence the problem you encounter. You need to check the data-sheet of MSP430G2553 to find out if it has Timer-B or not.

  • Hi John!

    Maybe this post also helps:

    Dennis

**Attention** This is a public forum