I've been working on a project that involves SSI Rotary Encoders from CUI. They are being read through the SPI interface, and I am bit-shifting appropriately to account for the differences between SSI and SPI. Unfortunately, I am pretty limited in knowledge of how the SPI interface works, but I am attempting to connect 5 of these encoders to the Arduino (nano) to create a simple robot.

Everything was working great when I had 3 encoders, however, when I add a fourth to the same Arduino, all of the encoders stop reading. I am struggling to determine my next steps. According to one source, it appears that an Arduino is allowed a maximum of three SPI devices, but I am wondering if it is possible to have the other two read through a software interface? Here's a link to the source I found: https://esp32.com/viewtopic.php?t=1972. If you have any suggestions, please let me know!

  • how are you connecting the devices? – ratchet freak Mar 18 '19 at 10:09
  • From what I see you can use Arduinos shifIn function for "software serial". But I don't see why it shouldn't work with more that 3 encoders. Ehe esp32 forum post said, that's just a software limit. You'd have to set the Chip Select pin for that encoder manually. Some something like digitalWrite(CS_ENCODER_4, LOW); SPI.readSomething(); digitalWrite(CS_ENCODER_4, HIGH); – Gerben Mar 18 '19 at 13:47
  • that's a link to the ESP32 docs, not nano, and it's a limit for distinct SPI lines, not multi-device lines like you should probably be using. – dandavis Mar 18 '19 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.