Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: Two pwm signal with 180 degree phase shift USING msp430g2553

$
0
0
I have gone through the user's guide of MSP430G2553 . This method is possible when we operate Timer in UP-DOWN Mode, where i can get the dead band also but i have NO clue as how to get this done using timer in UP MODE. Any suggestion is highly appreciable.!! I have written code for the same by using Timer_A1 in up down mode . Since i don't want the dead time stuff, i have used same duty cycle in CCR1 and CCR2. Can you please verify the same if possible as i don't have oscilloscope to check the output now OR can u suggest the alternate method as how to verify the same without oscilloscope at present. My code is given below: void timer_init(void) { P2DIR |= BIT1|BIT4; //set as output pin P2.1/TA1.1(O/P OF CCR1 Register), P2.4/TA1.2(O/P OF CCR2 Register) P2SEL |= BIT1|BIT4; //pin selected for special purpose; here for pwm TA1CTL |= TASSEL_2 + MC_3; //SMCLK and up down mode TA1CCR0 |= 160 ; //pwm frequency 100 khz; DCO = MCLK = SMCLK = 16 Mhz i.e. 16M/160 = 100KHZ TA1CCR1 |= Duty; //VARIABLE Duty cycle TA1CCR2 |= Duty; // VARIBLE Duty Cycle TA1CCTL1 |= OUTMOD_6; // TA1CCR1, toggle/set TA1CCTL2 |= OUTMOD_2; // TA1CCR2, toggle/reset } Pin Diagram of MSP430G2553 : NOTE: I have used TIMER_A1 in UP DOWN MODE and i want the output as shown below. Thank you in advance..!!

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>