OSCERCLK as LPTMR0 Source on FRDM-KW41Z

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OSCERCLK as LPTMR0 Source on FRDM-KW41Z

748 Views
aaronledger
Contributor I

Using the 1.0.2 connectivity software release with FRDM-KW41Z, I am attempting to utilize the OSCERCLK as the source for LPTMR0 using the lptmr driver example provided in the connectivity software in the path MKW41Z_ConnSw_1.0.2/boards/frdmkw41z/driver_examples/lptmr. I can successfully run the driver examples with all clock sources except OSCERCLK by changing lptmrConfig.prescalerClockSource before calling the LPTMR_Init. The reference manual states that OSCERCLK is a valid source, however, when choosing the source by setting lptmrConfig.prescalerClockSource = kLPTMR_PrescalerClock_3, the interrupt in the example code never occurs. Any idea what is causing this clock source not to work properly in the example?

 

For reference, attached is the full lptmr.c code with modification for OSCERCLK source for the LPTMR0_PSR[PCS] bits.

Original Attachment has been moved to: lptmr.c.zip

Labels (1)
Tags (2)
0 Kudos
1 Reply

455 Views
chris_brown
NXP Employee
NXP Employee

Hi aaronledger‌,

To use the RF oscillator (LPTMR clock source #3), you need to enable this in the radio block.  Specifically you can add these lines of code.  

SIM->SCGC5 |= SIM_SCGC5_PHYDIG_MASK;
XCVR_MISC->XCVR_CTRL |= XCVR_CTRL_XCVR_CTRL_SOC_RF_OSC_CLK_GATE_EN_MASK;

Regards,

Chris