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

How to configure timer interrupt as a counter for usart application.

My requirement program flow is clearly written down .Please help me out.

void USART_EVENT_Handler()

 // disable timer 1

//disable timer 2

// clear timer 1 count

//clear timer 2 count

if (operation)

{

}

//enable timer 1

//enable timer 2

}

void timer1_init()

{

 //mode =counter increment

//period= val

//auto reload mode

}

void timer1_event_handler(void)

{

 if (timer1_count_val==1)//overflow flag

{

  //stop timer 

//clear counter val

}

}

I am not able to get appropriate registers in nrf52832 datasheet. please help me to implement this logic .

I go through the timer example which is simple timing delay program .

Related