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

Timer as counter - no Compare Event

With this code i am not able to generate an event. timer1 is used as counter. the timer is running about the compare value of 3 (TLC_Send_Buffer_Size):

static const nrf_drv_timer_t tlc_timer = NRF_DRV_TIMER_INSTANCE(1);

nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;

timer_cfg.mode = NRF_TIMER_MODE_COUNTER;
err_code = nrf_drv_timer_init(&tlc_timer, &timer_cfg, timer_led_event_handler);
APP_ERROR_CHECK(err_code);

nrf_drv_timer_extended_compare(&tlc_timer, NRF_TIMER_CC_CHANNEL0, (uint32_t)TLC_Send_Buffer_Size, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false);

nrf_drv_timer_enable(&tlc_timer);
Related