Hello,
i am using the MSP430G2452, i have it in the Launch Pad and am trying to use it to produce two PWM signals that are comliments of eachother with some dead-time between transitions. The chip has one Timer0_A3 and 3 CC registers so its should be able to do it.
i have looked in the family user guide and want to do something like the picutre below (pg.364 of the MSP430x2xx family user guide)
IThis is my code
#include <msp430g2452.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1DIR |= 0x06; // P1.2 and P1.1 to output
P1SEL |= 0x06;
CCR0 = 1000; //PWM Period - Freq = (SMCLK freq)/(CCR0 value)
//eg,SMCLK = 1MHZ so 1MHZ/1000 = 1Khz is the PWM Freq
CCTL1 = OUTMOD_6; //CCR1 toggle/set
CCTL2 = OUTMOD_2; //CCR2 toggle/reset
CCR1 = 250; //CCR1 PWM duty cycle
CCR2 = 50; //Dead time = CCR1 - CCR2 = 250 - 50 = 200
TACTL = TASSEL_2 + MC_3; // TACTL = timer_A ctrl, TASSEL_2 = SMCLK, MC_3 = up/down mode
_BIS_SR(LPM0_bits); // Enter LPM0
}
I can see the PWM on P1.2 but not on P1.1, obviously there is something wrong with my code, i was wondering if anyone could help me. I have looked at alot of the PWM dead-time related forum topics
http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/p/19031/73691.aspx#73691
http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/p/56142/205122.aspx#205122
http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/p/104860/369006.aspx#369006
http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/p/116416/413109.aspx#413109
But can't really seem to get it working
Thanks in advance
Michael Dalton