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

facing issues in timer

hi..... i am using nrf52832 , merged the uart and  timer example program . while i am debugging , debugged successfully , but timer is not working

actually i set the timer for one minute after completing the one minute it should send the data .  i am getting the data very quickly in this case i couldn't  found any timer 

Parents
  • is it possible you can post your code / setup or pieces of your code?

  • static void create_timers()
    {  
       uint32_t err_code;
    
        // Create timers
    
        err_code = app_timer_create(&m_led_a_timer_id,
                                    APP_TIMER_MODE_REPEATED,
                                   timer_sensor_event_handler);
      APP_ERROR_CHECK(err_code);
    }
    
    static timer_start(void)
    {
       uint32_t err_code;
        //uint32_t APP_TIMER_TICKS(50000);
       
           
        // Start application timers
        err_code = app_timer_start(m_led_a_timer_id, APP_TIMER_TICKS(50000), NULL);
        APP_ERROR_CHECK(err_code);
         NRF_LOG_INFO("SUCCESS1");          
    
    }
    
    
    
    /**@brief Application main function.
     */
    int main(void)
      {
        bool erase_bonds;
    
        // Initialize.
       
      
       
       
        uart_init();
        log_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();
    
    app_timer_init();
         create_timers();
        
        // Start execution.
        printf("\r\nUART started.\r\n");
        NRF_LOG_INFO("Debug logging for UART over RTT started.");
        advertising_start();
       timer_start();
       
         twi_init();
         MAX30_set_mode();
         
    
        
       while (true)
        {
            nrf_delay_ms(6000);
      uint32_t err_code;
           while (m_xfer_done == false);
    
             m_xfer_done = false;
                    
    		uint8_t reg[2] = {0x00U};
            err_code = nrf_drv_twi_tx(&m_twi,LM75B_ADDR, reg, sizeof(reg), true);
    		APP_ERROR_CHECK(err_code);
    		while (m_xfer_done == false);
    		nrf_delay_ms(5);
    		
    	        m_xfer_done = false;
    		ret_code_t err_code1 = nrf_drv_twi_rx(&m_twi,LM75B_ADDR, &m_sample, sizeof(m_sample));
    		APP_ERROR_CHECK(err_code1);
                    NRF_LOG_INFO("%d", m_sample);
                     
     
    }
                  for (;;)
        {
            idle_state_handle();
        }
    
          
          }
             
       

Reply Children
No Data
Related