This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to output 32768Hz external crystal LFCLK at a GPIO pin?

For synchronizing an external sensor i need to output a 32768Hz clock at a GPIO pin. For this case i want to use LFCLK from the external cyrstal.

My setup: I use RTC0 to generate a tick event with prescaler set to "0". The tick event is connected to PPI Event End Point EEP, the PPI Task End Point TEP is connected to a GPIOTE Task Out which toggles the GPIO pin polarity.

This setup works for me except in one point. The output clock is 16384Hz and not 32768Hz as desired.

Due to the tick event occurs only on the rising edge on LFLCLK and so the pin toggles only at one edge and not at both edges of LFCLK the clock out is only half of LFCLK. (as seen in the attached picture)

My question: Is there a way to get LFCLK as clock output at a GPIO pin with 32768Hz? Preferred is a hardware only solution. I want to use the 32768Hz crystal due to better accuracy and lower power.

2014-01-10_172045.png

Parents
  • XL1 and XL2 pins are designed to connect an external crystal which is the case in my hardware (nRF51822 EK atm). I think this pins should not be touched when there is a external crystal connected to not affect the internal oscillator loop.

    Otherwise my sensor needs a square wave clock signal.

    This is the first time i'm using an ARM, but i know from other MCU they could easily output the CPU system clock and/or RTC clock signal at a pin, which is very useful.

Reply
  • XL1 and XL2 pins are designed to connect an external crystal which is the case in my hardware (nRF51822 EK atm). I think this pins should not be touched when there is a external crystal connected to not affect the internal oscillator loop.

    Otherwise my sensor needs a square wave clock signal.

    This is the first time i'm using an ARM, but i know from other MCU they could easily output the CPU system clock and/or RTC clock signal at a pin, which is very useful.

Children
No Data
Related