Hello all,
I am new to the msp430, and am struggling with a current program. I can output a 5ms x 10ms on P1.2 as desired, would like to use an interrupt function to output a specific X number cycles (periods). Also I would like to use a momentary switch to start the software ( for hardware implemenation later on). Can you provide me examples or help me with the provided code.
#include <msp430f2012.h>
#include <msp430.h>
int main(void) //PWM 5ms x 10ms (PWxP) for 1000 cycles
{
WDTCTL = WDTPW + WDTHOLD; //Stop WDT
BCSCTL1 = CALBC1_1MHZ; // Set range
DCOCTL = CALDCO_1MHZ; // SMCLK = DCO = 1MHz
P1DIR |= 0x0C; //Set P1.2 and P1.3 to output direction
P1SEL |= 0x0C; //Declares TA1 a
TACTL= MC_1 + TASSEL_2; //Tells CCR0 to count up with SMCLK
TACCTL1=OUTMOD_7; //Sets Set/Reset Mode with TACCR1
TACCR0=10000-1; //Set CCR0 to 100 Hz (10ms Period)
TACCR1=5000-1; //Sets 50% duty cycle
while(1)
{
}}
Thanks