Re: Atmel Avr, encoder's ticks counting (was: Atmel Avr, n-coder`s ticks counting)

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to


Quoted text here. Click to load it

The word "n-coder" is confusing me a bit, because "n" usually
represents a natural number. It is also preventing search engines
from finding your post. So please say "encoder". IMO "n-coder" is
neither cooler nor shorter than "encoder".

Quoted text here. Click to load it

What kind of encoder are you using? I assume it is a quadrature, but
am not sure.

The outputs of a quadrature decoder look like this, when turned in one
direction (use a font with constant width to view)

  __  __  __  
A   __  __  __

   __  __  __
B _  __  __  _

Search the web for "quadrature decoder avr"

Quoted text here. Click to load it

You are right here ;-)

Quoted text here. Click to load it

It is generally a good idea to mention what compiler and
microcontroller you are using.
 
Quoted text here. Click to load it

Recent versions of gcc don't need the "inb" function, just write
  if (!(PIND & 8))
or even better
  if (!PIND.3)

Quoted text here. Click to load it

Same as above for "outp". Better write
  DDRD = 0;

Can't say more about the code, until I know more about your decoder.

/Jan-Hinnerk


Site Timeline