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

uart on NRF51822

Hello,

I have an development kit NRF51 and wrote a code for it which uses uart, ble advertising and ble scan. It works pretty well on the kit.

The problem is when I try to put the same code on a custom board with an NRF51822. I have already worked with other code for this custom board like ble_app_beacon and it worked fine, but with this code I'm working I got many problems. It doesn't work at all and on the custom board and if I comment all uart things it seems to run very very slow.

So I tried to get just the uart to work first using the code bellow but it doesn't work, it just throws garbage at the terminal. It doesn't work with the custom board but with the development kit it works perfectly.

I'm using SDK 10, S130, gcc and eclipse. My board has a crystal of 16MHz.

Does anyone knows what is the problem?

/**
 * @brief Function for application main entry.
 */
 
int main(void)
{

    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, NULL);
    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
    uart_init();
    app_uart_putstring((uint8_t *)"\n\r12345 Test!");

    // Enter main loop.
    for (;; )
    {
    	power_manage();
    }
}
Parents
  • Hi, I have just the 16MHz crystal on my board. I did as you said and changed the NRF_CLOCK_LFCLKSRC_XTAL_20_PPM to NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION and also to NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION. But it's still not working.

    I did other test and put an NRF51422 on a custom board, the same kind of board and peripherals of the one I tested with the NRF51822 chip, and it worked.

Reply
  • Hi, I have just the 16MHz crystal on my board. I did as you said and changed the NRF_CLOCK_LFCLKSRC_XTAL_20_PPM to NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION and also to NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION. But it's still not working.

    I did other test and put an NRF51422 on a custom board, the same kind of board and peripherals of the one I tested with the NRF51822 chip, and it worked.

Children
No Data
Related