XMEGA A4U simple counting.

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

Hi

I really, really have searched, but I'm still none the wiser.

Simply, can the timer/counter on an xmega just accumulate pulses on an input if the chip is in a sleep mode? Seems no clock is required for ths - the pulse is the clock...

Sorry it's so stupid a question, but I'd have thought it would be a basic thing for a counterr to do, yet I can't find in any datasheet/manual/app. note.
As always, humble thanks!

-Andy

 

Last Edited: Tue. Feb 17, 2015 - 04:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Andy,

 

Which sleep mode?  Some have system clocks active, and others do not.  You need to use an event channel as the clock source for the timer, and tie the event channel to an input.  It seems that you might be able to use one of the asynchronous port input interrupts for this.  Have you tried anything yet?

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

Thanks for replying, Altazi.
No, I haven't tried anything yet, for some reason my 'lashup' doesn't (yet) talk to the Dragon.
Trying minimum sleep power - so that's powerdown. Didn't realise the event channel is required - think that'll definitely need peripheral clock, which would mean idle mode. Bah!
Trying to avoid using an async. interrupt, again for power saving reasons. However, if it's the lesser of the evils, so be it....

 

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

Hi!

 

I am also trying to implement very low power pulse counter. Even with extra hardware, that is not simple, since there is no suitable counter chip available. What comes to atmega interrupts, the latency from deep sleep modes is too big and power consumption will be far too high (I think). I would need something around 1 uA in average.

 

If you can find something around that "event" thing I would be very interested, too!

 

By the way, there's an interesting board series coming, containing also atmega32u4 based board: https://twitter.com/aistinfamily...

 

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

Hi Jarmniku,

 

One microamp average current is a challenging target.  You can eat that much current with leakage in your electrolytic capacitors, or a fingerprint on the PCB.  What is the count rate of your counter?  One count every millisecond is going to require more average current than one count every 10 seconds.  More details could be helpful.

 

The XMEGA counters don't have dedicated inputs; instead, you can select an event channel as a clock source.  You would need to configure some sort of port pin interrupt and link it to the same event channel you are using as a count clock.  If you want to be able to wake the XMEGA from a deep sleep mode, use the asynchronous interrupt on bit 2 of the ports.  Refer to the documentation for more details.

 

Altazi