Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Hi, i'm trying to start a pwm signal and stop it after 50 miliseconds. But i can't because i can't use timer interrupt vector properly. my count never increments. Here is my code #include <msp430.h> #include <msp430g2553.h> void startPWM(void); unsigned char counter=0; void stopPWM(void); int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer BCSCTL1 = CALBC1_1MHZ; // Set range DCOCTL = CALDCO_1MHZ; CCTL0 = CCIE; P2DIR |= BIT2; //IR transmitter P2SEL |= BIT2;// Select pwm pin (transmitter) P2OUT=0x00; while(1){ if((P1IN & BIT4)!=BIT4) //button
  2. Hello, sorry for my bad english. i want produce PWM signal in 38khz. (my reciever is tsop1838 and transmitter is TSAL6200). Firstly, leds on the reciever side are blink. But a few seconds later, they turn off. What's the problem? My codes: //Transmitter #include <msp430.h> int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop the Watch dog timer while(1) { P1DIR |= 0x0C; // P1.2 and P1.3 output P1SEL |= 0x0C; // P1.2 and P1.3 TA1/2 options CCR0 = 12; // PWM Period/2 CCTL1 = OUTMOD_6; // CCR1 toggle/set CCR1 = 6; // CCR1 PWM duty cycle TACTL
  • Create New...