SparkFun Forums 

Where electronics enthusiasts find answers.

Hardware or product specific questions are best asked here.
By stumax
Hi all,

I'm using an Artemis Openlog and Neo-M9N GPS board to make a GPS datalogger and have been using one of the SD examples for testing out writing to the SD card. I got that to work then copy/pasted the relevant sections into the code I had written to read the GPS board (which had been working perfectly). Now the SD card won't initialise. I thought I'd wrecked the SD card so I checked it and I can read/write to it in windows. I formatted it and then copied a small .txt file onto it to make sure and it works fine in windows explorer but it just won't initiallise. I went over and over the code and there was nothing added which could have messed it up, such as writing to it and not closing the file etc.

I then went back to the code I had working to test the read/write to the SD card and that card doesn't initialise in the code anymore. I took another SD card and it does. I'm hesitant to try this card in the GPS code as I fear I'll "wreck" it as well.

I'm wondering if there's something in the GPS library which could be interfering with the SD card stuff?
User avatar
By PaulZC
Hi Stu,
There's nothing in the SF GNSS library that could interfere with your SD card - either the older version of the library or the newer v2.0. The datalogging examples in v2.0 do log to SD card but they do that through the standard Arduino SD library. There is no SD functionality built-in to the GNSS library.
The main things to check are:
Have you enabled power for the SD card? (Have you replicated these lines: ... #L762-L766 )
Have you enabled the CIPO pull-up? (Have you replicated these lines: ... #L819-L832 )
It looks like the SD examples might be out of date. I don't see the CIPO pull-up code in there, so I'm hoping that's your issue.
I do plan to write a stand-alone datalogging example for the OLA - using the new v2.0 GNSS library - but it is still on the things to do list:
Best wishes,
By stumax
Hi Paul,

Thanks for the info. I fixed it last night. I re-formatted the SD card using a program I think was called "sdformat". This allowed that SD card to work in the SD test code.

I went back to my GPS datalogger code and found a silly error. I was closing the file at the end of the main loop (I did this so I could remove the SD card or kill power without corrupting the card) but not re-opening it each time, so it was opened once, written to, closed then repeatedly closed. It obviously didn't like this. Once I changed this I can now log the GPS data I need to the SD card, so it's all good. My application was to log GPS speed at at least 10Hz to log my sprinting speed whilst training, looks like it will do that for me.

Only thing is that if the GPS board loses power it takes at least 30 seconds to lock onto satellites again, which is a bummer as I would rather not have it powered up all the time for fear of running the very small lipo down too far.
User avatar
By PaulZC
Hi Stu,
Glad that is working for you.
The current draw from the GNSS RTC battery is tiny, 36 microamps on the NEO-M9N, but I understand your caution...
All the best,
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]