This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Something abnormal with Timer3 (CC2540)

Halo guys!

When I use Timer3 Alt2 on channel 0 to produce PWM, the wave from scope is abnormal for the first 20 or more seconds.

Here is my configuration.

/***************************************************************************/

void pwm_init( void )
{
  IEN1 &= ~BV(3);           // disable Timer3 interrupt
  // use P1_6 as Timer3 channel 0
  PERCFG |= BV(5);       // Timer3 Alt2
  P1DIR |= BV(6);           // set P1_6 direction to output
  P1SEL |= BV(6);           // set P1_6 as peripheral
 
  T3CCTL0 = 0x14;       // disable interrupt
                                     // Toggle output on compare, initial 0
                                     // compare mode
                                     // no capture
 
  T3CTL = 0xE7;         // set prescaler to Tick Frequency/128
                                   // stop Timer3
                                   // disable interrupt
                                   // clear counter
                                   // up/down mode
 
  //T3CCTL0 |= 0x38;      // Initialize output pin  
}

void pwm_start( void )
{
  //T3CTL |= BV(2);       // clear counter
  //T3CCTL0 |= 0x38;      // Initialize output pin
  T3CC0 = 0x7F;
  T3CTL |= BV(4);       // start timer
}

/***************************************************************************/

Here is the beginning 20s' picture from scope.

And here is the normal picuture from scope.