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

Timer 2 doesn't tick in S130

I'm trying to use a timer with S130, but it doesn't seem to tick:

void timer_event_handler(nrf_timer_event_t event_type, void * p_context) {
	NRF_LOG_INFO("Timer 1 interrupt\r\n");
}

const nrf_drv_timer_t timer2 = NRF_DRV_TIMER_INSTANCE(2);
nrf_ppi_channel_t ppi_channel1;
static void timers_init() {
	nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
	timer_cfg.mode = NRF_TIMER_MODE_TIMER;
	timer_cfg.frequency = NRF_TIMER_FREQ_125kHz;
	NRF_LOG_INFO("Timer init\r\n");
	APP_ERROR_CHECK(nrf_drv_timer_init(&timer2, &timer_cfg, timer_event_handler));
	nrf_drv_timer_extended_compare(&timer2, NRF_TIMER_CC_CHANNEL0, 1250, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);

	nrf_drv_timer_enable(&timer2);
}

I'm running the timers_init() routine after the ble stack etc. has started. But the eventhandler never get's triggered. Am I missing something here?

Parents Reply Children
No Data
Related