how to use PWM in msp430G2553??

i am learner of VisSim embedded. trying to use PWM , but when i connect square wave block to PWM , it shows error " type mismatch on input 0" how this error would be solved.i am using MSP430G2553 As a target. thanking you..

sorry sir ,there was some

sorry sir ,there was some mistake from me. so now its working,thanks

thanks for your reply. but

thanks for your reply. but sorry to say it showing the same error. same way first i generate code , took values of TA0CCR , convert ed into decimal and used this value for PWM period. but it showing the same error. ""Warning!PWM causes timer TA0 period conflict".

Glad to hear it works now!

Glad to hear it works now!

Did you try the pwm2.vsm

Did you try the pwm2.vsm example I attached below? It works fine for me.

how can i do the same period

how can i do the same period ...please tell me. thanks in advance.

Since TA0 is the only timer

Since TA0 is the only timer on this chip, you need to share it with the PWM and control interrupt generation. To do that the periods must agree. The easiest way is to choose a control rate, generate code, and look at the value VisSim assigns to TA0CCR like so:

  TA0CCR0 = 0x3e80; // Timer Period

Then convert 0x3e80 to decimal (16000), and use that as the PWM period. See attached.

no. but when i connected

no. but when i connected mismatch problem solved,and shows the error"Warning!PWM causes timer TA0 period conflict" sir show me some example so i can do it. thanking you.

Yogesh, You can't use TA0 for

Yogesh, You can't use TA0 for both your main timer interrupt and PWM unless the period is the same in both cases. Attach your diagram so we can see how to fix it.

sir below is my sample

sir below is my sample program.. thanking you.

The PWM block expects a

The PWM block expects a scaled integer (fixed point) 1.16 input. Have you converted the block to 1.16 using the convert block?