TinyCircuits Forum

General Category => General Discussion => Topic started by: jgavlik on April 24, 2021, 07:32:57 PM

Title: MicroSD TinyShield Problem
Post by: jgavlik on April 24, 2021, 07:32:57 PM
I have a MicroSD TinyShield  along with a TinyZero Processor Board.

Do these work together?   

The reason for asking is because the MicroSD indicates pinouts for the TinyDuino Processor Board  and not the TinyZero.

Is there a compatibility issue with the Arduino built-in SPI.h as nothing seems to work in terms of reading and writing to the micro SD card.

Any help will be appreciated.


Title: Re: MicroSD TinyShield Problem
Post by: WillemH on April 25, 2021, 02:57:01 PM
Hi John,

The microSD shield worked fine with TinyZero in the applications I have tried.

Herewith a few suggestions.

Important to include SD.h , initialize the SD card, define the file etc. I have used the “Rocket Altimeter Logger” example under the Projects tab as starting point.

If you have more users of the SPI bus it is important to define the ChipSelectN of the users as output and to make these high before first use. See also the topic “NRFL01+ 2.4 GHz Radio Shield / Documentation missing” in this Forum.

The microSD card can sometimes give a significant delay when it is busy with internal things and you try to access it.

To minimize this delay I would advise to use a buffer and check the availability of the microSD card for writing. The TinyZero normally has sufficient memory space for such a buffer in contrast with the TinyDuino. See the example sketch “NonBlockingWrite” in the examples under “SD” in the Arduino program for the principle.

Title: Re: MicroSD TinyShield Problem
Post by: lennevia on April 26, 2021, 12:13:07 PM

To build off of Willem's comment, it may be the wrong chip is being selected (should be selecting 10). Have you tried the Micro SD Shield tutorial?: https://learn.tinycircuits.com/Memory/MicroSD_TinyShield_Tutorial/

I apologize for any confusion with the pinout description on the product pages. In many places where any of the processor's names could be used, "TinyDuino" is used to refer to the entire TinyDuino line of products that snap together with the 32-pin tan connector. This is sort of a legacy problem since the TinyDuino was our first processor and we call the line of products built around it the "TinyDuino platform". It was definitely a source of confusion to me early on and I'm sure many users face the same problem.  I will add this to my to-do list for website improvements. Do (either of) you have any other suggestions or anything that you have found confusing or could be improved for clarity?

Let me know!
Title: Re: MicroSD TinyShield Problem
Post by: jgavlik on April 26, 2021, 03:40:02 PM
Thanks All,

Yes...I'm using pin 10 for CS and, also, about the tutorial.

But it looks like I "may not" be giving it sufficient time to respond.

I'll let you know.

Title: Re: MicroSD TinyShield Problem
Post by: jgavlik on April 28, 2021, 12:12:53 PM

After some preliminary model rocket tests, I'm dropping the SD Card in favor of your EEPROM shield.

The reason is that the SD Card can't seem to handle vibration or shock in a model rocket application, while (I assume) the EEPROM shield will (I haven't tried it yet).

While the memory size of the EEPROM is far less than the SD Card, the demanding need is for reliable data storage, which I hope the EEPROM will provide.

I'll get back to the SD Card for other applications, so thanks for all your advice and suggestions about this device!

Title: Re: MicroSD TinyShield Problem
Post by: wdb2021 on May 10, 2021, 12:29:16 AM
I think reading and writing to the micro SD card shouldn't be any problems.
Title: Re: MicroSD TinyShield Problem
Post by: WillemH on May 18, 2021, 11:33:40 AM
Hi John,

you mentioned  potential problems of the microSD shield and/or microSD card in coping with vibration or shock in a model rocket application.

Last week I had the first opportunity this year to launch again.
I have launched two different model rockets, a smaller one (35 mm diameter) with one microSD logger in the nose cone payload section and a bigger one (75 mm diameter) with microSD loggers both in the nose cone and the central area between the 4 motors of the cluster.
Highest accelerations are faced during launch, ejection of the nose cone and landing. Also a lot of vibration during descent on parachute(s).

No problems occurred with the loggings as was expected from previous experience with  > 30  launches of model rockets with microSD loggers.

Title: Re: MicroSD TinyShield Problem
Post by: jgavlik on May 24, 2021, 04:46:34 PM
Willem  et al,

The Rocket Performance Monitor (RPM1) now has the TC eeprom shield for data storage....and it works great! 

During each rocket flight the data (21 separate items) are saved to eeprom for later review on the attached OLED.

Altitude and acceleration data are automatically output for all recorded flights via the USB link to your favorite spreadsheet (CSV output).

The main advantage of going with eeprom rather than the SD Card are:

1.  You don't have to take it out of the rocket (and maybe lose it).

2.  EEProm is cheaper than an SD Card.  Rocket people are price sensitive (so I've found).

Anyway, I've still got a couple of SD Card boards  + SD cards and I'm sure I'll find a use for them eventually, maybe even for the rocket application. 

And the eeprom worked out better than expected.

Thanks for all your help and advice!