I want to create a 1MHz timer using TIMER2.
I try to start the timer with the following settings, but the device probably hangs.
I also use app_timer, is it a problem to use it at the same time?
What I want to do is read the counter value of the 1MHz timer when the button is interrupted.
NRF_TIMER1->TASKS_STOP = 1;
NRF_TIMER2->MODE = TIMER_MODE_MODE_Timer;
NRF_TIMER2->BITMODE = TIMER_BITMODE_BITMODE_16Bit;
NRF_TIMER2->PRESCALER = 6;
NRF_TIMER2->INTENSET = TIMER_INTENSET_COMPARE1_Enabled << TIMER_INTENSET_COMPARE1_Pos;//CC[1]
NRF_TIMER2->INTENSET = TIMER_INTENSET_COMPARE2_Enabled << TIMER_INTENSET_COMPARE2_Pos;//CC[1]
NVIC_EnableIRQ(TIMER2_IRQn);
NRF_TIMER2->TASKS_START = 1;