i'm trying to extend the capabilities of the Sparkfun SAMD21. My question is, which pins do I have to share? I mean, I understand that MISO, MOSI and SCK are shared, but CS connects each to a different pin, am I correct?

My schematics:


I connect my CS_RAM to the D10(PA18 on SAMD21). and i connect my CS_FLASH to the D6(PA20 on SAMD21)


You are correct, MISO, MOSI and SCK are common to all the SPI devices. Be sure they are all set up for clock polarity etc. The CS\ line is the select line. If the device is not selected it does not matter what goes on with MISO, MOSI and SCK. There are chips such as the 74HC138 that will give you chip selects with just a few additional pins. 1 pin gives you 2 selects 2=4 and 3 gives you 8 selects.

  • 1
    Ok, but i can connect my CS to digital pins, right? – Valentino Zaffrani Sep 28 '20 at 22:37
  • 1
    With polarity u mean put a litle power in the lines? like u can see on the image that i add, i have 10k resistors from +3.3V to CS and in one case MISO and MOSI. SCK no needs nothing, right? – Valentino Zaffrani Sep 29 '20 at 1:23
  • 1
    Yes they are digital, and that is probably 3V3 in your system. It should work fine, the Arduino pins should be high during reset which will disable the CS\ (active low) chip select. – Gil Sep 30 '20 at 2:48
  • so, with a Mosfet connected to the RESET pin of my SAMD21, i connect my CS_RAM and CS_FLASH to 3.3v? or what do u mean? check that i have 10K resistors between CS and 3.3V. – Valentino Zaffrani Sep 30 '20 at 8:40
  • 1
    I dont get you, i have my CS connected with a 10k resistor to 3.3v and to the digital pin. What go to fry? – Valentino Zaffrani Oct 1 '20 at 13:42

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.