Micro SD card reader question - Page 1
Forum section: electronics / beginners

author: Lucky-Luka
author_rank: Unknown
timestamp: May 14, 2022, 09:44:08 am
content: Hi allI have bought a micro SD card reader for an ARduino project.https://www.amazon.it/AZDelivery-Reader-Memory-Shield-Arduino/dp/B077MCR2RC/ref=sr_1_1_sspa?__mk_it_IT=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=386N3KUPHDD75&keywords=micro+sd+card+reader+arduino&qid=1652517119&sprefix=micro+sd+card+reader+arduinpo%2Caps%2C84&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUE4Q1lMUzA2UDFSOUMmZW5jcnlwdGVkSWQ9QTAwMzg0MTBWTVNGSVVGUDhUNVAmZW5jcnlwdGVkQWRJZD1BMDkzMDk5Mk5ITU1NNExHM01NWiZ3aWRnZXROYW1lPXNwX2F0ZiZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU=I have noticed 2 IC on it:AMS1117 that is a voltage regulator to have 3.3V on data linesVHCT125A that should be a bufferhttps://www.onsemi.com/pdf/datasheet/mc74vhct125a-d.pdfWhy is this buffer needed? What does it do? I have seen SD cards directly connected to Arduino.https://arduino.stackexchange.com/questions/84630/proper-micro-sd-card-schematicThanksp.s.I have found a possible answer:https://lastminuteengineers.com/arduino-micro-sd-card-module-tutorial/There’s also a 74LVC125A chip on the module which converts the interface logic from 3.3V-5V to 3.3V. This is called logic level shifting. That means you can use this board to interact with both 3.3V and 5V microcontrollers like Arduino.If that is true I wonder how this Chip can understand the voltage of the MISO MOSI pins of my ARduino board.Moreover if this board would be connected directly to a 3.3V Arduino, this buffer/voltage shifter wouldn't be necessary, right?

author: magic
author_rank: Super Contributor
timestamp: May 14, 2022, 10:25:37 am
content: Yes, that's what it is.SD cards are not supposed to be powered from 5V or driven by 5V signals when operating at 3.3V. Once upon a time I have accidentally powered a Kingston SD card at 5V and it worked, but it could fail after prolonged time and other cards might fail instantly.Any direct connection between SD and a 5V MCU is dodgy. Some SD breakout modules don't include the buffer, only a regulator, and are intended to work with 5V - they are dodgy.If you have a 3.3V Arduino, the buffer and the regulator can be omitted.

author: tepalia02
author_rank: Regular Contributor
timestamp: May 14, 2022, 10:32:47 am
content: What you've already written above is right. Here you'll find a broader explanation:https://lastminuteengineers.com/arduino-micro-sd-card-module-tutorial/

author: Lucky-Luka
author_rank: Unknown
timestamp: May 14, 2022, 11:43:11 am
content: Quote from: magic on May 14, 2022, 10:25:37 amSo this Chip can accept both 3.3V and 5V from the GPIO pins and gives data to the SD card at 3.3VMoreover this chip only sends 3.3V signals to the GPIO pins.Is it like this?

author: Peabody
author_rank: Super Contributor
timestamp: May 14, 2022, 03:02:51 pm
content: Yes. 3.3V into a GPIO pin is high enough to be recognized as HIGH, so it doesn't need to be boosted to 5V. This appears to work reliably.You should be aware that most such modules have a bad design feature which causes problems when more than one SPI device is connected. The circuit has the MISO output of the SD card going through the 125A translator. That means the MISO coming out of the module is always actively driven, either high or low. But MISO is supposed to go Hi-Z when the card's CS pin is not selected. That allows each SPI device to have exclusive access to MISO when it is selected. So these modules work fine when they are the only SPI device, but not when there is another SPI device. The solution is to connect the card's MISO pin directly to the module output, bypassing the 125A. I believe the Adafruit version of this module does that correctly, but most from the Far East do not.

author: magic
author_rank: Super Contributor
timestamp: May 14, 2022, 07:35:27 pm
content: Quote from: Peabody on May 14, 2022, 03:02:51 pmThere are specs for that.For example, ATmega32U4, electrical characteristics:VIH- input high voltage (except XTAL1 and RESET) - 0.2·VCC+0.9V minimumThis means that ATmega32U4 is actually guaranteed to recognize 1.9V and more as "high" input on most pins when running at 5V.A word of caution: there are separate characteristics for some peripherals which have their own input digitizing circuitry. Apparently TWI is one of them, but I don't see anything like that for SPI.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 18, 2022, 12:52:44 am
content: The datasheet:https://assets.nexperia.com/documents/data-sheet/74LVC125A.pdfspecifies that it recognises a voltage as "high" when it is above 1.08V.There are many different logic families, and these days CMOS based stuff is most common (Except for extremely high speeds) and each logic family has it's own characteristics.A few years ago I was building my own CNC Machine, first with a Beaglebone Black and Machinekit (mostly gone the way of the dodo) and later with an STM32 and GRBL. Both the BBB and STM32 have quite fragile 3V3 outputs, so I put them through an good old 74LS244 to drive long wires to external stepper motor drivers. 74LS244 is powered by 5V, but in those old TTL IC's the voltages did not reach the positive rails and a 3V3 CMOS output is compatible with a TTL-LS input.When interfacing between different logic families you always have to check carefully whether the combination you use is compatible, and add level shifters if needed, but they are not always needed.