EmbeddedRelated.com
Forums
Memfault Beyond the Launch

USB Breakout

Started by }{ February 13, 2008
In article <000f35fb-2ef1-488e-9162-9e68e06188c7
@s13g2000prd.googlegroups.com>, me@linnix.info-for.us says...
> On Feb 15, 2:24 pm, Mark Borgerson <mborger...@comcast.net> wrote: > > In article <d9c3e27a-b3ee-4b69-9dcd-da12751e99d8 > > @p43g2000hsc.googlegroups.com>, cbarn24...@aol.com says... > > > > > On Feb 13, 5:30=EF=BF=3D3Fpm, "}{" <snoozegr...@blueyonder.co.uk> wro=
te:
> > > > I am planning a project and would appreciate any guidance you guys =
could
> > > > give. > > > > > > At the moment, I have a measurement device connected to a decoder b=
ox - the
> > > > decoder box is connected to another PCB using a USB cable. > > > > > > If practical, I would like to break into the USB cable running betw=
een the
> > > > decoder box and the PCB to modify the values on the fly. Specifical=
ly, if
> > > > two digits(say char 5 and char 6) are the same, a 1 would be append=
ed,
> > > > otherwise a 0 would be appended. > > > > > > So if 123456789 were transmitted from the decoder, I would like to =
intercept
> > > > and change it to 1234567890. > > > > > > Likewise if 123455789 were transmitted, I would change this to 1234=
557891
> > > > and send on. > > > > > > I have some experience programming PICs and RS232 but no experience=
using
> > > > USB(2 in this case). > > > > > > Initially, I was thinking about using a PIC with a USB input connec=
ted to
> > > > the decoder, the same connected to the PCB and SPI between the two =
PICs.
> > > > > > Firstly, is this possible, and do you have any pointers on PICs & U=
SB2.
> > > > > > Thanks. > > > > > Cant you use a usb to rs232 converter, pic, rs232 to usb converter. > > > You can get them ready made or just use the chips. > > > > The USB part of the RS232 converter has to connect to a PC or other > > host device that can handle all the enumeration and > > control signals. IIRC, the device described by the OP, > > has only one host and one slave device---not the two hosts > > your converters would require. >=20 > For the sake of arguing, you can use a usb device to rs232 converter > (ftdi), pic and rs232 to usb host converter (avr). >=20
I think you'd still have to program the PIC and AVR. I don't know how hard it is to get the AVR to mimic the host to which the device is to be connected. Still looks to be more complex than intercepting the signals outside the USB chain. Mark Borgerson
On 2008-02-16, linnix <me@linnix.info-for.us> wrote:
> On Feb 15, 2:24 pm, Mark Borgerson <mborger...@comcast.net> wrote: >> In article <d9c3e27a-b3ee-4b69-9dcd-da12751e99d8 >> @p43g2000hsc.googlegroups.com>, cbarn24...@aol.com says... >> >> > Cant you use a usb to rs232 converter, pic, rs232 to usb converter. >> > You can get them ready made or just use the chips. >> >> The USB part of the RS232 converter has to connect to a PC or other >> host device that can handle all the enumeration and >> control signals. IIRC, the device described by the OP, >> has only one host and one slave device---not the two hosts >> your converters would require. > > For the sake of arguing, you can use a usb device to rs232 converter > (ftdi), pic and rs232 to usb host converter (avr).
It wouldn't work anyway except in the most specific of cases. Assuming that speed is not a restriction, which itself is a big if, USB and RS232 are fundamentally different protocols. USB has multiple transfer modes and multiple endpoints defined even for a simple link between host and device with no hubs involved. RS232 doesn't, and you can't add these on with a regular USB<>RS232 interface chip because it simply isn't what the devices are designed to do. Added to that such a hack would appear to the host to be a USB RS232 port, not whatever device it is you need to interface to. The only time I can see this approach working is if the device itself uses an RS232<>USB interface internally which is at least possible, but in that case you have your entry point there - break into the signals at the RS232 stage within the device itself. I don't really have any suggestions in the general case though. A device to do what the OP wants would have more in common with a hub than anything else, but again this isn't what your standard off-the-shelf hub designs are designed to do and I doubt they could be adapted to serve this particular purpose. -- Andrew Smallshaw andrews@sdf.lonestar.org
}{ wrote:
> I am planning a project and would appreciate any guidance you guys could > give. > > At the moment, I have a measurement device connected to a decoder box - the > decoder box is connected to another PCB using a USB cable. > > If practical, I would like to break into the USB cable running between the > decoder box and the PCB to modify the values on the fly. Specifically, if > two digits(say char 5 and char 6) are the same, a 1 would be appended, > otherwise a 0 would be appended. > > So if 123456789 were transmitted from the decoder, I would like to intercept > and change it to 1234567890. > > Likewise if 123455789 were transmitted, I would change this to 1234557891 > and send on. > > I have some experience programming PICs and RS232 but no experience using > USB(2 in this case). > > Initially, I was thinking about using a PIC with a USB input connected to > the decoder, the same connected to the PCB and SPI between the two PICs. > > Firstly, is this possible, and do you have any pointers on PICs & USB2. > > Thanks. >
I doubt that any COTS USB hub chip would have this functionality, but if you could get a hub as an ASIC core, you could add the necessary "breakout" processing. A hub is already able to connect to a host upstream and multiple devices downstream. AFAIK, a hub simply passes data through with no buffering, so any "breakout" decision has to be made at full bus speed. Just buying the core IP is probably a 4 or 5 figure NRE. Bringing your knowledge from PIC/RS232 up to ASIC design is certainly another 5 or 6 figures. Of course, the engineering solution is to fix the software, not kludge the hardware. Bob
"Bob" <SkiBoyBob@excite.com> wrote in message 
news:61r62gF20al4tU1@mid.individual.net...
> }{ wrote: >> I am planning a project and would appreciate any guidance you guys could >> give. >> >> At the moment, I have a measurement device connected to a decoder box - >> the decoder box is connected to another PCB using a USB cable. >> >> If practical, I would like to break into the USB cable running between >> the decoder box and the PCB to modify the values on the fly. >> Specifically, if two digits(say char 5 and char 6) are the same, a 1 >> would be appended, otherwise a 0 would be appended. >> >> So if 123456789 were transmitted from the decoder, I would like to >> intercept and change it to 1234567890. >> >> Likewise if 123455789 were transmitted, I would change this to 1234557891 >> and send on. >> >> I have some experience programming PICs and RS232 but no experience using >> USB(2 in this case). >> >> Initially, I was thinking about using a PIC with a USB input connected to >> the decoder, the same connected to the PCB and SPI between the two PICs. >> >> Firstly, is this possible, and do you have any pointers on PICs & USB2. >> >> Thanks. > > I doubt that any COTS USB hub chip would have this functionality, but if > you could get a hub as an ASIC core, you could add the necessary > "breakout" processing. A hub is already able to connect to a host upstream > and multiple devices downstream. AFAIK, a hub simply passes data through > with no buffering, so any "breakout" decision has to be made at full bus > speed. Just buying the core IP is probably a 4 or 5 figure NRE. Bringing > your knowledge from PIC/RS232 up to ASIC design is certainly another 5 or > 6 figures.
I plan to start this MSc this year, this may well be a silly question, but could anyone give me their thoughts regarding course syllabus and how it relates to the real world http://www.sli-institute.ac.uk/education/msc-sli/taught-modules.php
> > Of course, the engineering solution is to fix the software, not kludge the > hardware.
I have already passed this back to the design team.
> > Bob

Memfault Beyond the Launch