go_away

Author Topic: USB  (Read 1029 times)

0 Members and 1 Guest are viewing this topic.

Offline jonagikTopic starter

  • Full Member
  • ***
  • Posts: 63
  • Helpful? 1
USB
« on: November 03, 2011, 07:36:04 PM »
Hi,

Does the USB protocol include error correction?

I was just wondering if it would be viable to connect USB to a microcontroller, have that microcontroller transmit/receive that data (without error correction) over RF to/from another micrcontroller which then produces the USB I/O through its ports.

For example, using the above implementation, have a USB flash drive connect to a microcontroller and then have another microntroller connect to a computer and have the computer interact with that flash drive as if it was connected locally.

Thanks.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,702
  • Helpful? 173
    • Society of Robots
Re: USB
« Reply #1 on: November 04, 2011, 02:14:55 AM »
With every USB connection, you need a host and a slave.

So if you were to attach a wireless mcu to a USB adapter chip and finally to a USB drive, that chip would need host capabilities (if it doesn't say, it doesn't have it).

Here is what I've done:
computer with USB host -> Axon Mote wireless -> another Axon Mote wireless -> uSD card
(the source code is already available to basically do what you want)

If your goal is to wirelessly save data, this would be your better route.

or . . .

computer with USB host -> wireless mcu -> wireless mcu -> another computer with USB host -> USB thumb drive

Note that there are some microcontrollers out there with built-in USB host capabilities, cheap too, but you won't find any that are noob-friendly (ie no easy source code or development boards out there for them).

Offline jonagikTopic starter

  • Full Member
  • ***
  • Posts: 63
  • Helpful? 1
Re: USB
« Reply #2 on: November 04, 2011, 02:17:27 AM »
Why would the chip need host capabilities? Wouldn't the computer just see a (somewhat staticy) connection with the device just as it would if it were connected directly to the computer?

Thanks.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,702
  • Helpful? 173
    • Society of Robots
Re: USB
« Reply #3 on: November 04, 2011, 02:25:50 AM »
To have two USB devices connected to each other, one must be a host and the other a slave. This is part of the USB protocol . . .

Your computer USB has host capability, but many of the cheap TTL to USB adapter chips out there do not. That's not an issue if you are trying to connect a mcu to your computer by USB, but it is an issue for you as USB drives do not have host capability.

If all you want is to store data, your best bet is to have a mcu write directly to a uSD card and not use USB.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: USB
« Reply #4 on: November 04, 2011, 06:17:32 PM »
Hi,

Does the USB protocol include error correction?
Yes (except for when used for streaming).


I was just wondering if it would be viable to connect USB to a microcontroller, have that microcontroller transmit/receive that data (without error correction) over RF to/from another micrcontroller which then produces the USB I/O through its ports.

For example, using the above implementation, have a USB flash drive connect to a microcontroller and then have another microntroller connect to a computer and have the computer interact with that flash drive as if it was connected locally.
If speed isn't an issue, I don't see a problem in that, as long as certain procedures are followed.
The USB stick should be connected and to its microcontroller and be powered up and the microcontroller on the PC end should be powered up as well, before connecting it to the PC, as the microcontrollers and wireless only needs to act like a link for the data, while the PC takes care of enummeration and control - It is, after all, just a serial link.

You'll have to write the software for converting to and from the bipolar data (USB) and unipolar data (data link) yourself. The speed attainable will depend mostly on the data link max. speed (As you can probably read, send, receive and write the data faster than the link can handle.

Why anyone would do that is beyond me though, as you won't be able to make any changes to the USB strick from the far end, so it will be nothing more than a very expensive (and slow) extension lead.

Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,702
  • Helpful? 173
    • Society of Robots
Re: USB
« Reply #5 on: November 04, 2011, 09:33:58 PM »
You'll have to write the software for converting to and from the bipolar data (USB) and unipolar data (data link) yourself. The speed attainable will depend mostly on the data link max. speed (As you can probably read, send, receive and write the data faster than the link can handle.

Why anyone would do that is beyond me though, as you won't be able to make any changes to the USB strick from the far end, so it will be nothing more than a very expensive (and slow) extension lead.
hmmmmm that's an idea, imitating the exact bit stream that comes in wirelessly and then spitting it back out the other end without any additional USB chips/hosts/etc. . . . you might be able to get away with it. Let us know how it goes.

 


Get Your Ad Here

data_list