EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

USB Breakout

Started by }{ February 13, 2008
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. 


}{ 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.
Interrupting a USB cable, and inserting USB devices like you suggested is pretty much impossible. What's the purpose of this exercise ?
"Arlet Ottens" <usenet+5@c-scape.nl> wrote in message 
news:47b3335e$0$85778$e4fe514c@news.xs4all.nl...
> }{ 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. > > Interrupting a USB cable, and inserting USB devices like you suggested is > pretty much impossible. > > What's the purpose of this exercise ? >
I have a machine that can accept data and perform as follows, if char 5 == char 6 then do something. The new machine cannot do this, but can do, if char == 1 then do something. It was a f**k up between 2 departments in my work that will cost in excess of &#4294967295;15,000 to put right by getting custom software and additional hardware(which would double the machines size), or hopefully &#4294967295;10 for a couple of PICs. Regards
}{ wrote:
> "Arlet Ottens" <usenet+5@c-scape.nl> wrote in message > news:47b3335e$0$85778$e4fe514c@news.xs4all.nl... >> }{ 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. >> Interrupting a USB cable, and inserting USB devices like you suggested is >> pretty much impossible. >> >> What's the purpose of this exercise ? >> > > I have a machine that can accept data and perform as follows, if char 5 == > char 6 then do something. The new machine cannot do this, but can do, if > char == 1 then do something. > > It was a f**k up between 2 departments in my work that will cost in excess > of &#4294967295;15,000 to put right by getting custom software and additional > hardware(which would double the machines size), or hopefully &#4294967295;10 for a > couple of PICs. > > Regards > >
Yes, a couple of pics will not do as you ask. Do you understand that the PC is the master and the USB device is the slave ? To get inline on a USB cable is to have a slave for the PC and a master for the device. Please read up on how USB works, this can not be done as you ask (with a couple of pics). Good Luck donald PS: too bad about the &#4294967295;15,000.
"donald" <Donald@dontdoithere.com> wrote in message 
news:t5idnTduXJW5oy7anZ2dnUVZ_g-dnZ2d@comcast.com...
> }{ wrote: >> "Arlet Ottens" <usenet+5@c-scape.nl> wrote in message >> news:47b3335e$0$85778$e4fe514c@news.xs4all.nl... >>> }{ 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. >>> Interrupting a USB cable, and inserting USB devices like you suggested >>> is pretty much impossible. >>> >>> What's the purpose of this exercise ? >>> >> >> I have a machine that can accept data and perform as follows, if char 5 >> == char 6 then do something. The new machine cannot do this, but can do, >> if char == 1 then do something. >> >> It was a f**k up between 2 departments in my work that will cost in >> excess of &#4294967295;15,000 to put right by getting custom software and additional >> hardware(which would double the machines size), or hopefully &#4294967295;10 for a >> couple of PICs. >> >> Regards > Yes, a couple of pics will not do as you ask. > > Do you understand that the PC is the master and the USB device is the > slave ?
Yes
> > To get inline on a USB cable is to have a slave for the PC and a master > for the device. >
I was hoping that one of the micros could be master and one slave
> Please read up on how USB works, this can not be done as you ask (with a > couple of pics).
I have found a couple of interesting sites, but I think there would be too much to learn in the timescale I have
>
> Good Luck
Thanks for your replies, you have saved me a lot of time on what would have turned out to be a fruitless exercise. Regards.
> > donald > > PS: too bad about the &#4294967295;15,000.
}{ wrote:
> "donald" <Donald@dontdoithere.com> wrote in message > news:t5idnTduXJW5oy7anZ2dnUVZ_g-dnZ2d@comcast.com... >> }{ wrote: >>> "Arlet Ottens" <usenet+5@c-scape.nl> wrote in message >>> news:47b3335e$0$85778$e4fe514c@news.xs4all.nl... >>>> }{ 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. >>>> Interrupting a USB cable, and inserting USB devices like you suggested >>>> is pretty much impossible. >>>> >>>> What's the purpose of this exercise ? >>>> >>> I have a machine that can accept data and perform as follows, if char 5 >>> == char 6 then do something. The new machine cannot do this, but can do, >>> if char == 1 then do something. >>> >>> It was a f**k up between 2 departments in my work that will cost in >>> excess of &#4294967295;15,000 to put right by getting custom software and additional >>> hardware(which would double the machines size), or hopefully &#4294967295;10 for a >>> couple of PICs. >>> >>> Regards >> Yes, a couple of pics will not do as you ask. >> >> Do you understand that the PC is the master and the USB device is the >> slave ? > > Yes > >> To get inline on a USB cable is to have a slave for the PC and a master >> for the device. >> > > I was hoping that one of the micros could be master and one slave
Sorry about that, Microchip does not make _any_ master devices in a PIC chip. I don't even think Microchip make any master parts at all. There are master chips out there, however the cheapest way to get this done, the with &#4294967295;15,000. ( I hate seeing projects like this go so far before someone finally catches on ) donald
> >> Please read up on how USB works, this can not be done as you ask (with a >> couple of pics). > > I have found a couple of interesting sites, but I think there would be too > much to learn in the timescale I have > > >> Good Luck > > Thanks for your replies, you have saved me a lot of time on what would have > turned out to be a fruitless exercise. > > Regards. > >> donald >> >> PS: too bad about the &#4294967295;15,000. > >
}{ 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.
Not with USB. However, if the speed is suitable, you could change the information display to use a RS232 link, probably using ASCII. Then a PIC could make the appropriate changes on the fly. -- [mail]: Chuck F (cbfalconer at maineline dot net) [page]: <http://cbfalconer.home.att.net> Try the download section. -- Posted via a free Usenet account from http://www.teranews.com
On Feb 13, 2:14=A0pm, donald <Don...@dontdoithere.com> wrote:

> Sorry about that, Microchip does not make _any_ master devices in a PIC > chip. > > I don't even think Microchip make any master parts at all.
Wait a second. Depends what the device is. Microchip make parts with USB OTG ports and they provide the software stack to talk to storage devices. It would probably be feasible to add serial class support.
larwe wrote:
> On Feb 13, 2:14 pm, donald <Don...@dontdoithere.com> wrote: > >> Sorry about that, Microchip does not make _any_ master devices in a PIC >> chip. >> >> I don't even think Microchip make any master parts at all. > > Wait a second. Depends what the device is. Microchip make parts with > USB OTG ports and they provide the software stack to talk to storage > devices. It would probably be feasible to add serial class support. >
Really ?? I'll have to look for those. I would like to use a USB stick on a project. Thanks donald
On Wed, 13 Feb 2008 12:14:02 -0700, donald <Donald@dontdoithere.com>
wrote:

>}{ wrote: >> "donald" <Donald@dontdoithere.com> wrote in message >> news:t5idnTduXJW5oy7anZ2dnUVZ_g-dnZ2d@comcast.com...
[snip...snip...]
>> I was hoping that one of the micros could be master and one slave > >Sorry about that, Microchip does not make _any_ master devices in a PIC >chip. > >I don't even think Microchip make any master parts at all. > >There are master chips out there, however the cheapest way to get this >done, the with &#4294967295;15,000.
Atmel has a branch of their AVR processors that implement "reduced host" functionality. From the app note: "AT90USBxxx parts can operate both as USB device or USB host, accurately in host mode AT90USBxxx operates as reduced host controller. A reduced host controller has a unique USB port and does not handle full USB tree with hub. It means that a reduced host controller is designed to handle a unique point to point connection with a unique USB device. A reduced host application supports a known targeted device list (VID/PID list). Only the devices listed within this list are supported by the application. In addition the AT90USBxxx USB software library is able to support a targeted list of CLASS/SUBCLASS/PROTOCOL." So the OP's solution might be achievable. Mouser, Newark, and Digkey have the chips and dev kits. I haven't worked with any of these (I mostly use the plain AVRs and their CAN relatives), so this is just a pointer, not an endorsement.
>( I hate seeing projects like this go so far before someone finally >catches on )
Amen! -- Rich Webb Norfolk, VA

The 2024 Embedded Online Conference