Reading index pulse from ABZ absolute quadrature encoder

Hi all,

I have an absolute encoder that I need to read into my program. Datasheet

I want to find a way to do it on an Uno, problem is that it only has 2 interrupt pins and all libraries I have found only read A/B signals anyway. Problem is how to read in the Z pulse. I have thought of a few ways to do it.

  • modify a library to use pin change interrupts to detect the pulse
  • use a latch chip to hold the pulse until it can be read

The arduino is being used as an etherCAT slave through the SPI interface, so interfacing using SPI is not doable.

Anybody know any libraries I can use or ways I can accomplish this task?

You are correct that pin change interrupts are the way to go.

Anybody know any libraries I can use or ways I can accomplish this task?

Two popular libraries to use for pin change interrupts are

Nico Hood's "PinChangeInterrupt" and GreyGnomes "EnableInterrupt"

They are both available through the library manager.

Its an absolute encoder, you can always use the bit-banged SPI to talk to it on any pins you choose and get the phase setup that way (don't have to wait for the index pulse).

Hi,

in my opinion you don't have to generate an interrupt with the Z pulse: the Z pulse must be checked inside the fase A - B interrupt service.

Further, you can use the SPI to read the encoder even if it is already used by the EtherCAT shield, provided that you use another chip select.

If you don’t feel confortable with this technique you can always make a bit-bang SPI as MarkT suggests.

By the way the EtherCAT shield that you are using is the EasyCAT shield ?

Marco