Pages: 1 [2] 3 4 ... 13   Go Down
Author Topic: SD card read/write with Arduino  (Read 104834 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mr. Orange,

Thanks.  I plan to use to log a battery charging session to see what the profile is on my DeWalt battery charger.

Any chance you would post the real time clock circuit you have on there?

Thanks,

Rick
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I'm trying to interface arduino uC to a microSD card thru pin 8-13 and GND.

I have been googling and i found this post, ladyada's code[1] based on roland's code[2] and some arduino's vendor code[3].

I have not been able to use SD card yet. The closest i got it is with this post and ladyada's code, but i can not initialize correctly the SD card.

As i read in this post, some people is having same issues, did you resolve it?

I'll be waisting some time on this and kick it, if somebody wants to join, it is welcome.

(I can not post active links)

--

Troubleshooting

Code:

------------------------                            
Data sampling system                                
send r to read disk                                  
send s to start sampling
send q to stop sampling
Ready.....
-------------------------
MMC/SD initialization failed


How should i format SD card? I have tried without partitions and with FAT16
« Last Edit: November 05, 2008, 10:41:52 am by zumbi » Logged

Newcastle NSW Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
RalimTek
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you use this with a micro sd card?
Logged

Cybot

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, I have not been able to use it yet. It compiles safely but it does not initialize the SD card, so I can not write nor read from it.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think it will work with microSD. According to wikipedia the SPI mode that this library uses is optional for microSD but required for SD:

http://en.wikipedia.org/wiki/MicroSD

How hard would it be to use the SD mode instead of SPI? And what about SDHC support?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this might be an incredably stupid question, but im new here.
(you can thank ladyada her GPS data logger kit got me addicted)

someone mentioned using the SD card as a 1gig EEPROM.
would it be possible to use the SD card as the storage location for the sketch code?

maybe in a dual core setup. using one arduino as the access medium to the SD card and then having the second arduino execute the resulting code from the first?

like i said probebly a really stupid question, but im still new, and a bit of a dreamer
« Last Edit: December 11, 2008, 09:13:14 am by dbunting » Logged

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
would it be possible to use the SD card as the storage location for the sketch code?
Technically, since the ATmega is capable of self-programming, the answer is yes.

Practically, the answer is no. Since there is no way to run code from the external device, you would be required to copy code from the SD card to flash, run the code, then reprogram the flash with whatever code you need to run next.  This is slow, complicated, and the flash has a limited number of write cycles, which means the ATmega would die an early death.

Quote
maybe in a dual core setup.

I think this has more potential, but not in the way you say.  The dedicated ATmega would provide  FAT filesystem support and interface to the SD card.  FTDI has already done this with the Vinculum, although with a USB interface and not directly to SD.

-j
« Last Edit: December 11, 2008, 10:13:31 am by kg4wsv » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

now is there no way because the arduino isnt currently capable (ie not part of the core code) if thats the case could a custom core be written.

or is there no way because of the technical limitations of the chip and execution enviroment?

and why limit it to fat if raw works fine?
« Last Edit: December 11, 2008, 10:57:50 am by dbunting » Logged

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
and why limit it to fat if raw works fine?
Because raw is difficult to deal with if you want to pop the SD card out of the arduino and put it into a computer to exchange data.  If you use FAT on the SD card, you already have FAT filesystem drivers on all major operating systems.  If you use some raw format, you must write custom code for every possible operating system that you wish to exchange data with.

-j

Logged

Newcastle NSW Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
RalimTek
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If we could store the code on the SD card then could we make it able to have 2 sets of code files and a switch to switch between them and their code?
Logged

Cybot

Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AVR 8-bit microcontrollers are (modified) harvard architecture. that means that the program and data memory are completely separate except for the special ability to load program data into ram such as string constants, so you can't load anything into ram then run it as if it was code, like you can on von neumann architectures such as desktop PCs.

This basically means that we can only use SD for data. If you want to store code on one, you will have to write your own language and interpreter, or use a microcontroller with a von neumann architecture instead of the atmega168 on your arduino.
Logged

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, Triffid, but as I said the ATmega is capable of self-programming, so yes it is technically possible for it to pull code from the SD card, write it to flash, and execute it.  This really isn't any different conceptually  from pulling the data from a serial port and writing it to flash, which is exactly what the Arduino bootloader does for us, allowing us to program the ATmega without a hardware programmer.

As I said earlier I don't think it's terribly practical, but it absolutely is possible.

-j

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So back on topic... SD mode IO? SDHC support?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ducttapepro6---

I do also experience som trouble after resetting Arduino. Everything works fine to read and write to the SD Card but after resetting the Arduino the SD Card data is blank.

Have you found any solution for this?

//Daniel
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Zumbi, I am having the same problem as you. I cannot get the SD card to initialize. If anyone has some pointers I would be grateful. :    :smiley
Logged

Pages: 1 [2] 3 4 ... 13   Go Up
Jump to: