XMega timer prescaler reset

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've recently started using the XMega devices instead of the Mega chips.  On the Mega chips (328P/328PB for example), there is a General Timer/Counter Control Register (GTCCR), which can be used to reset the prescaler counter when clearing the timer (PSRSYNC bit), so that there won't be a random fraction of the time period "missing" from the first cycle count.  This makes timing interrupts much more precise after timer resets.  I can't seem to find the equivalent of this on the XMega chips (I'm using the A series, ATxmega64A4U as an example).  Any ideas?

 

Thanks,

 

Andras

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think most of the peripherals tap off a common prescaler so a reset signal would have side effects beyond the timer/counters. Seems to me that cascading timers on the XMEGA can achieve the same precision and range you could get on the 328 (with timers to spare).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think most of the peripherals tap off a common prescaler so a reset signal would have side effects beyond the timer/counters

All TCs share a common prescaler that is separate from the system clock prescalers, so, if you could reset the TC prescaler, it would only effect ALL TCs.

Greg Muth

Portland, OR, US

Atmel Studio 7.0 on Windows 10

Xplained/Pro/Mini Boards mostly