USB Breakout

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.

Reply to
}{
Loading thread data ...

Interrupting a USB cable, and inserting USB devices like you suggested is pretty much impossible.

What's the purpose of this exercise ?

Reply to
Arlet Ottens

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 £15,000 to put right by getting custom software and additional hardware(which would double the machines size), or hopefully £10 for a couple of PICs.

Regards

Reply to
}{

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 £15,000.

Reply to
donald

Yes

I was hoping that one of the micros could be master and one slave

I have found a couple of interesting sites, but I think there would be too much to learn in the timescale I have

Thanks for your replies, you have saved me a lot of time on what would have turned out to be a fruitless exercise.

Regards.

Reply to
}{

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 £15,000.

( I hate seeing projects like this go so far before someone finally catches on )

donald

Reply to
donald

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]: 
            Try the download section.
Reply to
CBFalconer

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.

Reply to
larwe

Really ??

I'll have to look for those.

I would like to use a USB stick on a project.

Thanks

donald

Reply to
donald

[snip...snip...]

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.

Amen!

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

ld=20

-=20

=20

=20

891=20

ing=20

to=20

s.

.

is=20

=3D=3D=20

=20

s=20

=20

If this is a one-of-a-kind fix, perhaps you can intercept the data=20 before it gets to the USB device and modify the data there. There's a reason you need an XActo knife and wire-wrap wire in your toolkit! Insert the PIC chip of your choice and modify the data stream before it gets to the USB chip.

If you have to fix a production run of 1000+ units, you're probably=20 best off redoing the software.

Mark Borgerson

Reply to
Mark Borgerson

Yes, it's doable. But it's a good size project by itself.

You can use an At90USB162 ($3 USB device) talking to an At90USB646 ($8 USB master).

That's why we get work fixing other people's problems.

Reply to
linnix

If your company is big enough to have 2 departments that can't talk to each other properly then it's big enough to lose the £15,000 and learn a salient lesson from the ordeal, surely?

Nobby

Reply to
Nobody Here

Just curious - what kind of machines are these? Seems odd to have such specific behaviour in what sounds like relatively expensive equipment.

I agree with the other poster that modifying the data stream with a micro would best be done at some other spot than USB, if possible.

Andrew

Reply to
andrew queisser

That application is specifically why they implemented it.

Reply to
larwe

I'll do a me-2 on that one, however here are some ideas for USB hosts:

formatting link

Don...

--
Don McKenzie

Affiliate Program:   http://www.dontronics.com/affiliate
Site Map:            http://www.dontronics.com/sitemap
E-Mail Contact Page: http://www.dontronics.com/email
No More Damn Spam:   http://www.wizard-of-oz.com

Parallax Propeller Powered .96" OLED module
http://tinyurl.com/2vr2gr
Reply to
Don McKenzie

Including, maybe, to use something less inheritly master slave. Maybe even a protocol readily available like say ethernet.

Robert

--
Posted via a free Usenet account from http://www.teranews.com
Reply to
Robert Adsett

"}{" skrev i meddelandet news:BOFsj.95097$ snipped-for-privacy@fe2.news.blueyonder.co.uk...

You could conceivably put an MCU with a USB host and a USB device in between, and let the MCU process the packet before sent out/in to the downstream device.

There will be some latency involved, but that may or may not be a problem. If it is a one off project, you could get an AT91SAM9260 board with a device and a host somewhere, maybe at

formatting link

--
Best Regards,
Ulf Samuelsson
This is intended to be my personal opinion which may,
or may not be shared by my employer Atmel Nordic AB
Reply to
Ulf Samuelsson

SAM9-L9260 DEVELOPMENT BOARD FOR AT91SAM9260 MICROCONTROLLER Olimex hasn't got them yet Ulf. :-(

Nice looking board. I tried to order a bunch recently but no luck. Give him a couple of months I think.

Cheers Don...

--
Don McKenzie

Affiliate Program:   http://www.dontronics.com/affiliate
Site Map:            http://www.dontronics.com/sitemap
E-Mail Contact Page: http://www.dontronics.com/email
No More Damn Spam:   http://www.wizard-of-oz.com

Parallax Propeller Powered .96" OLED module
http://tinyurl.com/2vr2gr
Reply to
Don McKenzie

As they said you can not just splice in. The slave side is easy Microchip ( and many others ) has chips for that. The Host side you could use a FTDI Vinculum. But you will have to deal with the driver code if it is not a standard device.

Reply to
Neil

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.