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

uart communication problem !!

am using nrf51822 chip communicating with PIC16fl1509 through uart.the PIC will send the temperatire values through uart to nrf51822. i have a doubt ! will the uart communication only works after advertising ??? can i read the values before advertising and store in an array ,later diaplay during advertising ????will the uart reading functions from pic will work before all the basic functions like ble_stack_init();bond_manager_init();gap_params_init();advertising_init();services_init(); application_timers_start(); advertising_start()etc?? am trying to use uartget data before these but its storing zero in the array !! wats is the problem ?? !! pls help !!

Parents
  • here is the snippet of code. without using delay am getting only zeros.if i use delay am getting atleast one byte of data under manufactur field !! . is the problem with nrf51 uart ?? because after pairing am getting the temperature data!!

    initVaribles(); simple_uart_config(RTS_PIN_NUMBER, TX_PIN_NUMBER, CTS_PIN_NUMBER, RX_PIN_NUMBER, HWFC);

    	 {
    
    	NVIC_EnableIRQ(UART0_IRQn);	
               nrf_delay_us(2000000);
        TaskGetDataFromPIC();
              nrf_delay_us(2000000);
         NVIC_DisableIRQ(UART0_IRQn);
    
               }
    //leds_init();
    timers_init();
    gpiote_init();
    buttons_init();
    //data from pic 	
    
    ble_stack_init();
    bond_manager_init();
    gap_params_init();
    
    services_init();
    sensor_sim_init();
    conn_params_init();
    sec_params_init();
    advertising_init();
    
    // Start execution.
    application_timers_start();
    advertising_start();
    
    NVIC_EnableIRQ(UART0_IRQn);	
    //NVIC_DisableIRQ(UART0_IRQn);	
    for (;;)
    {
    		power_manage();
    	  TaskGetDataFromPIC();
    	  TaskAckPic();	
    	
    
    		
    	}	
    
    		
    	}
    
Reply Children
No Data
Related