Is Deviceprint immpossible to make work?

I have tried nemerous things to make the DevicePrint demo to work(thanks sirmorris). You can find it here (Arduino Nut: Libraries). I am running arduino-0015 on Ubuntu Linux. I'm using this circuit: http://circuitfun.files.wordpress.com/2009/02/spi-to-usd.jpg?w=497&h=345. This is where I run into a snag:

uFat / DevicePrint Demo
2009 arduinonut.blogspot.com

Error Couldn't initialise microfat
uFat / DevicePrint Demo
2009 arduinonut.blogspot.com

Error Couldn't initialise microfat

I get this over the serial connection. As you can see I pressed the reset button but the same thing happens again.

I am desperate for help.

Thanks!!!

It worked first time for me. Where's the program stopping? IIRC the microfat startup can fail in 3 places, find out where it's stopping and that will tell you what the problem is.

git

Indeed.

Here's is a test sketch that should give some more information:

http://groups.google.com/group/micro-hacker/web/dptest.rar?hl=en

I have copied the library code into the sketch folder to make it easier to modify. Run the sketch and report what happens. It will not work with the libraries in place. Before you load the arduino-0015 gui and this sketch, DELETE OR MOVE THE FOLLOWING DIRECTORIES AND THEIR CONTENTS:

.\arduino-0015\hardware\libraries\microfat2
.\arduino-0015\hardware\libraries\mmc
.\arduino-0015\hardware\libraries\DevicePrint

Report back on what result you get.

C

When I go to compile the brown bar shows up but it does not say anything. What do I do?

Thanks!

Is the board connected? Is the serial port set correctly?

Can you tell us what you have done so far to find out why this is happening? That would help a lot. If you can say that the board is connected and the IDE can communicate then that narrows things down. Can you upload other sketches? Is there smoke coming from anything?

Its not on my arduino yet. I did what you said then I clicked the play button to make sure there was no errors and the brownish redish bar came up. But whats wierd is it said nothing.

Did you change the text in the sketch to try and induce an error?
Did you do anything other than click the play button?
Try setting the compiler to verbose output. The information is available on the main site on how to do this.

No, I didn't change the text at all. Yes, all I did was click the play button. I'll try the verbose output.

I turned on the verbose output but the same bar shows up. If sombody tells me how to upload a pic I will take a screen shot.

Good news!!!!
DevicePrint is not impossible to make work!!
Well at least with the arduino fourm.

This is what I got:
uFat / DevicePrint Demo
2009 arduinonut.blogspot.com

All initialised OK!
Writing...
Done!

And poof.

I did three things, first, in libraries I changed wconstants to WConstants as well as wprogram to WProgram. Second, I built sirmorris's circuit instead of some other thing. Third made sure there was a file on my SD card named data.txt and some data on it(I put 11mb of "B") on it. Thats it!!

Thanks sirmorris and everybody else!!!! :slight_smile:

Does anybody know how to make it write over the 512 bytes?

Does anybody know how to make it write over the 512 bytes?

You just keep writing strings. No other action is required. You can't write a string larger than 512 bytes in one go, as this would overflow the buffer.

Glad it's working for you!

C

Ok, I'll try it out. :slight_smile:

I am going to make a barcode datalogger. I need some help modifying the code.

The code link is at the bottom of the page:
http://www.arduino.cc/playground/ComponentLib/BarcodeScanner

If you are going to help me:
Please make the format like this:
728923845787
32587487238585945
23453245236467467
24523657756786
245
25645756756865
345734733567

You get the point, I want every scan to be on its own line like up there. And I want every error that might come up to flash an led continuously on digital pin 8. I want the same led to be lit whenever it can accept another scan(so the led turns off for about 500 ms and turn on again when it can accept another scan).

Thanks!!

Is anybody there?

You may get a better response if you focus on a specific problem that is standing in your way. Perhaps explain your ideas for how you want to interface the datalogger to the existing code and say how much you have done?

I think I am having similar issues writing to my SD card. DevicePrintDemo returns the following error:

"Error Couldn't initialise microfat"

I then tried the dptest.pde posted elsewhere (closing the IDE, removing the uFAT libraries from the library directory) and it worked.

I then moved the libraries from the dptest directory into the libraries directory and tried dptest again - it works.

I then retried DevicePrintDemo (with the dptest libraries) and it fails as above.

Then I modifed the section of DevicePrintDemo that throws this error to match the dptest code, as follows:

Original DevicePrintDemo code:

  if (!microfat2::initialize(sectorBuffer, &mmc::readSectors))
  {
    error_P(PSTR("Couldn't initialise microfat"));
  }

dptest code:

int ufres = microfat2::initialize(sectorBuffer, &mmc::readSectors);
  if (ufres != 0)
  {
    print_P(PSTR("Couldn't initialise microfat: error code "));
    Serial.print(ufres, DEC);
    error_P(PSTR("\r\n"));
  }

and the modified DevicePrintDemo works (still with the dptest libraries in the Hw/library directory).

Finally - I put the original uFAT libraries back into the HW/libraries directory... (drumroll) and now the modified DevicePrintDemo as well as dptest result in this error:
"Couldn't initialise microfat: error code 1Error "

If I change DevicePrintDemo back to the original code for checking this error - it now magically works. argh.

Question 1 - Are DpTest and DevicePrintDemo based on the same library code? Should they both work with the uFAT libraries in the library ZIP?

Question 2 - What is the difference between the two methods for initializing microfat? Why does only one work with the dptest library?

Question 3 - I have no idea why the DevicePrintDemo with the uFAT libraries started working after all of that. Let me know if you can explain.

I'm a beginner - any advice on uFAT debug or dealing with library issues is appreciated.

Hi,

I've been looking all over the internet for the best way to use SD Cards with an Arduino board and Sir Moris' uFat is the only method that has a clear approach on how to use it.

I had the device print method working on my arduino board but i tried to use it again but i keep getting the 'couldn't initialise microfat' error as above. I tried using the dptest and get the error code 3Error.

Would someone be able to help me solve this problem as i'm new to the Arduino platform and have already scoured the internet for solutions but to no avail. I would really appreciate any advice, suggestions or solution as i've spent several days trying to sort it out.

Thanks in advance!

Have you looked at this Fat16 library?

http://code.google.com/p/fat16lib/

I moved over to it and have been successful so far.

-RB