Page 1 of 1

How to send carriage return command to USB connected device?

Posted: Fri Aug 05, 2011 8:27 am
by Rayleigh
I need some help/guidance please!

Here is the issue - I need to send a carriage return command to a device via a USB connection. Here is the rub - I need to do this without a PC. I suspect there is a way to use a microcontroller to send the carriage return command but how do I send it out via a USB cable to the waiting device? I know a very little bit about the SEROUT command and suspect this may be the answer... is it as simple as using a serial to usb cable?

Another rub - I don't have access to the source code on the device I am trying to remote trigger. I can talk with an engineer at that company but I want to know a bit more about trying to do this before wasting his/her time.

Any thoughts/suggestions/important questions? I would really appreciate any help. I am hopeful there is a VERY simple solution.

Thanks in advance!

- Rayleigh

Re: How to send carriage return command to USB connected dev

Posted: Fri Aug 05, 2011 10:02 am
by MrAl
Hi,

The protocol for USB is quite complex and very hard to achieve even when using an advanced microcontroller. The best i can think of at the moment is to find out if someone already makes a unit to do this already. Otherwise i seriously doubt you will want to attempt it.

It's not like the old days when the line printers would work by receiving a couple 8 bit codes via a parallel cable. It would have been relatively easy with an old line printer. They made the USB standard so complex that it always takes at least one advanced chip to understand the complicated handshaking required.

Re: How to send carriage return command to USB connected dev

Posted: Fri Aug 05, 2011 10:17 am
by Rayleigh
Thanks MrAl! I've tried some google searches for a prepackaged device to do this but I haven't turned up anything - most likely because I am not using the right key words. What would you recommend I search for to do the job?

Re: How to send carriage return command to USB connected dev

Posted: Fri Aug 05, 2011 10:47 am
by MrAl
Hi again,

I found this:
http://atmsupply.com/p-1628-pcb-usb-pri ... oller.aspx

but yes it's kind of expensive over $100 USD, and you'd have to check it to make sure it does what you want it to do.

I also found a chip Vinculum VNC1L but it looks pretty complex to set up, also requiring a micro controller.

Maybe someone else has some more ideas here.

Re: How to send carriage return command to USB connected dev

Posted: Fri Aug 05, 2011 10:24 pm
by dyarker
AT YOUR OWN RISK!

If your usb device has a USB chip and uP chip, not a uP with built in USP port, you might be able inject CRLF characters on serial line between the two.

Q: What will be your CRLF source if not a PC?

Cheers,

Re: How to send carriage return command to USB connected dev

Posted: Sat Aug 06, 2011 7:19 am
by MrAl
Hi again,

Yeah, another idea would be to open up the printer and find out what makes it tick. Most likely a stepper motor would control the line feed, but the carriage return would be more difficult.
The stepper motor lines could be interrupted and the stepper motor driven with an external source, but that would only accomplish the line feed. The internal logic would have to know that the head moved so i dont think it would work to break the head stepper motor lines and control them externally.

Re: How to send carriage return command to USB connected dev

Posted: Sun Aug 07, 2011 6:07 am
by Rayleigh
Here is a quote from the engineer:
The "Control M" character which is the ASCII for carriage return (13), when sent from a PC to the OS1p (with the modified internal software in the fluorometer) would initiate a trigger. This is not available on the older fluorometer (OS1-FL) The USB capability is only for the newer OS1p and OS5p fluorometers...
Company website is here: http://www.optisci.com/

Unfortunately, I don't know what is inside (yet) or how to talk with it.

I have been working on a small portable heater/cooler for doing these measurements in the field for a colleague in the Biology dept. Right now the temperature is user controlled but we want to move towards an automatic system whereby the temperature is ramped in stages. At predetermined temperature stages we want to trigger the fluorometer to take a measurement. Currently, we have the older model fluorometer which we can trigger with a relay switch - but I am thinking ahead to the newer usb models.

The engineer and I will continue to converse about a possible solution. I may have to learn about the Vinculum chip....

Re: How to send carriage return command to USB connected dev

Posted: Sun Aug 07, 2011 8:30 pm
by psycho
As has been pointed out, USB operations are fairly complex - especially a USB host implementation. I implemented a host once via a PIC32 for reading/writing USB flash drives. I hope I don't need to do that again...

You might want to check out this : http://www.compsys1.com/html/usb_host_kit.html
It uses the chip you guys referred to in the above posts. Note that I just stumbled across it - I have no idea if it is good or suitable for your needs.

I am wondering how the device operates too. If it does use an FTDI serial chip connected to a uC then I agree that you should tap right into the serial lines that connect the two chips. Then with a small uC, you can just TX/RX serial data to/from the main uC in the device just like the FTDI chip does/did (but it did it via USB).

Check out this : http://en.wikipedia.org/wiki/ASCII#ASCI ... characters
and this : http://en.wikipedia.org/wiki/Control_character#In_ASCII
for info on ASCII control codes.

I hope it helps (and didn't confuse anyone) :razz:

Kevin

Re: How to send carriage return command to USB connected dev

Posted: Sun Aug 07, 2011 9:38 pm
by dyarker
Alternate, alternate ...
A netbook PC with USB port running a script to send a CR at intervals.

Cheers,