Show Posts
Pages: 1 ... 70 71 [72] 73 74 ... 99
1066  Using Arduino / Storage / Re: SD card became unrecognized by card readers on: January 18, 2012, 10:56:29 am
No mike, SD cards don't fail due to removal while powered on.  Billions have been made and people pull them from powered on devices all the time.

Look at the pins.  Power and ground are a bit longer than the signal pins so first the signal pins disconnect then power.

Here is the quote from the spec:
Quote
Hot Insertion
Support for hot insertion will be required on the host but will be supported through the
connector. Connector manufacturers will provide connectors that have power-pins long
enough to be powered before contact is made with the other pins. This approach is similar
to that used in PCMCIA and MMCA devices to allow for hot insertion.

The SD buffers the entire block internally before writing to flash.  It does the flash programming in a fail safe way.  It either completes correctly or the block is not marked as written if power fails.

Pulling a card can cause the file system to become corrupt but does not damage the card.
1067  Using Arduino / Storage / Re: SD card became unrecognized by card readers on: January 18, 2012, 08:32:21 am
Guess your card failed.

 It is rare for a card to fail, and your card is the first I have seen that responds to CMD1, set SPI mode, and doesn't respond to ACMD41.

ACMD41 is the command that switched the card from card identification mode to data transfer mode.  Your card just stays busy and times out.
1068  Using Arduino / Storage / Re: SD card became unrecognized by card readers on: January 17, 2012, 06:58:22 pm
al_ra,

Your SD module must have 5V connected to the external pin since it has a series regulator.

I was worried that something was wrong with the module's power regulator since the SD card failed the step that verifies the correct operating conditions.  A key condition is that Vcc is in range (usually 2.7 - 3.6 volts).

Your failing card responds to the command to use SPI mode but does not accept the initialize command. It does not go ready so it will not accept any further commands.

Since another card works, Vcc must be OK and it must be an internal problem with the card.  I don't know of any way to fix it since It won't accept most commands.

Did you try other devices like a PC/Mac or camera again?  These devices have the 4-bit SD bus and one of these might be able to send commands to the card.  They use a slightly different protocol than the Arduino with its SPI bus.
1069  Development / Other Software Development / ChibiOS/RT 2.2.8 RTOS update on: January 17, 2012, 04:51:26 pm
I have updated the ChibiOS/RT library to version 2.2.8. 

This library is a simple way to use the ChibiOS/RT RTOS on 328 and Mega Arduinos.

I have added a function to determine the amount of unused stack space for each thread and an example, chStackUse, to demonstrate analysis of thread stack use.

The download is ChibiOS20120117.zip at http://code.google.com/p/beta-lib/downloads/list.
1070  Using Arduino / Storage / Re: Text file on SD to String on: January 17, 2012, 02:30:59 pm
If you want to read characters from a file and copy characters to Serial you want write not print as PaulS suggested.

Code:
  Serial.print(statusFile.read());

Will print the characters as int.
1071  Using Arduino / Storage / Re: Text file on SD to String on: January 17, 2012, 02:17:43 pm
statusFile.read() returns an int.  Try casting it to a char.

Code:
  SD_Read=SD_Read + (char)statusFile.read();

1072  Using Arduino / Storage / Re: SD card became unrecognized by card readers on: January 16, 2012, 04:30:49 pm
Since we don't have a circuit diagram for you module, I can't be sure if it is OK.  If possible measure the supply voltage as described below.

If your card is a real SD card then error code 0Xa with error data 0x1 may mean that the supply voltage to the card is out of range.  

During initialization, cards operate in a safe mode and won't go ready without the correct voltage.  Most SD cards work with Vcc in the range 2.7 to 3.6 volts.

Look at the diagrams in this article http://elm-chan.org/docs/mmc/mmc_e.html to see which SD pin has Vcc and measure the value of Vcc.

For an SD card there should be 9 pins and Vcc is the middle pin.  Pins are numbered in a strange way for historical reasons.

Edit: On your module it appears that the Vcc pin connects to the yellow cap near the regulator.

1073  Using Arduino / Storage / Re: SD card became unrecognized by card readers on: January 16, 2012, 03:38:44 pm
I posted a link to that module because it was the same seller that sold your module and had a circuit diagram.  The seller claimed that the module was for an Arduino but in fact that module should not be used with a 5V arduino. There was no circuit diagram for your module so I had no reason to believe your module is correct.

Your card fails in a strange way for an SD card.  The only time I have seen error code 0x0a is for a MMC card.  SD.h and SdFat do not support MMC cards.

Your card is not dead but it does not respond as expected for an SD card.

1074  Development / Other Software Development / Re: Fast alternative to digitalRead/digitalWrite on: January 16, 2012, 02:51:42 pm
You got the point exactly. 

Often what looks great in C/C++ code doesn't optimize well for I/O on AVR chips. 

avr-gcc seems to really understand single bit operations.  Sometimes it does really stupid things with more complex cases.

I am now doing a very general bit-bang SPI implementation for all SPI modes.  I get a factor of four speedup by simple changes that make the compile so what I expect.
1075  Using Arduino / Storage / Re: SD card became unrecognized by card readers on: January 16, 2012, 02:03:15 pm
Exactly how is the SD module connected to the Arduino?  Which pins on the module to which pins on the Arduino.

Post the output from running the CardInfo example from SD.h using Arduino 1.0.

If possible download SdFat and run the examples QuickStart and SdInfo.   Post the output from each program.

http://code.google.com/p/sdfatlib/downloads/list

Edit: I just noticed that the module pictured on ebay has resistor level shifters.  Some SD cards don't work well with resistor level shifters since newer cards require very fast rise times on the SPI signals.  Many newer cards use edge detectors for the SPI signals.

Using resistor level shifters instead of semiconductor level shifters won't hurt the SD card but may cause I/O errors at higher SPI speeds.

It looks like the regulator has a cap on the 3.3V that it supplies to the card.

Edit again:  Looks like some of the modules do not have resistor level shifters, just pullups to 3.3V.  The signal pins are connected straight to the Adduino which could ruin an SD.

http://www.ebay.com/itm/SD-Card-Reader-Module-Arduino-ARM-Read-and-Write-/200659790559?pt=LH_DefaultDomain_0&hash=item2eb8416adf
1076  Using Arduino / Storage / Re: SD card became unrecognized by card readers on: January 16, 2012, 12:14:11 pm
About the only way to harm an SD card is to put too much voltage on a pin.

We should be asking about the user's hardware setup.

Also it would be good to have output from a program like CardInfo from the Arduino 1.0 SD.h library.

Another option is output from QuickStart or SdInfo from my SdFat library http://code.google.com/p/sdfatlib/downloads/list.
1077  Using Arduino / Storage / Re: SD card became unrecognized by card readers on: January 16, 2012, 11:55:30 am
Mike,

The flash controller in an SD card is a very sophisticated device with a powerful micro-controller.  It doesn't work in the simple way you describe.
 
The same block is not rewritten.  The SD card's flash controller maintains a pool of erased blocks. when you write a block of data it uses an new block.

The Mac is not a PC so it is not that good at FAT file systems with MBR partition tables. 

I wrote SdFat, the base library for SD.h and get a lot of e-mail about problems the Mac causes.  Once an SD is formatted GPT, even a PC won't restore it to MBR.

That is why I wrote the SdFat SdFormat program.  So you can recover a GPT formatted SD.

There are other problems with OS format utilities.  Flash in SD cards have very large, 128KB or more, erase groups so file structures should be aligned on these for best performance.  PC and MAC generic format utilities don't do this.

Here is a quote from the SD Assoication:
Quote
The SD Formatter was created specifically for memory cards using the SD/SDHC/SDXC standards. It is strongly recommended to use the SD Formatter instead of formatting utilities provided with operating systems that format various types of storage media. Using generic formatting utilities may result in less than optimal performance for your memory cards.
1078  Using Arduino / Networking, Protocols, and Devices / Re: Very basic SPI (and C++?) questions on: January 16, 2012, 08:54:14 am
You can enable or disable warning from the 1.0 IDE.

Select preferences from the file menu.  Check "Show verbose output during: compile".

This will cause warnings to be listed in red during compile.
1079  Using Arduino / Storage / Re: SD card became unrecognized by card readers on: January 16, 2012, 08:42:50 am
You can't wear out an SD card by writing with an Arduino.  The card's controller has wear leveling.  When the SD library writes to a file, it writes an entire block.  The card's SD controller does a physical to logical mapping to prevent any block from being written too many times.

The controller also handles bad blocks by only mapping good blocks.

Interrupting power during write will at most cause data in that block to be bad.  The card should still be OK.

You could kill the card by putting 5V on its pins.  SD card are 3.3V devices.

Also don't format the card with your format utility.  PCs and especially Macs don't format SD cards according to the SD standard.  If possible use the SD associations format utility https://www.sdcard.org/downloads/formatter_3/.

A Mac may format a card with GPT format instead of MBR format.  Since GPT is not part of the SD standard, many devices don't recognize GPT formatted  SD cards.  Here is an article about GPT http://en.wikipedia.org/wiki/GUID_Partition_Table

You can also correctly format an SD card using the SdFat SdFormatter example.  SdFat is located here http://code.google.com/p/sdfatlib/.

The Arduino SD.h library is based on an old version of SdFat.

1080  Using Arduino / Storage / Re: Ethernet SD Wont recognize on: January 15, 2012, 04:25:42 pm
SdFat and several other libraries now initialize the SPI bus before every access, setting speed and mode.  The overhead is small and sharing the SPI bus works much better.

Unfortunately SD.h is based on a very old version of SdFat that has a number of bugs and problems.  The Arduino developers never contact me and are maintaining SD.h so my bug fixes and mods never get into SD.h.
Pages: 1 ... 70 71 [72] 73 74 ... 99