KW36 using 26MHz crystal

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

KW36 using 26MHz crystal

1,220件の閲覧回数
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?

ラベル(1)
タグ(4)
0 件の賞賛
3 返答(返信)

1,155件の閲覧回数
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 件の賞賛

1,103件の閲覧回数
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,184件の閲覧回数
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 件の賞賛