SPI or I2C comms to an rotary encoder

I have two 12 bit rotary encoders in a gimbal mount for pan and tilt. I would like to read the values of the encoders with an Arduino via SPI or I2C, but I don't know how to begin implementing such a thing. I know that the encoders will respond with Synchronous Serial output, so I suspect that either SPI or I2C might work, but I'm not an electronical guy. I have the data sheet for the encoders and I have several Arduino Unos and 256 Megas laying around in my shop to play with, but I don't know electronics well enough to understand how to get my Arduino to communicate with the encoder and then how to save the response. I know I can send any 'answer' to the Serial Monitor, but I'm basically clueless how to get started.
A book, a website, or further conversation to help me would be greatly appreciated.
I don't want to have to become an expert in Serial Communications, but i am ready and willing to learn what I must to make this work.
Thanks

A link to the encoder specs would be grand.

Here are the encoders at Gurley Precision Instruments:

https://static1.squarespace.com/static/5b9183b8fcf7fdac4d3a1067/t/60b577e9dcd9f66be2821da6/1622505450566/A19.pdf

I don't know how to make that "nicer", but there it is. Thanks for asking for details. I wasn't sure if someone would say 'Go look at ...' so I waited

my encoder part number is: A19-S-12-SBRS05-SAS18-R02EN
A19 - Solid Shaft - 12 bit resolution - SSI output format - Binary Output - RS422 output device - 5 VDC - 0C - 70 C temp - Blind hollow face mount - Side cable exit - 18 inch cable - Pigtail end (to ribbon cable) - 1/8" shaft - No special features
Does the RS422 mean that I can only deal with an RS422 controller station and can't go to an Arduino?

I think the RS422 element of the part number is probably indicating that the clock and data signals are differential signals as shown on page of the datasheet you provided. There are plenty of RS422 line driver / receiver chips around that can interface to 5V logic for, say, an Arduino UNO.

This might help you:

And, as you've discovered, the device uses the SSI protocol, not I2C or SPI.

Your encoder is neither a SPI nor an I2C compatiable device. You need to connect your encoder with Arduino UNO as per diagram of Fig-1. After that you genertae 20 clock pulses as per specs of Fig-2 to bring out 20-bit data from the encoder. After that you process the data.

Encoder
Figure-1:

encoderTiming
Figure-2:

Wow! Fantastic GolemM. Thank you for showing me a schematic and all. That is precisely what I needed to see.
My next question in this has to do with the timing. It looks as if the SSI comms requires clock pulses NOT LONGER THAN 11 MICROseconds but typically the Arduino processes in MILLIseconds in my experience. Isn't that a problem? Or will the Arduino actually make / run / process in MICROseconds?
It seems I've doomed myself to buying a faster device or buying different encoders since these are "too fast" for my Arduinos to handle.

oh, and my encoder is only 12 bit, not 20 bit. No difference in the communications, but just shorter 'bursts' of the bits - 12 clock cycles instead of 20. No harm, no foul, just my lack of specificity.

Arduino UNO is running at 16 MHz. It can handle your specified encoder very well.

Well, that all sounds very good. But what about sketches and libraries that normally handle this stuff? That "Absolute rotary Encoder SSI SPI how?" conversation doesn't sound encouraging if , as quoted, it keeps dropping errors, so what do I do with that?

Clueless (not) in Seattle.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.