Hi,
I am trying to generate a PWM signal by using the Timer3, I took the following code from buzzer.c and edited accordingly
IRCTL &= ~0x01; PERCFG &= 0xDF; // Timer 3 Alternate location 2 P1DIR |= 0x08; // P1_3 = output P1SEL |= 0x08; // Peripheral function on P1_3 T3CTL &= ~0x10; // Stop timer 3 (if it was running) T3CTL |= 0x04; // Clear timer 3 T3CTL &= ~0x08; // Disable Timer 3 overflow interrupts T3CTL &= ~0x03; // Free run T3CCTL0 &= ~0x40; // Disable channel 0 interrupts T3CCTL0 |= 0x04; // Ch0 mode = compare T3CCTL0 |= 0x30; // Ch0 output Set output on compare, clear on 0 //T3CTL |= prescaler; T3CC0 = 0x02; T3CTL |= 0x10;
However I am receiving the following output
It is alternating when it suppose to be one
I thought it is the IR control, therefore I added the following IRCTL &= ~0x01 , however the output is the same.
What can be the problem?
Thank you for your help.
Regards
Robert.