Hi,
I want to configure Timer1 (32 bit ) to run up to 1 sec and then reset. I want this to be done continuously with the help of Short but without using the event handler.
void msecTimer_init(void) { uint32_t err_code = NRF_SUCCESS; uint32_t time_ms = 1000; uint32_t time_ticks = 0; // configure Timer nrf_drv_timer_config_t timer_cfg = {//NRF_DRV_TIMER_DEFAULT_CONFIG; // configure timer instance with default settings} .frequency = NRF_TIMER_FREQ_16MHz, .bit_width = NRF_TIMER_BIT_WIDTH_32, .mode = NRF_TIMER_MODE_TIMER, .interrupt_priority = 2, }; // initialize timer with settings err_code = nrf_drv_timer_init(&msecTimer, &timer_cfg, msecTimer_handler); APP_ERROR_CHECK(err_code); time_ticks = nrf_drv_timer_ms_to_ticks(&msecTimer, time_ms); // convert ms to ticks nrf_drv_timer_extended_compare(&msecTimer, NRF_TIMER_CC_CHANNEL0, time_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false); // With this I dont enter intr handler }
but Timer1 does not reset at 1000msec (16M ticks) and keeps increasing until it reaches 0xFF FF FF FF
What am I doing wrong here?
Are shorts only used in conjunction with event handlers?