Pages: [1]   Go Down
Author Topic: 1284p and SD datalogging  (Read 1799 times)
0 Members and 1 Guest are viewing this topic.
Memphis, TN
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to use the standard example in the arduino IDE under example>SD>read/write.  I have an SD module hooked up correctly to a 1284P but No serial communication pops up when I run the example sketch. Does anyone have a library + example for  SD compatible with the 1284P, or any debugging tips?

I tried opening the pin map H file in AVR and adding the 1284p to the existing 644p code but no dice. My assembly knowledge is geared toward motorola and not avr so talk to me like a newbie please.
Logged

I'm not a newbie I just lurk a lot.

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1656
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SD.h is based on an very old version of SdFat.  I wrote SdFat but no longer support the version used as the base for SD.h.

You might want to try the latest version of SdFat.  Except for Software SPI, it uses the pin definitions in the Arduino hardware/variants folders so no edits should be needed for hardware SPI.

You probably won't use Software SPI.  For the 1284P, Software SPI uses the Sanguino pin map.

SdFat is here http://code.google.com/p/sdfatlib/downloads/list.
Logged

Memphis, TN
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it seems that every example in the librarys will not compile here is a list of errors


SdFatAppend.pde:-1: error: 'SdFat' does not name a type
SdFatAppend.pde:-1: error: 'SdFile' does not name a type
SdFatAppend.cpp: In function 'void setup()':
SdFatAppend.pde:-1: error: 'PgmPrintln' was not declared in this scope
SdFatAppend.pde:-1: error: 'sd' was not declared in this scope
SdFatAppend.pde:-1: error: 'SPI_HALF_SPEED' was not declared in this scope
SdFatAppend.pde:-1: error: 'PgmPrint' was not declared in this scope
SdFatAppend.pde:-1: error: 'file' was not declared in this scope
SdFatAppend.pde:-1: error: 'O_CREAT' was not declared in this scope
SdFatAppend.pde:-1: error: 'O_APPEND' was not declared in this scope
SdFatAppend.pde:-1: error: 'O_WRITE' was not declared in this scope
SdFatAppend.pde:-1: error: 'sd' was not declared in this scope
SdFatAppend.pde:-1: error: 'file' was not declared in this scope
SdFatAppend.pde:-1: error: 'file' was not declared in this scope
SdFatApp
Logged

I'm not a newbie I just lurk a lot.

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1656
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like the SdFat folder is not in the libraries folder of your Arduino folder.

In my case on Windows 7 this is C:\Users\bill\Documents\Arduino\libraries\SdFat.

The SdFatAppend.pde is a very old example for backward compatibility tests.

Newer examples are in the SdFat/examples folder.

On Windows 7 this is C:\Users\bill\Documents\Arduino\libraries\SdFat\examples.

The new version is append.ino in the examples/append folder.
Logged

Memphis, TN
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the library folder and the SD folder. It seems right. What should I move?


* lib folder.png (251.1 KB, 1024x600 - viewed 53 times.)

* sd folder.png (250.79 KB, 1024x600 - viewed 53 times.)
Logged

I'm not a newbie I just lurk a lot.

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1656
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Read this first http://arduino.cc/it/Reference/Libraries.  SdFat is a Contributed Library.

Also read this arduino.cc/en/Guide/Environment.  It explains where things are.

Once again, install the SdFat folder in the libraries sub-folder of your sketchbook folder.

Quote
To install third-party libraries, create a directory called libraries within your sketchbook directory. Then unzip the library there. For example, to install the DateTime library, its files should be in the /libraries/DateTime sub-folder of your sketchbook folder.

Please learn the basics of Arduino.  There are many articles on installing libraries.  Google for "installing arduino libraries".
Logged

Memphis, TN
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please learn the basics of Arduino.  There are many articles on installing libraries.  Google for "installing arduino libraries".

I spend hours trying to find the solution before I post in the forums. I assumed there was a problem with the code/new IDE/Countless others. Thank you for pointing me in the right direction and showing patience for someone who is still attempting to apply their knowledge to the basics of Arduino. It was a silly mistake assuming that a library goes in the library folder. Its the simple ones that get you every time after all smiley-cool

Thanks again.

Logged

I'm not a newbie I just lurk a lot.

Memphis, TN
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For the lurkers- The newest library for SD located at http://code.google.com/p/sdfatlib/downloads/list does work for a atmega1284p bread boarduino.

Just make sure you give it 30-40 seconds to ask for confirmation in the serial monitor(append sketch). I didn't realize how slow the communication was, which is probably why I thought the old SD library did not work. Attached is proof. I'll cite help from fat16lib in my report.

Thanks again for the help


* SD Solo Code pic.png (138.62 KB, 1024x600 - viewed 59 times.)
Logged

I'm not a newbie I just lurk a lot.

Pages: [1]   Go Up
Jump to: