Uart to usb converter to interface pendrive to microcontroller - Page 1
Forum section: electronics / beginners

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: July 28, 2024, 04:52:14 am
content: A) I am using Microntroller which do have usb interface. & have to connect pendrive to store data.Dont want to change the MCU, as its lots of other codeB) Is there any uart to usb converter?Issue is most of uart to usb converter makes MCU as device & PC remains as hostC) While in pendrive case, Microntroller has to be usb host.Is there any uart to usb converter for this kind of application?

author: Nominal Animal
author_rank: Super Contributor
timestamp: July 28, 2024, 05:27:15 am
content: If by "pendrive" you mean USB Mass Storage Device, then you need USB Host with Mass Storage capability.In the Arduino land,Maxim MAX3421E-based USB Host Shields are common, as there is anUSB Host Shield Libraryfor these. They use SPI and not UART, though.It would be easier to interface to microSD (also known as "T-Flash"/"TransFlash"/"TF"), as they can be accessed usingSPIusing 3.3V logic level signaling. If your microcontroller uses 5V, 2.5V, or 1.8V logic levels, I recommend using aTXU0304voltage level translator between your microcontroller SPI pins and the microSD card. This way, you only need to add filesystem (FAT16/FAT32/exFAT) support to your microcontroller to get everything working; the USB Host approach needs that plus all the USB Host stuff too. I recommend you take a look at the MIT-licensed ArduinoSdFatlibrary for the filesystem support on a microcontroller, even if you do not develop in an Arduino-compatible environment.

author: Psi
author_rank: Super Contributor
timestamp: July 28, 2024, 05:43:30 am
content: Depending on application you might want to consider adding a large capacitor and ideal diode.Have a circuit so you can detect that the power has failed before the MCU and SD actually lose power and finish the write buffer, or at the very least, block any new SD writes from starting.

author: ebastler
author_rank: Super Contributor
timestamp: July 28, 2024, 07:03:37 am
content: Quote from: Vindhyachal.takniki on July 28, 2024, 04:52:14 amI struggle to understand what you are planning to do. What is a "pendrive" which comes with a UART interface? Could you provide a link?In general, a USB-to-UART converter expects to be connected to a USB host. The host can be a PC, or the host can be a microcontroller. You will need a suitable USB protocol stack (library) running on the microcontroller.

author: LinuxHata
author_rank: Frequent Contributor
timestamp: July 28, 2024, 07:49:04 am
content: There are a lot of such devices.On the one end you have USB A socket, where you connect flash drive, and on the other side you have the serial interface, from which you can control your flash drive - create folders, write-read files, etc. Simple, DOS-like command interface.There are several such solutions from FTDI (Vinniculum) and chinese makers (CH375 if not mistaken).Parallax also sold such device, based on FTDI chipset, but as usual for them, with rad-hard pricing, so no longer making it, it was called "memory stick datalogger"https://www.ebay.com/itm/266449828221here's one. I've bought it but never used, but I do used one from Parallax about 10 years ago and it worked fine.

author: voltsandjolts
author_rank: Unknown
timestamp: July 28, 2024, 08:04:59 am
content: This one works well, UART interface to Flash drive.https://www.hobbytronics.co.uk/You can buy just the chip in DIP/SOIC/TSSOP form, or a small dev board.

author: radiolistener
author_rank: Super Contributor
timestamp: July 28, 2024, 04:39:39 pm
content: Quote from: Vindhyachal.takniki on July 28, 2024, 04:52:14 amYes, there are a lot of different usb-uart converters, just google "usb-ttl converter".It's better to buy these which has 3.3V/5V switch, so you can use it with different circuits.I suggest to buy something like CH340 instead of FT or PL, because there are a lot of fake FT and PL Chinese chips, so its better to use fair Chinese chip than some fake with problematic drivers.For example:https://www.aliexpress.com/item/1005002532479020.html

author: DavidAlfa
author_rank: Super Contributor
timestamp: July 28, 2024, 06:06:16 pm
content: Have you thought on using SD card instead?Easily interfaced through SPI, plenty of libraries on github, FatFS is pretty easy to use, and no extra hardware required.You might need some extra RAM (About 1K) for the different variables and buffers.