1: I don't know if the lib work with ATmega324 and I don't know Arduinos with that processor. The typical processor is ATmega328.
2: Have you use level-shifters or does your Arduino run with 3.3V only? If the Arduino is 5V you need level-shifters or you could broke your SD card. The simplest way to build a level-shifter is using two resistors for every of the four input pins at the SD card. A description can be found in file SimpleSDAudio.h.
3: You have to power the SD card as well - connect GND to pin 3 and 6 of SD-card and connect pin 4 to the 3.3V output of the Arduino.
4: If there is no sound try the example BareMinimumWithDebug first and look at the output from the serial port. This can give you an indication if your wiring is still wrong or if there is something wrong with the filesystem on card or the file. You can post this output here in the forum to get more help.
2: Have you use level-shifters or does your Arduino run with 3.3V only? If the Arduino is 5V you need level-shifters or you could broke your SD card. The simplest way to build a level-shifter is using two resistors for every of the four input pins at the SD card. A description can be found in file SimpleSDAudio.h.
It has 3.3V. No need for level shifters.
3: You have to power the SD card as well - connect GND to pin 3 and 6 of SD-card and connect pin 4 to the 3.3V output of the Arduino.
Did that already.
4: If there is no sound try the example BareMinimumWithDebug first and look at the output from the serial port. This can give you an indication if your wiring is still wrong or if there is something wrong with the filesystem on card or the file. You can post this output here in the forum to get more help.
It failed the first test. And I am not certain where to connect the cs pin. Digging the datasheet of 328 and 324 does not help. I am having a hard time understanding both.
After connecting the SPI pins on corresponding pins, CS to pin 4, 100 ohm resistor to pin 10 and then the speaker, I tried measuring the 3.3 volt supply from the board and it went up to 4.3 volt. I think it's not normal. What might be the cause?
I directly connected the MOSI, MISO, and SCK of the SD card to the MOSI, MISO, and SCK of my arduino.
I also directly connected the VCC pin of my SD card to the 3.3V of the arduino.
After connecting everything, I checked the voltage at the 3.3V pin of my arduino.
I used a fluke to measure the voltage. I got a reading of 4.3 volts.
I'll try the 100uF. It might work.
Also, I'll try connecting the audio out to pin 9.
Hi, I looked over the Gizdino+ schematic: It runs on 5V, so you need level-shifters and you should test the 3v3 pin before with a multimeter to ensure that at least there is 3.3v. Second, the gizdino+-thing has sanguino pinmap, but datasheet says that there is a mapping for arduino-compatibility. Whatever, in the end you must ensure that the hardware spi pins are connected correctly to the card, so mosi to mosi, miso to miso, clk to clk and cs to pin 4 - but i dont know if in arduino or sanguino or gizdino numbering. Even if that is all correct i dont know if it will work because that clone is not very compatible to arduino. better go for the real one - at least take one with the correct cpu. the gizdino-non-plus version may work, but beware - the statement that it is 3.3v seems to be a bad typo to me...
I directly connected the MOSI, MISO, and SCK of the SD card to the MOSI, MISO, and SCK of my arduino.
I also directly connected the VCC pin of my SD card to the 3.3V of the arduino.
After connecting everything, I checked the voltage at the 3.3V pin of my arduino.
I used a fluke to measure the voltage. I got a reading of 4.3 volts.
I'll try the 100uF. It might work.
Also, I'll try connecting the audio out to pin 9.
I believe you are referring to the outputs/pins....
but this does NOT mean your board runs on +3.3v logic level..
example the Arduino UNO has +5v & +3.3v output pins....
however the boards runs on +5v logic... (even though there is a regulator outputting +3.3v on a pin or two)
I have tested/used this library on custom boards, Uno/Duemilanove (+5v).. and even minimal Arduino circuits running on +3v, 8Mhz internal clock (ie: no crystal no caps..etc)
First thing is to get an SD shield that properly works with your set-up..
Thanks for the replies.
I had a little experiment that may help you help me.
I measured SCK of SD car to gnd: 0V
MOSI = 4.4V
MISO = 5V
CS = 5V
Added later: I guess this already shows the error on interfacing.
Do you think this http://www.sparkfun.com/tutorials/65 can already correct the error?
Hi,
is it so hard to believe that your board is running on 5V and not on 3.3V even that #*&! website says something different? That you measured the 3.3V line at 4.2V is a sign that your SD card is fighting a deathly battle against the 5V. What happens is the following: The SD card is connected to 3.3V at VCC, but at 5V at one of the other pins. An internal protection diode in the card tries to clamp the excess voltage at the pin with 5V to the 3.3V supply, but that supply is also weak because the crapduino uses some 3.3V from the USB-seriell-converter chip instead of a powerful extra regulator. This way the 3.3V regulator looses the battle and its output voltage rises to 5V minus the typical diode foreward-voltage of 0.7-0.8V = 4.2V. This is not how it should be done! You can destroy your AVR, the USB-Seriell-Converter or the SD card. I don't know how long this battle can take place and who will win, but you might have already broken something. Hint: Try if your SD card still works within a PC before spending more time frying stuff...
Believe it: YOU NEED LEVEL-SHIFTERS or a SD-shield that has those!
Another thing: I don't like the solutions from sparkfun levelshifter site because most of them are pretty slow. Better use a voltage divider with two resistors per line as described in SimpleSDAudio.h. This is proven to work even at fast SPI speeds as required for my lib.
I suggest grabbing a few resistors.. and making a voltage divider, so that your LOGIC level will work correctly..
I have read about the voltage dividers being 'slow' (or too slow even).. but I have tried and tested this myself.. and it works fine for me & initial testing.
IMHO (again Im a noob! <--- disclaimer!) .. you have +5v Arduino/board.. (period)
In order for the SD card to 'work'.. you need an Arduino that RUNS @ +3.3v logic...
or
A voltage divider between Arduino & SD card.
Hi,
I think both voltage dividers will work, if you don't have those 1.8k and 3.3k resistors also the 10k/4k7 solution should do it. BUT: Do you really have a ~~CrApDuInO+~~gizDuino+ (the plus version)? In such a case please tell me exactly how the menu item under "Board" inside Arduino-IDE is called that you use. I can help you to get it running even on such strange Arduino board but it will need some "special handling".
Ok, at least this Arduino clone has a ATmega328, better than the one with the plus at the end. If you do your wiring correct and with levelshifters it should work with the lib.