but to access the logged file would be troublesome if i have to open the box and seal it again over and over.
I want to access it using USB as a mass storage device, or SDHC so i can copy the file as much as format the SDHC.
The plan is to put an IC (still don’t know what IC to use) in parallel with the SPI interface of Black pill.
Really need some tips and enlightenment from you guys
Thanks
https://www.integralmemory.com/faq/card … d-sd-cards
Andy Hull, if I recall correctly, has built outside, weatherproof projects for the Highlands…
http://stm32duino.com/viewtopic.php?t=380
Ray
[mrburnette – Wed Sep 26, 2018 4:13 pm] –
You will need to “qualify” your own high-speed SD cards …. some will not (likely) work:
https://www.integralmemory.com/faq/card … d-sd-cardsAndy Hull, if I recall correctly, has built outside, weatherproof projects for the Highlands…
http://stm32duino.com/viewtopic.php?t=380Ray
I’m currently using SHC class 10
[Blitzyohoo – Thu Sep 27, 2018 2:10 pm] –
…
I’m currently using SHC class 10
… and that is with your data logging software AND the black pill? If so, that is fantastic.
Ray
We can apply good engineering judgement to every problem. Data logging is no exception. Personally, I hate using a monolithic uC program to deal with the sensor, math, translation, interrupts, and SD datalogging. This is far better done, except low power, by a RPi_Zero-W… Available for $5 from MicroCenter here in Atlanta and throughout the U.S. …just the price is for walk-in and not mail-order.
With an RPi, the SD interface is part of the board. Data can be written on the user partition or a separately mounted system. It is a full Linux OS, with WiFi + BT. I’m sorry to make fun of the Arduino SD library, but it has issues; not so with an RPi. Buffer data, grind data, transmit data, ZIP data, are all available. Being Linux, the migration path is seemless…. RPi3B+… which is 6x more pricy at $30, but it has serious computing hardware capabilities with multicore processor, 1G RAM, HDMI, etc. Prospective: the Due is $15.
We all really must extend our thinking. Arduino is a microcontroller environment. Sometimes, we meet to move into a microprocessor world. An old notebook with s serial port running DOS could datalog for a long, long time and the code is just 2 lines in autoexec.bat to set the mode and redirect the serial to a file.
Think.
Ray
[Blitzyohoo – Thu Sep 27, 2018 2:10 pm] –[mrburnette – Wed Sep 26, 2018 4:13 pm] –
You will need to “qualify” your own high-speed SD cards …. some will not (likely) work:
https://www.integralmemory.com/faq/card … d-sd-cardsAndy Hull, if I recall correctly, has built outside, weatherproof projects for the Highlands…
http://stm32duino.com/viewtopic.php?t=380Ray
I’m currently using SHC class 10
If you are accessing the cards via a standards SPI bus then the class of the card has no impact on the performance as this refers only to the performance in parallel bus mode. (moderator edit to bold font)
[asmallri – Sat Sep 29, 2018 7:04 am] –
…
If you are accessing the cards via a standards SPI bus then the class of the card has no impact on the performance as this refers only to the performance in parallel bus mode.
Wow… I had forgotten that … If I even knew it at all
Actually, I did know it but knowledge recall and coffee consumption are directly related.
An interesting read: https://en.wikipedia.org/wiki/Secure_Di … cification but, the gist is: The SPI-bus interface mode is the only type that does not require a host license for accessing SD cards.
Note the SD Bus Mode column:

Now, from http://elm-chan.org/docs/mmc/mmc_e.html
This document describes about SPI mode to control the MMC/SDCs. The SPI mode is an alternative operating mode that defined to use the MMC/SDCs without a native host interface. The communication protocol of the SPI mode is a little simple compared to its native operating mode. The MMC/SDC can be attached to the most microcontrollers via a generic SPI interface or some GPIO ports. Therefore the SPI mode is suitable for low cost embedded applications with no native host interface is available. There are four different SPI modes, 0 to 3, depends on clock phase and polarity. The SPI mode 0 is defined for SDC. For the MMC, it is not the SPI spec, both latch and shift operations are defined with rising edge of the SCLK, but it seems to work at mode 0 at the SPI mode. Thus the SPI mode 0 (CPHA=0, CPOL=0) is the proper setting to control MMC/SDC, but mode 3 (CPHA=1, CPOL=1) also works as well in most case. A pull-up on the DO cannot be omited, or some cards will fail initialization process.
[asmallri – Sat Sep 29, 2018 2:41 pm] –
I have tested lots of different brands of cards and a lot of speed ranges per brand and one of the highest performing in SPI was also the cheapest class less cards. I found the price of the card and the performance class class of the card to be unrelated to their performance in SPI mode.
Valuable knowledge for uC’ers…
Thanks,
Ray
do be aware that sd card could be pretty high current consumers, hence if you are running off a ‘low end’ ldo power may be a bottleneck, but thus far, they seem to just work for low rate logging
usb mass storage is more to do with your sketch e.g. if you would integrate the usb-mass storage lib. things can be tricky though as when the stm32 is doing mass storage, it is reading blocks of data and they could be cached on the host pc. if you have written your sketch to do ‘cycle stealing’ i.e. writing to the sd card and reverting to usb mass storage in between the images are actually not consistent with one another e.g. what you wrote into the sd card from stm32 may be different from that retrieved by the host via usb storage. you may need to do things like check for ‘in-use’ status (i.e. the host is connect and reading/writing) and only do the logging when usb-storage is not-in-use which may be somewhat complicated
