How to generate oscillator output on X_OUT pin over MKW41Z ?

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

How to generate oscillator output on X_OUT pin over MKW41Z ?

698 Views
avdhutpandya
Contributor I

I am using Thread Router Eligible device application. I want to generate oscillations on X_OUT pin, I have enabled X_OUT_EN pin. And also commented below line in hardwareinit.c file

/* Prevent XTAL_OUT_EN from generating XTAL_OUT request */
//RSIM->RF_OSC_CTRL |= RSIM_RF_OSC_CTRL_RADIO_EXT_OSC_OVRD_EN_MASK; //commented

But I am not able to generate oscillations on X_OUT pin.

Labels (2)
0 Kudos
Reply
1 Reply

538 Views
gerardo_rodriguez
NXP Employee
NXP Employee

Hello avdhut pandya,

The RF_OSC_CTRL register in the RSIM module controls the XTAL_OUT requests. The related fields are RADIO_EXT_OSC_OVRD_ENRADIO_EXT_OSC_OVRDRADIO_EXT_OSC_RF_EN_SEL and are described in the section 44.2.1.1.13 Radio Oscillator Control (RF_OSC_CTRL) of the reference manual.

Additionally, the XTAL_OUT_BUF_EN bit in the ANA_TEST register enables the XTAL_OUT buffer.

Basically you need to enable the external request and assert high the corresponding XTAL_OUT_EN pin.

You can use the following code snippet as reference:

    //*************************XTAL_OUT
    
    // Set pin mux to XTAL_OUT_EN
    PORT_SetPinMux(PORTC, 6, kPORT_MuxAsGpio);
    //PORT_SetPinMux(PORTB, 0, kPORT_MuxAsGpio);

    uint32_t temp;
    temp = RSIM->RF_OSC_CTRL;
    
    // Clear RADIO_EXT_OSC_RF_EN_SEL bit.
    temp &= ~RSIM_RF_OSC_CTRL_RADIO_EXT_OSC_RF_EN_SEL_MASK;
    
    // Set RADIO_EXT_OSC_RF_EN_SEL bit. 0 or 1 for PTB0 or PTC6, respectively.
    temp |= RSIM_RF_OSC_CTRL_RADIO_EXT_OSC_RF_EN_SEL(1);
    
    // Clear RADIO_EXT_OSC_OVRD_EN bit to allow external requests.
    temp &= ~RSIM_RF_OSC_CTRL_RADIO_EXT_OSC_OVRD_EN_MASK;
    
    // Write changes to RF_OSC_CTRL
    RSIM->RF_OSC_CTRL = temp;
    
    // Enable XTAL signal to XTAL_OUT pad.
    RSIM->ANA_TEST |= RSIM_ANA_TEST_BB_XTAL_TEST_MASK;
    
    //*************************XTAL_OUT

Regards,

Gerardo

0 Kudos
Reply