0

Adding a SPI device to Matrix Portal M4
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adding a SPI device to Matrix Portal M4

by gmherrera on Sun Aug 01, 2021 9:44 pm

Hello,
I'm using a Matrix Portal M4 along with 64x32 LED matrix display. It's working really well. But I need to add an SD card for data logging. How can I add a SPI device to the Matrix Portal M4? I see the four analog breakout pins, and I understand these can be used to support SPI hardware, but I can't figure out how to set it up to interface with a SPI SD card module.

I'm using arduino IDE to code this project.

Thanks for any help you can provide.

gmherrera
 
Posts: 2
Joined: Sun Aug 01, 2021 9:33 pm

Re: Adding a SPI device to Matrix Portal M4

by dastels on Mon Aug 02, 2021 4:36 pm

Hardware-wise, the SDcard is a simple SPI device, 4 pins: MOSI, MISO, SCK, CS. The A1-A4 pins on the Matrix Portal are on SERCOM0, soyou should be able to get it up and running on that. The MatrixPortal 3.3v output will handle an SDcard happily. Have a look at for more information on setting up a SPI interface. Not something I've delved into before, but it looks reasonably straightforward.

Dave

dastels
 
Posts: 7326
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adding a SPI device to Matrix Portal M4

by gmherrera on Mon Aug 02, 2021 9:06 pm

Have a look at for more information on setting up a SPI interface.


Thanks for the reply Dave, I appreciate the support. You started to mention a resource for me to take a look at for some help setting up the SPI interface on the Matrix Portal M4, but I'm not sure where to go. It looks like you left out a pointer for where I should be looking for more help. Thanks again!
Gerry

gmherrera
 
Posts: 2
Joined: Sun Aug 01, 2021 9:33 pm

Re: Adding a SPI device to Matrix Portal M4

by dastels on Mon Aug 02, 2021 10:31 pm

My bad. I forgot to paste the link: https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports/creating-a-new-spi, especially the SAMD51 section.

Dave

dastels
 
Posts: 7326
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.