Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I'm trying to interface an HEDS 9700 optical encoder using an HCTL-2020 IC (or anything else) with my Atmega ( atmega128, atmega32, atmega16, atmega8 or any AVR-family based microcontroller, don't matter for me ).

But I don't know what should I do. I read datasheets of both devices. What pins from HCTL must connected to my microcontroller (and which one ?) ? Basically, I don't know what to do with this encoder.

Please help me find out the way.

Thanks.

share|improve this question

2 Answers

up vote 3 down vote accepted

If your encoder doesn't pulse too fast I'd do it without the HCTL-2020. There's nothing in it a microcontroller can't do.

The HCTL-2020 is a parallel output device, for interfacing with an 8-bit microprocessor bus (probably from the Crimean War period). Data is on D0-D7 if the OE input is low. Since you have 12/16 bit of data you'll have to use the SEL input to select whether you want the HOB (High Order Byte) or the LOB (Low Order Byte). Use the RST input to reset the counter.

enter image description here

So OE, SEL and RST are outputs from the microcontroller, D0-D7 are inputs.

The HCTL-2016 outputs 2 square wave signals in quadrature, which is needed to tell the rotation direction. These go to the CH A and CH B inputs of the HCTL-2020. If you want to connect the 2016 directly to a microcontroller (saves you 9 I/O pins) you'll want them on pins which can give interrupts on changes.

share|improve this answer
thanks for detailed answer :) you're right too :) – Michel Kogan Jul 17 '12 at 8:05
"Crimean War period" == like! :) – Federico Russo May 14 at 14:05

Why do you need the HCTL to connect the encoder?

You could connect CHA and CHB each to a digital input pin, Vcc to +5V and Gnd to your circuit ground.
Typically you would use a capture and compare module with a timer to detect and count the pulses from the encoder.

optical encoder

share|improve this answer
many thanks, you're right :) – Michel Kogan Jul 17 '12 at 8:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.