Click here to Skip to main content
15,889,909 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Does anyone know how to talk to a memory stick? Pin
Igor Coretti4-Dec-19 21:52
Igor Coretti4-Dec-19 21:52 
GeneralRe: Does anyone know how to talk to a memory stick? Pin
kalberts4-Dec-19 22:58
kalberts4-Dec-19 22:58 
GeneralRe: Does anyone know how to talk to a memory stick? Pin
Gary Wheeler5-Dec-19 1:58
Gary Wheeler5-Dec-19 1:58 
GeneralRe: Does anyone know how to talk to a memory stick? Pin
Tim Kirk5-Dec-19 3:20
Tim Kirk5-Dec-19 3:20 
GeneralRe: Does anyone know how to talk to a memory stick? Pin
FredWah5-Dec-19 11:07
FredWah5-Dec-19 11:07 
GeneralRe: Does anyone know how to talk to a memory stick? Pin
rjmoses5-Dec-19 12:51
professionalrjmoses5-Dec-19 12:51 
GeneralRe: Does anyone know how to talk to a memory stick? Pin
ACRowland5-Dec-19 23:17
ACRowland5-Dec-19 23:17 
GeneralRe: Does anyone know how to talk to a memory stick? Pin
bence9810-Dec-19 6:52
bence9810-Dec-19 6:52 
USB is complicated. Trust me. I would highly discourage you to implement your own.
That said, the protocol you're looking for is the USB Mass Storage CDC (Common Device Class). You're probably going to have to toush USB Attached SCSI as well.
If you want to do that though, this CH340 won't do, because it is a USB device and not a host. You'll need something with either a USB ROOT hub (like a RasPi), or USB OTG (I heard some AT90's and PIC16F's are capable of this, but I never found anything like that, so dunno).

You also don't "select" devices per se. When a USB device is connected, the USB hub sends you (the ROOT hub) a message. Let's say, it was hub #5. Then you instruct said hub to reset it. This will make the newly attached device assume an address of "5.0". Now, you send a GET DESCRIPTOR followed by a SET ADDRESS to USB address "5.0.0", which is the CONTROL endpoint of the new device. In SET ADDRESS, you give it a permanent address that it can use moving forward.
Now, why did I say you don't really "select" devices? Because, even though you can address individual devices, all attached USB devices will hear the ROOT's messages, and it is up to them to decide whether to activate or not. If you misconfigure a device and cause an address collision, you're screwed.

I could go on and on about USB, but I think you get the point: Don't Implement Your Own.
For your purposes, I'd use a SD/microSD card instead, as these can be used in SPI transfer mode, which is a cakewalk to implement, as opposed to the pain-in-the-backyard you're gonna have if you try to implement a USB host yourselves.

"I don't think about dying. It is the last thing I want to do. " - theoldfool
GeneralRe: Does anyone know how to talk to a memory stick? Pin
CodeWraith10-Dec-19 8:13
CodeWraith10-Dec-19 8:13 
JokeSometimes I Wonder .... Pin
Cp-Coder3-Dec-19 23:52
Cp-Coder3-Dec-19 23:52 
GeneralRe: Sometimes I Wonder .... Pin
honey the codewitch4-Dec-19 0:12
mvahoney the codewitch4-Dec-19 0:12 
GeneralRe: Sometimes I Wonder .... Pin
Cp-Coder4-Dec-19 0:14
Cp-Coder4-Dec-19 0:14 
GeneralRe: Sometimes I Wonder .... Pin
honey the codewitch4-Dec-19 0:24
mvahoney the codewitch4-Dec-19 0:24 
GeneralRe: Sometimes I Wonder .... Pin
Dan Neely4-Dec-19 4:52
Dan Neely4-Dec-19 4:52 
GeneralRe: Sometimes I Wonder .... Pin
Amarnath S4-Dec-19 0:21
professionalAmarnath S4-Dec-19 0:21 
GeneralRe: Sometimes I Wonder .... Pin
Cp-Coder4-Dec-19 0:25
Cp-Coder4-Dec-19 0:25 
GeneralRe: Sometimes I Wonder .... Pin
CodeWraith4-Dec-19 0:28
CodeWraith4-Dec-19 0:28 
GeneralRe: Sometimes I Wonder .... Pin
Amarnath S4-Dec-19 2:13
professionalAmarnath S4-Dec-19 2:13 
GeneralRe: Sometimes I Wonder .... Pin
honey the codewitch4-Dec-19 0:25
mvahoney the codewitch4-Dec-19 0:25 
GeneralRe: Sometimes I Wonder .... Pin
CodeWraith4-Dec-19 0:26
CodeWraith4-Dec-19 0:26 
GeneralRe: Sometimes I Wonder .... Pin
honey the codewitch4-Dec-19 0:51
mvahoney the codewitch4-Dec-19 0:51 
GeneralRe: Sometimes I Wonder .... Pin
CodeWraith4-Dec-19 1:19
CodeWraith4-Dec-19 1:19 
GeneralRe: Sometimes I Wonder .... Pin
F-ES Sitecore4-Dec-19 0:34
professionalF-ES Sitecore4-Dec-19 0:34 
JokeRe: Sometimes I Wonder .... Pin
Cp-Coder4-Dec-19 0:42
Cp-Coder4-Dec-19 0:42 
AnswerRe: Sometimes I Wonder .... Pin
lopatir4-Dec-19 2:19
lopatir4-Dec-19 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.