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.

CC2541: CC2541: PWM generation problem

Part Number: CC2541

I use cc2541 and BLE Stack 1.5. I start timer 1 in the PWM generation mode with a frequency of 1 MHz. With radio channel activity (advertising or connection event) the frequency is changed from 1 MHz to 32 kHz.

Code:

// M-CLK = P10; TIM1-CH2; Alt.2 - 1.0 MHz
PERCFG |= (1 << 6); // Alt.2 location for Timer 1
P1SEL |= (1 << 0); // P10 - Peripheral function
P1DIR |= (1 << 0); // P10 direction = Output
P2SEL = (P2SEL & ~(1<<4)) | (0x01 << 3); // Port 1 Peripheral Priority Control

T1CC2L = 0x0F;
T1CC2H = 0x00;
T1CC0L = 0x1F;
T1CC0H = 0x00;

T1CCTL2 |= (0x01 << 2); // Compare mode
T1CCTL2 |= (0x03 << 3); // Set by up, clear by 0
T1CCTL2 &= ~(1 << 6); // Disable interrupt request

T1CTL = 0x00;
T1CTL |= (0x00 << 2); // Div. 1
T1CTL |= 0x02; // From 0x0000 to T1CC0

Thanks