This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can I to use nRF52 as external crystal oscillator?

Hi,

I am using AFE4403 and  Nrf52840, I want to assign a pin as output oscillator 4M  using a nrf52 internal oscillator, 

how to do that?

I am beginner , is my first time using this and also to trying communicate in English haha

  • Hi,

    You can make a GPIO output pin toggle with a frequency of 4 MHz, that is no problem. Note that you should enable the HFXO to get a decent accuracy (so using the 32 MHz crystal as reference, not the internal RC oscillator). This must be done using a TIMER and GPIOTE, connected by PPI. This way the CPU is only needed for configuration. After that, this runs entirely in HW.

    What you need to do here is essentially demonstrated by the GPIOTE Example (if using the nRF5 SDK). In that case, you just need to do the following modifications which mainly changes the prescaler so that the timer runs at 16 MHz, and sets the capture compare register to 2. I also use a different output pin, and start the HFXO to get an accurate reference. See modifications from the SDK 17.1 example here:

    You can also use the same approach with the nRF Connect SDK.

Related