Bug in QDEC driver ?

tomvitek
 
Avatar
 
Subject:

Bug in QDEC driver ?

 · 
Posted: 16.02.2014 - 15:56  ·  #1
Hi everybody!
I'm trying to use QDEC driver in Xmega128A1. Everything is fine when using 16bit resolution - so the result is integer -32767..32768. When i'm trying to use 32bit resolution, the result is correct only if start value of counter is decrementing. When it is incrementing, the first value after 0 is 65535, and it seems to be wrong counting further too....I have no idea, what can be wrong. Test program is practicaly the same as in demos....

I'll be glad for any tip. Thank you, Tomas.
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Bug in QDEC driver ?

 · 
Posted: 16.02.2014 - 18:20  ·  #2
Hi Tomas,

the cascading of XMega timers for QDEC doesn't really work.
There were some threads in AVRfreaks about this.
I got an info there how to do some workarounds. And they work with XMega256A3U.
Not tested with XMega128A1, sorry.

rolf
tomvitek
 
Avatar
 
Subject:

Re: Bug in QDEC driver ?

 · 
Posted: 16.02.2014 - 22:28  ·  #3
Hi!
Thank you. So the problem is in Xmega MCUs ? It is not very pleasant :) So what would you recommend. It is possible to generate interrupt if overflow of 16bit timer occurs and count to separate variable?

Thanks for any suggestions, Tomas.
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Bug in QDEC driver ?

 · 
Posted: 16.02.2014 - 22:52  ·  #4
Hello Tomas,

yes, I think an interrupt and inc/dec a separate 16bit variable is a good solution.

rolf
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   79   93 · Page-Gen-Time: 0.027654s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI