KW36 using 26MHz crystal

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

KW36 using 26MHz crystal

1,621 Views
Shane1
Contributor II

1.We are using 26MHz cryatal instead of 32MHz,and we make the following modification:

1)Modify codes according to the instructions below:

https://community.nxp.com/t5/Wireless-Connectivity-Knowledge/Operating-KW36-with-a-26MHz-XTAL/ta-p/1...

2)Change MCG mode to FBE mode;

const mcg_config_t mcgConfig_BOARD_BootClockRun = 

{

.mcgMode = kMCG_ModeFBE,

.irclkEnableMode = kMCG_IrclkEnable,

.ircs = kMCG_IrcSlow,

.fcrdiv = 0x0U,

.frdiv = 0x5U,

.drs = kMCG_DrsMid,

.dmx32 = kMCG_Dmx32Fine,

.oscsel = kMCG_OscselOsc,

}

CLOCK_SetExternalRefClkConfig(mcgConfig_BOARD_BootClockRUN. oscsel);

CLOCK_SetFbeMode(mcgConfig_BOARD_BootClockRUN.frdiv,

                  mcgConfig_BOARD_BootClockRUN. dmx32,

                  mcgConfig_BOARD_BootClockRUN. drs,

CLOCK_CONFIG_ FllStableDelay);

3)Modify the codes of FlexCan_Config:

void FlexCan_Config(void)

{

flexcan_config_t flexcanConfig;

FLEXCAN_GetDe faultConfig(&flexcanConfig);

flexcanConfig.clksrc=kFLEXCAN_ ClkSrcOsc;

flexcanConfig .baudRate = 125000;

flexcanConfig .enableIndividMask = true; NULL);

flexcanConfig .maxMbNum = 32;

flexcanConfig .timingConfig .phaseSeg1 = 4;

flexcanConfig .timingConfig .phaseSeg2 = 3;

flexcanConfig .timingConfig.propSeg = 2

FLEXCAN_Init (CAN0Channel, &flexcanConfig, CAN_CLK_FREQ);

FLEXCAN_TransferCreateHandle(CAN0Channel, & flexcanHandle, FlexCan_Callback, NULL);

}

 

Is there any code in other places that needs to be modified?

 

2.When KW36 works in FEI mode, after debugging, it enters Deepsleep mode 3 after executing the following codes:

#define cPWR_UsePowerDownMode 1

#define cPWR_DeepSleepMode 3

RSIM->CONTROL = RSIM_CONTROL_MODIFY_FEILD(RSIM_CONTROL_RF_OSC_EN, 0);

the external crystal can be stopped normally.

   When the clock is working in FBE mode as modified above, after performing the same operations, the external crystal is still working, that is, the external crystal is not turned off. How can I turn off the external crystal when entering Deepsleep mode 3 in FBE mode?Is there any code in other places that needs to be modified?

Labels (1)
0 Kudos
Reply
3 Replies

1,556 Views
Shane1
Contributor II

Thanks for you reply.

The CAN function is normal after we modify our code mentioned above.Do we have to use SET_CAN_QUANTUM?Couldn't find it in the FRDM demo code,how can we find it and how to use it?

Besides,could you reply to our other questions?

Thanks!

0 Kudos
Reply

1,504 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @Shane1,

In the following table explains the low power modes and which wake-up sources are enabled:

Alexis_A_0-1639766345581.png

The following explains the behavior of the RF oscillator depending of the mode:

  • RUN:  RF oscillator is on and RX or TX operated
  • IDLE: RF oscillator is on, but no RX or TX operation
  • DSM:  Turned off RF oscillator

Best Regards,

Alexis Andalon

 

1,585 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @Shane1,

The capabilities to calculate the baudrate by the FLEXCAN_Init function are a little limited so I in the flexcan examples from the SDK there's an option to enable the input of registers need it to calculate the baudrate manually. Those are enabled with the define SET_CAN_QUANTUM. I would suggest enable this and calculate the values manually.

Best Regards,
Alexis Andalon

0 Kudos
Reply