0

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:

Schematics

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

3

1 Answer 1

1

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.

7
  • 1
    Ok, but i can connect my CS to digital pins, right? Sep 28, 2020 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? Sep 29, 2020 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, 2020 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. Sep 30, 2020 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? Oct 1, 2020 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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