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

51822 TIMER compare

Hi:

    I use TIMER compare function, I open four channels and every channel produce interrupter.Here are some of my code:
    
    NRF_TIMER1->TASKS_CLEAR = 1;
NRF_TIMER1->CC[0] = value1;
NRF_TIMER1->CC[1] = value2;
NRF_TIMER1->CC[2] = value3;
NRF_TIMER1->CC[3] = 0

; NRF_TIMER1->EVENTS_COMPARE[0] = 0; NRF_TIMER1->EVENTS_COMPARE[1] = 0; NRF_TIMER1->EVENTS_COMPARE[2] = 0; NRF_TIMER1->EVENTS_COMPARE[3] = 0;

NRF_TIMER1->INTENSET = (TIMER_INTENSET_COMPARE0_Enabled <<                            TIMER_INTENSET_COMPARE0_Pos)  | 
							   (TIMER_INTENSET_COMPARE1_Enabled << TIMER_INTENSET_COMPARE1_Pos)  |
		                       (TIMER_INTENSET_COMPARE2_Enabled << TIMER_INTENSET_COMPARE2_Pos)  |
							   (TIMER_INTENSET_COMPARE3_Enabled << TIMER_INTENSET_COMPARE3_Pos);

NVIC_EnableIRQ(TIMER1_IRQn); 
NRF_TIMER1->TASKS_START = 1;


   then it counld't run, program died after " NRF_TIMER1->TASKS_START = 1;" .So where is the error 

happen??

Related