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

Can Internal RC be used for BLE comms?

MS76SF2_SCH_V12.pdfHi, I am using SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL); for ble_Stack_init() because the off the shelf board (not from Nordic) goes into a never ending loop when SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL) is used. The external crystal does produce clock signals, but I think the loading capacitors are not right. Anyway, if I use NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, will this RC clock be accurate enough to keep the BLE connection (I am basically using ble_app_uart as base) going? Another question is, will the EMC testing pass with NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM as clock source? Thanks.

Parents
  • Hi RK, you are right. After I used start up code, it worked. This is what I did:

    Step 1: Start HF clock (from Xtal ) manually by doing this: NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; NRF_CLOCK->TASKS_HFCLKSTART = 1;

    	while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
    	{
    	}    
    	//till this manually start HFClk
    

    Step 2: Synthesise the LF clock from the started HF clock by doing this: // Initialize SoftDevice. SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL);

  • I have manually started the external HF clock using the following: NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; NRF_CLOCK->TASKS_HFCLKSTART = 1;

    	while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
    	{
    	}    
    

    At this stage, using the peripherals/system viewer/clock tool in Keil, I am able to see that: EVENTS_HFCLKSTARTED = 1; HFCLKRUN: STATUS=1 : Triggered = Task HFCLKSTART has been triggered; HFCLKSTAT:0x00010001: SRC: 1: Xtal= External 16MHz/32MHz crystal oscillator running and generating the HFCLK. State: 1: Running = HFCLK clock running; XTALFREQ: 0xFFFFFFFF; XTALFREQ = 0xFF (meaning 16MHz clock according to nRF51 reference manual). So, Now, I know that the external 16MHz clock has been started. Also I checked the pin 37 and 38 of the nrf51 and I can see ~16.2MHz clock. BUt, now when I call the following: SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL); The program flow never comes back.. Any ideas as how to debug?

Reply
  • I have manually started the external HF clock using the following: NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; NRF_CLOCK->TASKS_HFCLKSTART = 1;

    	while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
    	{
    	}    
    

    At this stage, using the peripherals/system viewer/clock tool in Keil, I am able to see that: EVENTS_HFCLKSTARTED = 1; HFCLKRUN: STATUS=1 : Triggered = Task HFCLKSTART has been triggered; HFCLKSTAT:0x00010001: SRC: 1: Xtal= External 16MHz/32MHz crystal oscillator running and generating the HFCLK. State: 1: Running = HFCLK clock running; XTALFREQ: 0xFFFFFFFF; XTALFREQ = 0xFF (meaning 16MHz clock according to nRF51 reference manual). So, Now, I know that the external 16MHz clock has been started. Also I checked the pin 37 and 38 of the nrf51 and I can see ~16.2MHz clock. BUt, now when I call the following: SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL); The program flow never comes back.. Any ideas as how to debug?

Children
No Data
Related