I'm having a strange issue with the clock frequency on a Sensortag demoboard, hope someone can help me out.
In the original Sensortag code when I initialize the Timer3Ch1 in PWM mode on P1.4 pin I see the frequency changes on the scope:
During transition from sleep the change from 16MHz RCosc to 32MHz crystal osc can be observed: the PWM frequency changes from 62.5kHz to 125kHz. (As I understood, this is correct behaviour during Power mode transitions)
After 400us to 1600us time (varies if device is connected or advertising) it changes back.
Same happens with the SPI clock, it drops from 800kHz to 25kHz and back.
Same effect can be observed whether POWER_SAVING is defined or not and with/without the debugger being connected.
I tried to add a task to monitor and trap when CLKCONCMD or CLKCONSTAT change it's value, it didn't work, they remain 0x80.
(Could it be changed and set back again by other blocking task?)
main()
{
... original code ...
T3CTL = 0x03; // presc=1, running, up-dn mode
T3CCTL1 = 0x24; // up-dn running
T3CC0 = 0x80; // period
T3CC1 = 0x40; // duty
T3CTL |= 0x10; // presc=1, running, up-dn mode
P1SEL |= 0x10; // set bit4 peripheral mode
P2SEL &= 0x03;
P2SEL |= 0x60; // set priority
P1DIR |= 0x10; // set bit4 as output
SLEEPCMD |= 0x80; // OSC32K_CALDIS=1 <-- doesn't make any change
//////////////////////////////////////////////
/* Start OSAL */
osal_start_system(); // No Return from here
}
Could someone please give me some hint what's going on?
Thank you for your effort!