Electronic – Interfacing HEDS 9700 optical encoder with AVR atmega32

atmegaavrencoderinterfacemotor

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.

Best Answer

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.