- Start with a clock of 80MHz
TIM_DIV16 suggest to me that 80 MHz is divided by 16 so that would be 5 MHz or .2 microseconds
If I am correct, that would mean an interrupt after .0000002 * 5000 = .001 seconds or 1000 Hz.
Also, not sure what TIM_EDGE and TIM_SINGLE mean. Is there a reference somewhere for those?
timer1_attachInterrupt(TimerISR);
timer1_enable(TIM_DIV16, TIM_EDGE, TIM_SINGLE);
timer1_write(5000);