Adding a SPI device to Matrix Portal M4

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
gmherrera
 
Posts: 2
Joined: Sun Aug 01, 2021 9:33 pm

Adding a SPI device to Matrix Portal M4

Post by gmherrera »

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.

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adding a SPI device to Matrix Portal M4

Post by dastels »

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

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

Re: Adding a SPI device to Matrix Portal M4

Post by gmherrera »

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

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adding a SPI device to Matrix Portal M4

Post by dastels »

My bad. I forgot to paste the link: https://learn.adafruit.com/using-atsamd ... -a-new-spi, especially the SAMD51 section.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”