How to Configure 32.768 kHz Clock for MAX30001 with nRF52840 in Zephyr?

I have designed a PCB using the nRF52840 microcontroller and the MAX30001g ECG sensor. The sensor requires a 32.768 kHz clock signal via its FCLK pin, as shown in the attached schematic.

Here is what I have done so far:

  • Connected a 32.768 kHz crystal oscillator to the nRF52840, as seen in the diagram.
  • Configured relevant pins for the sensor.

Here is my prj.conf file:

CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_CBPRINTF_FP_SUPPORT=y

CONFIG_SPI=y
CONFIG_SENSOR=y

# #debugging
# CONFIG_CORTEX_M_DEBUG_MONITOR_HOOK=y
# CONFIG_SEGGER_DEBUGMON=y

#mention this if you want to program in external board
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
# CONFIG_CLOCK_CONTROL_NRF_K32SRC_50PPM=y
# CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n #at_configuration
#or
# CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y
#or
# CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
#or
# CONFIG_BOARD_ENABLE_DCDC=n

Despite these configurations, the sensor does not seem to be receiving the required clock signal. I also reviewed the MAX30001g datasheet, which specifies the need for this clock input.

Questions:

  1. What additional configurations are needed in the prj.conf file to enable the 32.768 kHz clock output on the required pin?
  2. How can I verify that the nRF52840 is generating the clock signal correctly?

Any guidance would be greatly appreciated!

Attachments:



Parents
  • XL2 is actually the output (excitation) pin for the 32.768kHz crystal oscillator on the nRF52840, so I would argue that you should use XL2 to drive FCLK, not XL1. Note that FCLK has an input capacitance of 10pF, so the XL2 load capacitor C2 requires reducing or removing to avoid pulling the crystal frequency off center. The voltage swing on XL2 might be marginal, but I think it works and the input current of FCLK is very low which minimises loading. Trace from XL2 to FCLK should be as short as possible to reduce interference and distributed capacitance loading.

  • Thank you for your detailed input! You are correct that the nRF52840 does not directly generate a 32.768kHz signal but rather uses the external crystal oscillator connected to the XL1 and XL2 pins. I ensured the external LFXO was configured and running in the nRF52840 firmware, and I verified the crystal oscillation using an oscilloscope on the XL2 pin.

    However, after further investigation, I realized the issue was due to the MAX30001 not being able to utilize the frequency signal from the nRF52840's FCLK pin as expected. It seems the signal characteristics (e.g., voltage levels or stability) weren't suitable for driving the MAX30001.

    To resolve this, I connected a dedicated external 32.768kHz oscillator directly to the FCLK pin of the MAX30001, bypassing the nRF52840 entirely. This setup worked perfectly, and the MAX30001 now operates as intended.

    Thank you again for your insights—they were instrumental in validating the root cause and guiding me toward the solution!

    Best regards,
    Manoj

  • We're happy to hear you came to a solution, Manoj.

    Closing the case.

    Best regards,
    Mathias

Reply Children
No Data
Related