Hi
I could find a lot of sample codes which are just based on USB device or just USB Host, But I need to connect an USB Flash card to MCU through USB Host and at the same time I need to connect MCU as a device to PC.
With this way I should connect data between Flash card to PC as a Mass storage device by firmware (I don't know OTG can helps me or not?).
For example if you connect this device to PC you can see a removable device which is exactly that Flash card on USB host of MCU.
Besides, my MCU is LPC2478 or LPC2388.
How could I implement such a project?
Thanks in advance
Either your english is very bad, or you really have misunderstood a lot.
Many processors can be host on one USB interface and device on another USB interface.
But it isn't trivial to just tunnel USB commands through that processor and just ignore the USB device side and the USB host side. You still have physical USB device and host controllers in the chip, and these controllers needs to be handled. What do you think happens if you disconnect the USB thumb drive? The host controller needs to handle the device disconnect. But at the same time, you need to take care of the failure to tunnel commands that the USB device controller may receive from a PC.
When you do get help, don't tell the helpers they are wrong. Especially when the helper does know whay more than you do about USB communication.
Don't blame this forum for your inability to see all aspects of your problem.
If you do want to tunnel without caring about any host or device controller, then you really must disconnect the USB controllers in the processor and just wire the USB thumb drive to the PC. As soon as you involve the microcontroller, you must spend time understanding the full problem and taking care of both host and device controller at all times, which includes connect/disconnect of PC while thumb drive is, or isn't, connected, or connect/disconnect of thumb drive while PC is or isn't connected.
Maybe till now you didn't understand me.
I need to combine USB host and device with each other and due to I don't know about USB I need sample code, link, or application note or else
then I found it takes a long time and Tsuneo Chinzei said give it up.
OK for this project I for reducing the time I found another way and this is my solution. it works properly but know it's not complete. here is the schematic
" help me. maybe your helps be useful for anyone else.
Hi Per,
You are also trapped in the OP's bad manner. He doesn't explain his real project, exactly as he want to do. Instead, he asks on nonsense fake example, which he would think related to his real one. When we respond to the fake example seriously, he says, "I didn't explain my project."
It's bad manner to ask a question. I don't have patience to reply seriously to such a manner. Every time we respond to his question, we have to expect, "it wasn't the real question"
Tsuneo
my real question from first post to end was clear, "How to combine USB host with device"
but all your answer was "misunderstanding"
I said, I found a trick with VNC1L to cope my project but I need sample and application note about it. but you and the others just said "misunderstanding"
if you review my all posts you can see that my question was "How to combine USB host with device".
if anybody wants to ask one question he or she should explain it with full details. I wanna combine them you asked me how you can connect and disconnect USB stick. how you can manage the PC and UB on MCU.
OK doesn't matter.
attention to manager of this forum: would you please remove this topic?
because these quarrels are not suitable for this website.
thanks a lot about your answers