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.

one shot mode pwm

Other Parts Discussed in Thread: MSP430G2231

I want to generate like below link one shot mode pwm  with msp430g2231 the pwm is on one port and interrupt is on other i/o port pin . so plz give me the related code sample.

  Thanku ...

   www.ti.com/lit/ug/spruer3a/spruer3a.pdf

  • You can enable an interrupt on the falling edge of your timer and count how often you had a falling edge and when you got the wanted number of pulses you can disable and reset the timer module.

    Don't know if there is a complete code sample available but you should be able to get it after you understood some of the general timer code examples.

  • There is no 'one-shot' operation, The timer is either running (cyclic), or stopped. However, as Bernhard suggested, you can let it trigger an interrupt on the end of a cycle (TACTLs TAIE bit, or TACCTL0s CCIE bit) and disable the timer.
    There are ways to generate a one-shot pulse, e.g. configuring an SPI output with a baudrate so that n '0' bits have the required low-pulse length, but this is more advanced stuff.

**Attention** This is a public forum