1

I’ve checked the nano’s tech specs but I can’t seem to find any information regarding it. I’ve tried setting it to pin 26 (digital output)

  • the Nano Every doesn't have pin 26 – Juraj Nov 21 '19 at 14:25
2

The following answer assumes the Arduino is the master.

You can use any pin for that (at least any GPIO pin).

Multiple SPI devices can be connected to a SPI peripheral on an Arduino (in principle).

Every SPI device should have their own CS/CC pin, and is mandatory when you use multiple SPI devices.

For this reason, there is no single pin the SPI can define for being used as CS/CC pin. However, it should give a GND or VCC value, thus a CS/CC pin should typically be configured as a digital input pin (as master) for each slave. (See remark of KIIV too); as slave the CS/CC pin should be a digital output pin.

For the other pins (MOSI, MISO, CLK), the Arduino uses a fixed set of pins because all SPI devices will be connected to these pins.

So the CS pin is configurable, and the other spi pins are fixed.

| improve this answer | |
  • 1
    I am not familiar with the chip on that board, but if it's like the other AVR based boards the "primary" CS pin must be set to output (pin 10 on Uno - no idea what it will be on that board off hand). Otherwise SPI won't work. – Majenko Nov 21 '19 at 14:28
  • 1
    However don't forget about SS (select slave) pin on AVR based Arduinos. It must be set as output (or at least used as output). Otherwise low level on this pin causes switching SPI to slave mode. Even left unconnected (as an input) it can be source of weird deadlocks in noisy environment. – KIIV Nov 21 '19 at 14:30
  • 1
    The SPI peripheral in the chip has two modes of operation: one is Master and the other Slave. Which mode is selected depends on the DDR setting of the primary CS pin. It's a stupid way of doing it, but that's what Atmel's designers chose to do... – Majenko Nov 21 '19 at 14:37
  • 1
    @MichelKeijzers I though it's general name for signal. Anyways /SS is active low, so as an input it should be held to the Vcc. The SPI supports multi-master mode and this pin is used to archieve it (only possibility to disable it is use it as an output) – KIIV Nov 21 '19 at 14:38
  • 1

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.