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.

PWM

WHAT IS THE NEED OF PWM GENERATION AND HOW WE GENERATE PWM PULSES USING MSP 430 MICRO CONTROLLER.WHICH MSP 430 IS GOOD FOR PWM GENERATION.

  • Hi chandrika,

    you can use any MSP430 for generating a PWM!

    Have a look at the code examples (http://focus.ti.com/mcu/docs/mcuflashtools.tsp?sectionId=95&tabId=1538&familyId=342); you will find lots of examples there.

    Rgds
    aBUGSworstnightmare

  • chandrika surapaneni said:
    WHAT IS THE NEED OF PWM GENERATION

    Hmm, maybe I'm misunderstanding the question, but well...

    PWM (pulse width modulation) is a simple way of transmitting a quasi-analog (actually a multi-level digital value) through a single digital line. Usually the pulse frequency is fixed (depending on the application) while the ratio of high- and low level is variable and determines the 'value'.

    The two main advantages of PWM are: 1) the signal is distortion-resistant. Since it is a digital signal, it can be easily amplified and reconstructed, which is important in a noisy environment. And 2) it can be easily converted into an analog voltage by using a low-pass filter. THis low-pass filter may be the inductance of a motor where the PWM triggers the power lines of the motor through a transistor, or it may be the eye of someone lookign at an LED that is driven by the PWM signal (depending on the high-to-low ratio, or Duty Cycle, the LED appears brighter or darker).

    chandrika surapaneni said:
    HOW WE GENERATE PWM PULSES USING MSP 430 MICRO CONTROLLER

    There are different ways: interrupt controlled software toggling of port pins, creation of waveforms through the bitstream output of an SPI interface, and more.

    But the usual way to do it is by using the CCR (Capture-Compare-Registers) of the MSP timers. The basics: The timer is set to count up with a certain clock frequency. One CCR (CCR0) is set to a certain maximum tiemr value. When this is reched, the timer will start from 0 again. The other CCRs of a timer can be set to a certain value between 0 and CCR0. When the timer crosses this value, the CCR hardware will set (or clear) the assigned output pin while when the timer is reset to 0 by CCR0, the hardware will clear (or reset) the output pin (using the CCRs set/reset or reset/set mode).

    chandrika surapaneni said:
    WHICH MSP 430 IS GOOD FOR PWM GENERATION.

    All MSPs have timers with CCRs. Some (e.g. the low-cost G series) have only one timer with 2 CCRs, so only 1 PWM is possible. Others have up to 4 independent timer modules, each with up to 7 CCRs (= 6 PWM outputs running at the same frequency but with independent duty cycles). Not all timers of an MSP do have the same number of CCRs.

    The product selector lets you check which devices have how many timers with how many CCRs.

  • Hi,

    Nicely put Jens. Yes the PWM output is  used in many applications for example it may be used to drive a stator motor etc. I had a requisite of generating 2 PWM 180 degree out of phase to drive a stator. And as I was using only a  msp G series I had just a single timer to play with due to which in such situation u need to rely on generating the pulses manually by toggling the 2 output pins by loading the half period duration in a timers or SPI tiimers. 

**Attention** This is a public forum