|
-
October 14th, 2010, 03:47 PM
#1
Communicating with the USB port itself (NOT a USB device)
Hi there,
I've got some kind of project in mind and I would be very pleased if any of you could tell me whether it would be possible to actually implement it, or if it's only some kind of fantasy 
Suppose I have got an ordinary electronic device (I mean, not a computer device; let's say it is a light bulb, a servomotor or even some kind of screen; all of them can do "something" depending on the electric signal it receives). Suppose now that I connect an ordinary USB extender cable to the USB port in my computer and then cut it off in the middle and splice one of the wires from inside the USB cable with the coax (or whatever) cable that is intended to transport the electric pulses to the bulb or the servo or the screen. Finally suppose that I would like to write a computer program that 'guides' or controls how it works, by generating the electric signal that is sent to the device. For example, a program that turns the light on or off at a certain time or that simply sends a certain signals to the servo or to the screen in the way and moment I want.
My question is: is there a way (under C++ or Visual Studio) to communicate with the USB ports "directly", whatever the device connected is? In the cases I've mentioned the O.S. will not recognise any devices connected to the USB port (the bulb/servo/display are not USB devices at all that can be connected to a computer...) but will it still be possible to write a program that tells the USB port (or the USB host driver) to send pulses or words through that cable at a certain time?? I know that the WinAPI and the WinDDK provide libraries for communicating with I/O devices, but this is not exactly what I'm pretending... there is not an actual I/O device here!
Of course, I suppose that the power of the signals that travel through the wires in the USB cable is very low and may or may not be enough for lighting up a bulb, but... I suppose that amplifiers or voltage adapters can be used for that purpose.
Finally, if I connect to the USB port not a bulb / servo / screen but the antenna of my radio tuner or my TV, would in any way a USB port be able to generate valid FM/TV signals?? A TV signal is composed of several carriers at different frequencies... it's not just a simple pulse, but several pulses traveling together through the cable.
I know that all this is a weird idea, but maybe someone who understands about hardware and driver implementation better than me can give me some advice...
Thank you very much!!
-
October 15th, 2010, 05:21 AM
#2
Re: Communicating with the USB port itself (NOT a USB device)
Someone else can probably give you a more in depth answer to this but in a word no you can't. You could on the other hand create your own device using a microcontroller with either onboard USB support or using a second IC for the USB communications. Then you could make it do whatever you wanted. However it's pretty involved as the USB protocol requires that the PC and USB device undertake certain steps in the correct order just to be connected up properly (called enumeration). Have a look at http://www.beyondlogic.org/usbnutshe...C16F876Example to give you some idea of what you'd be getting yourself into....
-
October 15th, 2010, 08:35 PM
#3
Re: Communicating with the USB port itself (NOT a USB device)
Thank you for your answer, Cheezewizz. So I understand that I cannot write/read on an USB port as easily as I would do on an ordinary serial port (RS-232): in the RS-232 it doesn't matter what kind of device is connected to the port: I can make a program that simply sends or reads words without worrying about the enumeration process or the identifier of the device connected, right?
For example, it is not possible to simply connect a cable to an USB port and take this cable to an oscilloscope, because the osciloscope will not be recognised as a USB device by the O.S., so it will not be enumerated, right?
Hum... I see.
I suppose that the case of the bulb or the servo would be possible via a serial port. But what about generating a radio signal through the serial port? Is it theorically possible to generate an AM or FM radio signal through one of the pins of the RS-232 port? Of course the RS-232 is very limited in speed, but... am I missing something here, or it is a "simple" question of modulating a signal (wave) through the RS-232 port with the form and frequency of a regular radio wave?
Thank you once again!
-
October 15th, 2010, 08:45 PM
#4
Re: Communicating with the USB port itself (NOT a USB device)
Well, of course I understand that a radio signal is an analogue signal while the signals coming out of a serial port are binary signals (0's or 1's). So... What about modulating a [very low quality / bitrate] digital radio signal over the RS-232 port? Is there are hardware limitation for that? Would it be possible to write a program that sends the adequate signals to the port?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|