> I want a counter which i can use to calculate the start and end time
Which the DMA timers are perfect for. There's no need for overflow interrupts or anything.
> I do not want any interrupts at all.
What makes you think you even need an interrupt? What broken timers have you used in the past that need this (maybey timers on 8-bitters).
I guess this might be a little "tricky", but I've known about this use of simple binary arithmetic for so long it just seems an utterly obvious way to do this.
You set up the DMA Timer to free-run instead of resetting at a reference value, so it counts from zero to 0xffffffff AND THEN ROLLS OVER TO ZERO. This is incredibly powerful and simple. To use this, all you have to do is set the timer running and then:
unsigned long nTime1 = DTCn;
... Do something that you want to time ...
unsigned long nTime2 = DTCn;
unsigned long nElapsedTime = nTimer2 - nTime1;
THAT'S IT. You're subtracting two 32-bit numbers. No need to worry about rollover or anything. As long as the thing you're timing is less than the roll time (4,294,967,296 microseconds, or 71 minutes, 34 seconds) you end up with an unsigned duration in microseconds.
But make sure you always SUBTRACT the two values before comparing them to anything. If you write code like "if (nTime2 > nTime1 + 1000)" it won't work when it wraps (once every 71 minutes) and those bugs are very hard to track down.
You can have longer times by making the timer run slower, or measure finer times by making it run faster, remembering the maximum duration is now less.
I find that using 1MHz makes coding very easy when everything is in microseconds and there's no need to convert to some weird "tick value".
Tom