View previous topic :: View next topic |
Author |
Message |
LoPP Guest
|
Rotary encoders |
Posted: Wed Jul 01, 2009 10:49 am |
|
|
Hello,
What type of rotary encoders can we connect to a PICmicro: TTL or HTL. Can we connect it directly or via a special device?
Regards |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
if it is slow enough |
Posted: Thu Jul 02, 2009 8:30 am |
|
|
About a year ago I did a rotary encoder interface that just uses a couple of B port lines - inplementing the interrupt on change function - and from inside the ISR, doing "state machine" comparisons - then outputting data as a +/- integer.
This is useful for relatively low update rates applicable to a manually turned shaft - and would crap out if the encoder is on a high RPM motor shaft. Would be fine for a human with a knob in their fingers though. |
|
|
Ttelmah Guest
|
|
Posted: Thu Jul 02, 2009 9:36 am |
|
|
Some time ago, I posted some parts of a quadrature decoder code, using INT_RB, and a high speed handler for the quadrature interrupt. This handled 'edge' rates up to quite a few 10's of KHz. Was used with a 256 line encoder, at over 5000RPM OK. Was posted here, so should be findable with a search.
Best Wishes |
|
|
|