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.

motor control and pwm MSP430F2012

Other Parts Discussed in Thread: MSP430F2012

Hi Friends,
I have a small question and the case is as below.

I have MSP430F2012 with EZ430-T2012 Board

I have 2 motors connected through a motor driver which accepts pwm/dir input.

I have a joystick with 2 analog outputs.

and my progress so far.

- I am using grace to config
-I can read the ADC for the joystick values and processed them for pwm values and direction for gpio.
-TimerA has 2 channels I have selected P1.5(TA0), P1.6(TA1) for outputs
- in grace i have set both block 0 and 1 in PWM mode.

what I need to know

In the grace i see duty cycle for only block 1 and not for block 0

how do I Config the PWM for the motors from these 2 channels ?

  • Sudarshan A said:
    In the grace i see duty cycle for only block 1 and not for block 0

    CCR0 (or block 0) is used to set the PWM duty cycle for all other blocks, if it shall differ from a full timer cycle.

    In UP mode, the timer counts from 0 to CCR0 value, then rolls over to 0 again. So CCR0 defines the cycle time for all other blocks, but cannot generate a PWM by itself (other than a 50% DC signal of half the frequency, or a single clock pulse for syncing to the cycle start).

    In CONT mode, CCR0 and CCR1 can both generate a PWM output with variable DC, but then the cycle time is fixed to one full timer cycle of 65536 ticks. (so CCR0=32767 means 50% DC).

    Having only CCR0 and CCR1, the timer of the F2013 is rather limited use for PWM applications. Other MSPs have timers with up to 7 CCR units.

**Attention** This is a public forum