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
  • Well yes, the frequency will shift, because of the probe capacitance, but waveform should have been visible.

    I will continue actively debugging the clock. I added lines to code, but program halts, meaning that it is stuck in a while loop:

    // Start the external high frequency crystal
    NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_HFCLKSTART = 1;

    nrf_clock_lf_actv_src_get();
    // Wait for the external oscillator to start up
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);

    Isn't it needed to set the clock frequency e.g. 32MHz or 16MHz somewhere?

Children
Related