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

nRF52840 output the 32.768kHz clock on any GPIO in SPI Communication.

Dear Nordic Developer Zone,

I am working on MAX30003 ECG (https://datasheets.maximintegrated.com/en/ds/MAX30003.pdf)  with Nrf52840-DK. My sensor is work on the 32.768kHz external clock. 

but in Nrf I don't know which GPIO_PIN is assigned for that.

I visited below link but I unable to find solutions: 

https://devzone.nordicsemi.com/f/nordic-q-a/23474/nrf52832-fclk-pin/92210#92210

https://devzone.nordicsemi.com/f/nordic-q-a/15996/can-the-nrf52-output-the-32-768khz-clock-on-a-gpio

I am referring (SDK15.2 -PCA10056-spi code)

I have some questions about that:

1) Can I do the merging of timer and gpiote example code into SPI?

2) please give me detail about how to generate 32.768kHz clock ?

I have stuck  on below issue, 

https://maximsupport.microsoftcrmportals.com/en-us/knowledgebase/article/000096610

Thanks,

Rohit Patil

Parents Reply Children
  • Hi,

    Thanks for the suggestion,

    I am stuck in max30003 and nrf52840 because of I unable to read ECG_FIFO register value. it's showing zero.

    (I try to  read INFO Register and other read register then  I got  default result as per max30003 datasheet ,surely my driver is working properly)

    I discussed this issue  on MAXIM Forum.

    maximsupport.microsoftcrmportals.com/.../000096610

    As per his suggestion,  if I  check crystal oscillator of max30003 working or not ?, But it's working.

    I got 32.768khz frequency on fclk pin of max30003.

    Let me know,

    1) is it any configuration required from nrf52840 side?

    I am generating 16khz frequency on gpio pin using RTC example,

    2) is it possible to generate 32.768khz using RTC? How to generate?

    Kindly help me,

    Thanks,

    Rohit

  • if you are getting 32k on max30003 pin, why do you have to generate one?

    from where you are getting that 32k clock?

    max 30003 can't generate 32k clock by itself. i think your board have a 32k oscillator which is giving the clock?

    some pictures of the board will be helpful

    your spi might be working properly, but is your configurations for max30003 is correct ?

  • You can't output a 32.768 clock on a GPIO. What you can do is share an external 32.768kHz clock with both the MAX30003 and the nRF52840 by setting the BYPASS and EXTERNAL bits in the LFCLKSRC register. 

    "I am generating 16khz frequency on gpio pin using RTC example" this is clearly the reason why you cannot read the FIFO:  maximsupport.microsoftcrmportals.com/.../000096610

  • Hi ,

    what is the default value for LFCLKSRC reg, i am using an external crystal but i have never changed or written to the register.

    i have just tried to give the clock from another rc oscillator without writing to the register and it is working.

    Is there any drawbacks in not specifying the clock source through this reg?

  • Defalt value is 0x00. The prod specs register descriptions like the LFCLKSRC describes the reset value of each register if applicable. 

    Without writing to the LFCLKSRC you will use the internal 32.768kHz RCOSC, the external clock inputs are disconnected (high impedance). 

    When using an external crystal the voltage of the crystals drive signals are too low to control a digital circuit, the clock signal is therefore amplified by the internal LF Clock peripheral and fed back into the crystal in order to achieve resonance at a higher voltage level. The time it takes to achieve a stable clock signal of high enough voltage is what accounts for the start-up time of a crystal oscillator clock source. 

    You can however use an external clock signal that already has the required voltage level, but then you must bypass the internal amplifier. 

Related