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.

MSP 430 Timer

Hi everyone,

Here' s just one simple question:

How can i get the exact value of Timer A?

What' s code for that ><

(For example: I need to take action when the Timer_A goes to value 500, how can i code?

Here's my code:  if (TA0R >500) { ....something i am gonna do ), what's wrong in that ><
Since i am just the beginner, please do help me~~

I need to produce 2 PWM Wave form which one of the form shift 180 phase from the other ~~~ by using MSP430 G2553 ) ><

Sincerely thank you.

Please help me 

  • Mark Huang said:
    I need to produce 2 PWM Wave form which one of the form shift 180 phase from the other ~~~ by using MSP430 G2553 ) ><


    The best way to produce, anti phase PWM signals is to take advantage of PWM generator available in MSP430.

    1. Select the I/O where you want the signal make sure that they are the pins mux with TAO Outputs. (like P3.5/TA0.1 and P3.0/TA0.2 in msp430g2x33) set set-reset mode of times.

    2. TA1CCR0  = PWM period

    3. TA1CCR1  = Duty cycle needed for PWM phase

    4. TA1CCR2  = Duty cycle needed for PWM anti phase

    			// PWM Period = VOLUME_TOP/SMCLK
    			TA0CCR0 = VOLUME_TOP-1;
    
    			// PWM duty cycle = Volumes[ VolumeIdx ]
    			TA0CCR1 = Volumes[ VolumeIdx ];
    			TA0CCR2 = Volumes[ VolumeIdx ];
    									   //--           __    __    __    __    __
    			TA0CCTL1 = OUTMOD_7;                               // RESET_SET     |__|  |__|  |__|  |__|
    			TA0CCTL2 = OUTMOD_3;                               //--              __    __    __    __
    									   // SET_RESET   __|  |__|  |__|  |__|  |__

  • Thanks for that, but what i need are two wave forms produced at the same time:

    Firsttttt: |-|___|-|___|-|___|-|_
    Second: __|-|___|-|___|-|___

    each with 25% Duty Cycle
    ><
    Please do help me

  • Having CCR0 as frequency and CCR1 and CCR2 for duty-cycle will give you two signals at the same time.

**Attention** This is a public forum