Tool/software: TI C/C++ Compiler
please help me to generate PWM signal where I can change my duty cycle or on-off period with switching frequency. I had done some coding but in that, I am getting some random frequency and not what I want.
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.
Tool/software: TI C/C++ Compiler
please help me to generate PWM signal where I can change my duty cycle or on-off period with switching frequency. I had done some coding but in that, I am getting some random frequency and not what I want.
Hi,
to generate a PWM on your MSP430G2231 device you can use the integrated Timer A and set the desired frequency and duty cycle by adjusting the CCRx and CCR0 registers.
In general the TACCR0 register defines the period, the TACCRx register defines the duty cycle. Please check the Timer_A register settings in the MSP430x2xx User's Guide Timer_A section for more details.
To get started you can take a look at the Code examples provided in the MSP430G2231 Software Section. You find some PWM examples for the device that you can test.
In case this doesn't help you solve your issues, please add some more details on your current code.
Best regards,
Britta
**Attention** This is a public forum