I'm currently trying to implement 4 CS in RaspPi. I'm still a newby in this field and used the library wiringPi. For CS0 and CS1 this works totally fine. However now I have 2 more CS on the GPIO Pin 17 and 18 (with same Clock, Miso/Mosi Pins as CS0 and CS1).

I found this tutorial https://adikedia.com/2016/08/10/using-multiple-spi-slave-devices-with-wiringpi/ on how to implement 3 CS with wiringPi, but not sure if this might work in my case.

If I set CS 17 to Low and then call the wiringPiSPIDataRW(CS0, buff, lenght) function , shouldn't my CS 0 also go low? Then which data will be written to my Miso Pin?

Thanks for your help!

  • Why don't you try? If the tutorial is wrong then ask a detailed question explaining what did not work as expected showing the code you are using.
    – joan
    Feb 23 at 19:05
  • Ah yeah, good question. Should have tell that my Code is mot working. I implemented my code first in Python, but there I‘m wrote all the functions from scratch and implementing when the CS, the clock and so on goes Low or High. This also works perfect.
    – Archiac
    Feb 23 at 19:56
  • Ups sorry send my comment to early... so yeah now I wrote a C++ code where I set up wiringPi, setup SPI, everything same as in the example Code. Write in my buffer the same adress I used in my Python code and its not working. I‘m just not sure if I have an error in my code or if there might be some „general knowledge“ about WiringPi. I read some comments where people where against using wiringPi and I just don‘t know why. Don’t want to spend more time with the library ig there are better alternatives
    – Archiac
    Feb 23 at 20:00

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.