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

My NRF52811 Custome board not working as my application.

Hello,

1) I am using the PCA10040 to program a nrf52811 chip on a custom board with SDK 15.3.0.

2) I'm using the example ble_app_uart_pca10040_s112 on uKeilV5

3) Initially i tried to flash Softdevice and application using nRFgo Studio,

but when i connect my board with PCA10040's P20 connector, and nRFgo studio showing "recover" and "enable reset pin" boxes.

4) Then I am following the steps in Infocenter

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fgetting_started_installing.html

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fgetting_started_installing.html



for flashing SD and application code and it showing below attached text of JLInk segger.



ISSUE:-
-------

1) As per "ble_app_uart_pca10040_s112" code LED_4(P0.20) should blink with delay of 1second but it is not working lke that but some extra port0 pins are showing high.

2) Actually my aim is to use custom board (NRF52811 SoC) for advertising ble and use mobile bluetooth app for communicating it(custom board)

for my application which softdevice should i use? S112 or S140 for NRF52811?

3) I read some where S112 won't support Codec PHY?

So please can anyone help me to come out of this problem.

Thank you in advance,

Rgds,
amarr

Parents Reply Children
  • HI,

    Yes, you can use the PCA10040 debug out to program your target board given VDD = 3.0V.

    YOu can use the Segger Embedded studio instead of KEIL for running the example.

  • Hi jimmy,

    Sorry for late replay. Present i am using PCA10040 Board for developing my application.

    As per my application i want to use Four ADC Channels (AIN0-AIN3) in NRF52832 From Four channels

    Two channels(AIN0 &AIN1) for reading two external batteries voltages and reamining two(AIN2 and AIN3)

    for reading external peripheral voltages.  From four ADC

    channels i  configured one ADC for for reading one external peripheral voltage like below attached source

    code.

    I think NRF52832 using one Buffer for serving to all four adc channels. am i right or wrong?

    But my aim is to use multiple ADCs  channels, How can i approch to do this? please suggest me.

    void saadc_init(void)
    {
        ret_code_t err_code;
    
        nrf_saadc_channel_config_t channel_config =
        NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);  //0.6v for vdd
    	  
    	
        channel_config.reference = NRF_SAADC_REFERENCE_VDD4; 
    	
        err_code = nrf_drv_saadc_init(NULL, saadc_event_handler);  //This is the function call for ADC Default configuration
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_drv_saadc_channel_init(0, &channel_config);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[0],SAMPLES_IN_BUFFER);
        APP_ERROR_CHECK(err_code);
    
    	   
    	
        err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1],SAMPLES_IN_BUFFER);
        APP_ERROR_CHECK(err_code);
    		
    		
    }
    
    void saadc_event_handler(nrf_drv_saadc_evt_t const * p_event)
    {
       if (p_event->type == NRF_DRV_SAADC_EVT_DONE)
       {
          ret_code_t err_code;
    		 
    		 
    		    err_code = nrf_drv_saadc_buffer_convert(p_event->data.done.p_buffer, SAMPLES_IN_BUFFER);
            APP_ERROR_CHECK(err_code);
    
            int i;
            
    
            for (i = 0; i < SAMPLES_IN_BUFFER; i++)
            {
    	    	int neg_buffer = p_event->data.done.p_buffer[i];
    					
    			if(neg_buffer < 0)
    			{
    				neg_buffer = 0;
    				printf("ADC Value = %d \r\n", neg_buffer); //amarr
    				p_event->data.done.p_buffer[i] = 0;
    			}
    			else
    			{		   	
    				printf("ADC Value = %d \r\n", p_event->data.done.p_buffer[i]); //amarr
    			}
            }
            m_adc_evt_counter++;
    	 }	 
    	 else
    	 {
    	   printf("saadc_event_handler else condition: %d \n", p_event->type); 
    	 }
    }
    
    void timer_handler(nrf_timer_event_t event_type, void * p_context)
    {
    
    }
    
    
    void saadc_sampling_event_init(void)
    {
        ret_code_t err_code;
        err_code = nrf_drv_ppi_init();
        APP_ERROR_CHECK(err_code);
    	
    	  nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    	  timer_cfg.bit_width = NRF_TIMER_BIT_WIDTH_32;
    	
    	  err_code = nrf_drv_timer_init(&m_timer, &timer_cfg, timer_handler);
    	  APP_ERROR_CHECK(err_code);
    		
    	 /* setup m_timer for compare event every 400ms */
        uint32_t ticks = nrf_drv_timer_ms_to_ticks(&m_timer, 400);
    	  	
    		 nrf_drv_timer_extended_compare(&m_timer,
                                       NRF_TIMER_CC_CHANNEL0,
                                       ticks,
                                       NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
                                       false);
        nrf_drv_timer_enable(&m_timer);
    
        uint32_t timer_compare_event_addr = nrf_drv_timer_compare_event_address_get(&m_timer,
                                                                                    NRF_TIMER_CC_CHANNEL0);
        uint32_t saadc_sample_task_addr   = nrf_drv_saadc_sample_task_get();
    
        /* setup ppi channel so that timer compare event is triggering sample task in SAADC */
        err_code = nrf_drv_ppi_channel_alloc(&m_ppi_channel);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_drv_ppi_channel_assign(m_ppi_channel,
                                              timer_compare_event_addr,
                                              saadc_sample_task_addr);
        APP_ERROR_CHECK(err_code);
    }
    
    
    void saadc_sampling_event_enable(void)
    {
        ret_code_t err_code = nrf_drv_ppi_channel_enable(m_ppi_channel);
    
        APP_ERROR_CHECK(err_code);
    }
    
    
    
    
    
    int main(void)
    {
       
        uart_init();
        
        timers_init();
        buttons_leds_init(&erase_bonds);
        power_management_init();
        ble_stack_init();
        gap_params_init();
        gatt_init();
        services_init();
        advertising_init();
        conn_params_init();
    	  
    	  
    	  
        // Start execution.
        advertising_start();
    
        saadc_init();  
    	saadc_sampling_event_init(); 
        saadc_sampling_event_enable(); 
    			
    	  nrf_delay_ms(3000);
    		
        // Enter main loop.
    while(1)
    {
    	
    }
    
    

    Thank you,

Related