0

I am in the planning stage of chaning two ATSAMD21 with a Zero or Nano 33 bootloade r in a SPI connection. The rational for this is that i am in need of 30 pin GPIO expansion and using 2 mcp23s17 takes a fair bit amount of space and also slightly bit more expensive. Since the ATSAMD21 has theoretical 37 GPIOs why not use that. having not owned a zero board yet, i would like to know if:

Is it easily doable, just connecting the appropriate pins?

If so, i have read in the Arduino SPI documentation that the zero doesnt have any Slave Select for Master and Slave, does this mean i can use whatever i want? And just code it to detect that pin

Does the built in SPI library capable of handling the slightly higher clock speed of the zero ?

2

A zero has the same number of IO pins then a UNO, they use the same header layout. So I believe you want to use the chips on a self made PCB. (?)

Based on this, I think a second SAMD21 is not the best solution.

They are easily connectable as they use the same Voltage. I used the SPI lib on a zero, so yes, I think its programmable with Arduino techniques. And you can use a CS pin of your choice. The SPI lib uses Arduino header files for the selected platform. So the MCU clock speed shouldn't be a problem.

But you have to program the master and the slave and maintain this firmware. An MCP23(s/0)17 is ready to use.

Two MCP23S17 (QFN packages) don't take that much space.

SAMD21 is capable of driving max. 3.6 V; MCP can handle 5.5 V. (But if you want to use 5V you have to level shift the connection between your Arduino zero and the MCP.

And adding two more MCP23S17 is way easier that adding a third SAMD21, when even the old firmware must be reprogrammed.

A MCP23S17 can drive and sink 25 mA on each pin.

A SAMD21 can handle 14 mA source current and 19.5 mA sink current per IO cluster (there are 6 clusters each of them has between 2 and 16 pins).

On the other hand, if you are sure, you don't need more than 3.6 volts and ~1 mA per pin and the number of the additional IO pins is enough, there is no reason not to use a second SAMD21.

If you need capacitive touch pins, or more I2S ports or other capabilities of the SAMD21, then the second SAMD21 is even the better choice.

Have you seen the Arduino DUE? It has all the features of a zero and way more IO pins (54) and 12 analog inputs and 2 real analog outputs.

  • Correct i will use it on a custom PCB. I am still in the planning phase and evaluating my options, I really like your arduino DUE suggestion this will make things a lot mor easier, It even has a faster clock speed ! Will check the chip its using, and how complicated is its minimal components – Jack Dec 15 '19 at 13:30
  • If you have experience using the DUE. do you know what is the purpose of the ATMEGA16U2 microcontroller? and can it be removed? – Jack Dec 15 '19 at 13:38
  • The DUE has two USB ports. The native port is directly added to the SAMD Controller and the programming port is connected to the U2 chip. The U2 chip is responsible for the programming over the serial port and also for ICSP programming over the ICSP1 header. It is also possible to program the DUE over the native port. The SAMD of a DUE can only be programmed if the FLASH has been erased before. And the boot loader on the U2 chip does this for you automatically. If you use the native port it's up to you to erase the Flash memory. – Peter Paul Kiefer Dec 15 '19 at 14:44
  • Hello i made some progress since my last reply and would like to talk about it more in chat – Jack Dec 15 '19 at 18:01
  • unfortunately im having a difficult time creating one, I will just replying here until the pop up pops up. About that erasing the flash memory on the arduino due's documentation you have to open and close serial at 1200bps, how can this be simply achieved in hardware? – Jack Dec 15 '19 at 18:12

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.