Go Down

Topic: Compiling an SD/MMC and fat16 library (Read 5833 times) previous topic - next topic

sirmorris

The code looks good, I'll run it against my hardware and let you know what happens.

This is a long shot but could you email me a digi picture of your card with its soldered connections? I've PM'd you my email address.

Nuno

Quote
The code looks good, I'll run it against my hardware and let you know what happens.

This is a long shot but could you email me a digi picture of your card with its soldered connections? I've PM'd you my email address.


Yes, I'll send you a pic as soon as I can...I'm quite busy rigth now with 2 exams in 2 days :D
Check your email in 6-7 hours.

thank you

agent_orange

Post up the code your using in your arduino sketch., that could help. If the card does nothing, then try making a simple sketch which just initializes the card and then prints out the sd card info. That should tell you if the card was initialized and is working or not.

Also, be aware that once you write to the card from the arduino you cannot read it in the pc again until you reformat it. Because you are writing straight onto the card which overwrites the FAT table.

If the card can be initialized and the disk info printed out then you "should" be able to read/write to it(murphy usually stuffs things up though (^_^)).

Nuno

Quote
Post up the code your using in your arduino sketch., that could help. If the card does nothing, then try making a simple sketch which just initializes the card and then prints out the sd card info. That should tell you if the card was initialized and is working or not.


No, the SD is not working. After all this tring I desoldered it and read in the PC...like new, nothing was changed.
I had some bad wiring in my circuit (thank you SirMorris!), fixed it I couldn't still make anything with the SD.
I can't really tell where the problem is...I used 2 SDs, made the circuit 4-5 time, checked resistors tolerances...
I'm starting to think that something is wrong with my board :|

agent_orange

Where did you get your library code from? Did you use rolands code or the one I posted up in the exhibition area. If the card reads fine in your computer then there are two options, either the code isn't correct or the circuit isn't correct. If you claim that the circuit is correct (check your input voltages through the voltage divider with a multimeter) then it should be software based. Post up your arduino board version, software version, the code your using and any other info you have and I'll see if I can find the trouble. It should work no problem   :D But thats electronics for u!...

josev

agent_orange,

I am starting to play with AVRs and recently I found about the Arduino system. I am very puzzled with your post a while ago:

Quote
Yeah I finally got it to all compile properly. I put the .c and .h files into a directory, renamed the .c to .cpp and it compiled automatically. I had to change a bit of the code as he uses the C99 standard and I don't know where to add flags when the arduino environment automatically compiles.  

I probably will just use the low level read/write routines although the fat16 would be interesting. Just wanted to use robust sd/mmc access routines.


As I understand, your files have some differences with the original from the Roland site. Do you have a link to your files , you've mentioned your commented your changes? When you mention the libraries and the problem on changing the extension from C to C++, what compiler are you using ? Not clear for me  when you said "Arduino environment automatically compiles" Are you referring to a dedicated Compiler IDE for Arduino which handles C and C++ ?? . Roland uses C Standard and your compiler uses C++ ?? The WinAvr does not have a library area I think you put all the files in one folder.

I may be making silly questions,  I've started to play with an atmega168 using WinAvr about one month ago and just now I am finding out about Arduino.

I will appreciate your comments . I've checked the exhibition area and downloaded your files , not yet sure whether they are the same as per your post I've quoted at the beginning of this reply.

Thanks a million in advance,

Jose

agent_orange

I used Rolands code. He uses a slightly different C standard which throws exceptions if you don't enable a flag in the compiler. If you place code into the library directory it automatically gets compiled into a new library. However, it won't compile if the files end with .c, only if they end with .cpp. So I just renamed them to .cpp. Rolands code should compile straight out of the box, however he uses a few pins for sensing a card insertion. These need to be disabled or the card won't read or write properly with the arduino.  

Fritz Brause

Hi there,

I have an arduino duemilanove with atmega 328 chip. I am not able to compile the SD-Card example, and get tons of errors. I guess the problem is in sd_raw.h as there is no definition of the atmega328 chip.

When I select another chip in the ide it does compile, of course I am then not able to upload....

Do you have a solution for this?

Thanks a lot, as I am really urgently in need to get the SD-Card working...


Thanks an best regards,
Marcel

T-888

Hey all
Recently i have been trying to setup an SD data logger based on the information give above by all of you. However when i copy and paste the code i recieve warnings where some of you have said this is good code and it works.
Here are the warnings I recieve when i am uploading:

                from C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:2:

C:\Program Files\arduino-0017\hardware\libraries\SDcard/sd_raw_config.h:86:6: error: #error "no sd/mmc pin mapping available!"

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:13: error: 'byte' does not name a type

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:16: error: 'byte' does not name a type

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp: In function 'void setup()':

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:22: error: 'Serial' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:23: error: 'delay' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp: In function 'void loop()':

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:39: error: 'Serial' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:41: error: 'incomingByte' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp: In function 'int sample()':

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:61: error: 'byte' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:61: error: expected `;' before 'low'

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:62: error: expected `;' before 'high'

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:63: error: expected `;' before 'inByte'

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:65: error: 'Serial' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:72: error: 'inByte' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:75: error: 'analogRead' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:76: error: 'DEC' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:80: error: 'low' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:81: error: 'high' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:86: error: 'tempBytes' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:94: error: 'delay' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp: In function 'int readDisk()':

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:106: error: 'byte' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:106: error: expected `;' before 'low'

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:107: error: expected `;' before 'high'

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:108: error: expected `;' before 'info'

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:111: error: 'Serial' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:114: error: 'info' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:119: error: 'low' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:120: error: 'high' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:124: error: 'DEC' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp: In function 'void printWelcome()':

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:132: error: 'Serial' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp: In function 'int print_disk_info()':

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:153: error: 'Serial' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:155: error: 'HEX' was not declared in this scope

C:\Program Files\arduino-0017\hardware\libraries\SDcard\arduino sd card example.cpp:161: error: 'DEC' was not declared in this scope

I don't understand what i am suposed to do. Can someone please help me!!!! :'(


T-888

Thanks but after i click the link what do i look at???

Osgeld

http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Go Up