# Reset the timer counter before the overflow in ATXMEGA64a1

I want to reset the timer before the timer interrupt.

In my case, I will use the Mod bus protocol for serial port. I had to reset the timer for each byte sent and send data if the timer reach 3.5 ts(Time for sending byte). It mean if we didn't receive any byte until (3.5ts s ) we send data, if not, we add new data in the buffer.

So in this case, I want to use two interrupts:

• One interrupt for the serial port Rx. In this interrupt I will reset the timer.
• One interrupt for the Timer where I will send the Buffer.
• Capitalization and punctuation will help make your question readable. – JYelton May 5 '14 at 7:15
• It's not clear what is asked here. You wan't to know how to implement what you described? Because right now it's not a question, but just a description of what you are doing. – Blup1980 May 5 '14 at 11:19

I never used this perticular controller, but to reset the timer, You can write 0 in it's timer/counter register OR there might a bit through which you can reset the timer. On checking datasheet, If you could set command to RESTART i.e. 10 in CTRLFSET register, it will restart the timer.