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
  • " But if I merge this code into my Ble_app_uart I am not getting the frequency. "

    I need more information on this issue.

  • I need more information on this issue.

    OK;

    I am working on one sensor which is required 32KHz clock frequency. so I generated 32KHz frequency on one of NRF GPIO Pin using GPIOTE example. 

    But I have to merge this code into Ble_app_uart, because of my plan to take sensor data using Bluetooth, so if I merge GPIOTE code (Which is already generated 32.0KHz Frequency) into BLE_APP_UART (SDK15.2.0- PCA10056-S140).

     But when I merge it with my working ble_app_uart code then GPIOTE stop working. it can't show 32.0KHz frequency, so please help me with these issues.

    please check my below code.

    Ble_App_Uart + GPIOTE

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*Working ECG And RR Interval Code with Bluetooth and Pushing data on Server and Generating Interrupt (Timer) */
    #include <stdint.h>
    #include <string.h>
    #include "nordic_common.h"
    #include "nrf.h"
    #include "ble_hci.h"
    #include "ble_advdata.h"
    #include "ble_advertising.h"
    #include "ble_conn_params.h"
    #include "nrf_sdh.h"
    #include "nrf_sdh_soc.h"
    #include "nrf_sdh_ble.h"
    #include "nrf_ble_gatt.h"
    #include "nrf_ble_qwr.h"
    #include "app_timer.h"
    #include "ble_nus.h"
    #include "app_uart.h"
    #include "app_util_platform.h"
    #include "bsp_btn_ble.h"
    #include "nrf_pwr_mgmt.h"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    GPIOTE- 32.0KHz

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #include <stdbool.h>
    #include <stdint.h>
    #include "nrf.h"
    #include "nrf_gpiote.h"
    #include "nrf_gpio.h"
    #include "boards.h"
    #include "nrf_drv_ppi.h"
    #include "nrf_drv_timer.h"
    #include "nrf_drv_gpiote.h"
    #include "app_error.h"
    #ifdef BSP_LED_0
    #define GPIO_OUTPUT_PIN_NUMBER BSP_LED_0 /**< Pin number for output. */
    #endif
    #ifndef GPIO_OUTPUT_PIN_NUMBER
    #error "Please indicate output pin"
    #endif
    static nrf_drv_timer_t timer = NRF_DRV_TIMER_INSTANCE(0);
    void timer_dummy_handler(nrf_timer_event_t event_type, void * p_context){}
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • static nrf_drv_timer_t timer = NRF_DRV_TIMER_INSTANCE(0); 

    TIMER0 is used by the SoftDevice, you need to use TIMER1 or above.

    See System On Chip Requirements: Hardware peripherals, from S132 spec.