필터 지우기
필터 지우기

Reading and Writing to an SD Card via SPI on Arduino

조회 수: 5 (최근 30일)
Russell Senior
Russell Senior 2016년 12월 30일
댓글: Pathmashantha Senanayaka 2020년 12월 29일
Hi, I'm looking for some general guidance on writing data to an SD card through SPI on an Arduino UNO running through Matlab.
This is the SD card breakout I am using: https://www.sparkfun.com/products/13743. There are plenty of examples and helpful functions written to access data on the SD card for programming through the Arduino IDE. So, I can see a path to complete my project that way, BUT, I want to learn more about controlling external devices with Matlab and Simulink.
So. I cannot seem to find SD card specific functions in Matlab like find a file, open a file, and write to that file. Do I need to figure out the low level byte commands to send through SPI to accomplish these and then code that into Matlab, or does something like that already exist? I THINK the answer is no, that if I want to use Matlab, I need to figure out all of the communication commands for the SPI device.
If it helps, I can state a specific task: I want to write "Hello World!" onto an SD card through Arduino SPI using Matlab.
Any suggestions are appreciated.
  댓글 수: 2
fus
fus 2020년 10월 20일
Did you ever figure this one out? I just got into this myself and wanted to comb through the internet for solutions because I don't know how to use sblocks yet. I'm surprised this is probably the only post on it I've seen so far.
Pathmashantha Senanayaka
Pathmashantha Senanayaka 2020년 12월 29일
I want to play music file on sd card module connected to arduino using matlab guide.
Please help..

댓글을 달려면 로그인하십시오.

답변 (2개)

Vishal Neelagiri
Vishal Neelagiri 2017년 1월 3일
You might find the following documentation links useful regarding this:
https://www.mathworks.com/help/supportpkg/arduinoio/examples/communicate-with-spi-device-on-arduino-hardware.html
https://www.mathworks.com/help/supportpkg/arduino/ug/spiwriteread.html
https://www.mathworks.com/help/supportpkg/arduinoio/ref/writeread.html
  댓글 수: 1
Russell Senior
Russell Senior 2017년 1월 3일
Thanks Vishal! I read those in depth, and they provide good information on HOW to communicate, but not WHAT to communicate for µSD cards.

댓글을 달려면 로그인하십시오.


Sean Hanrahan
Sean Hanrahan 2017년 12월 15일
Could this be of assistance?
https://au.mathworks.com/matlabcentral/fileexchange/51710-data-logger-on-arduino-uno

카테고리

Help CenterFile Exchange에서 Instrument Control Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by