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

Clock inaccuracy of nRF52832 custom board

When using uart example on my curstom board, from /examples/peripheral/uart ,at baudrate 9600, bits are read with a little offset - so that starting from 4th bit, it is mistaken with the fallowing bit.

When measuring with logic analyzer, lenght of each bit is 92us, but it should be 104us at this baudrate.

The function nrf_delay_ms(100) gives a delay of 88.67ms.

I have solderd both 32MHz and 32.768KHz crystals on board, but for this example i am pretty sure i am using internal clock.

Any suggestions? Thanks

Parents Reply
  • int main(void)
    {
        /* Configure leds. */
        nrf_gpio_cfg_output(LED_3);
    
        //Initialize HFCLK 
    	uint32_t p_is_running;
        
        (void)sd_clock_hfclk_request();
        do { 
            sd_clock_hfclk_is_running(&p_is_running); 
        }while(p_is_running==0);
    
        while (true)
        {
            nrf_delay_ms(500);
            nrf_gpio_pin_set(LED_3);
            nrf_delay_ms(500);
            nrf_gpio_pin_clear(LED_3);
        }
    }

    I tried this code and it stuck, when using softdevice.

    From infocenter: "parameter p_is_running results in 1 if the external crystal oscillator is running, 0 if not."

    Moreover, return value of "sd_clock_hfclk_is_running" is 0 or "NRF_SUCCESS" if successful.

    I found issue, quite relevant: Case ID: 117750 ,where DC-DC power caps were cold soldered, maybe my case is similar, even though i checked all connections and values of passive components (i am useing internal LDO configuration).

Children
Related