How to send carriage return command to USB connected device?

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
Rayleigh
Posts: 11
Joined: Wed Jun 03, 2009 5:33 am
Contact:

How to send carriage return command to USB connected device?

Post by Rayleigh » Fri Aug 05, 2011 8:27 am

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

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

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

Post by MrAl » Fri Aug 05, 2011 10:02 am

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.
LEDs vs Bulbs, LEDs are winning.

Rayleigh
Posts: 11
Joined: Wed Jun 03, 2009 5:33 am
Contact:

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

Post by Rayleigh » Fri Aug 05, 2011 10:17 am

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?

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

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

Post by MrAl » Fri Aug 05, 2011 10:47 am

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.
LEDs vs Bulbs, LEDs are winning.

dyarker
Posts: 1742
Joined: Fri Aug 22, 2003 1:01 am
Location: Izmir, Turkiye; from Rochester, NY
Contact:

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

Post by dyarker » Fri Aug 05, 2011 10:24 pm

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,
Dale Y

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

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

Post by MrAl » Sat Aug 06, 2011 7:19 am

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.
LEDs vs Bulbs, LEDs are winning.

Rayleigh
Posts: 11
Joined: Wed Jun 03, 2009 5:33 am
Contact:

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

Post by Rayleigh » Sun Aug 07, 2011 6:07 am

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....

psycho
Posts: 388
Joined: Thu Jan 10, 2008 8:13 pm
Location: Northwest Indiana
Contact:

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

Post by psycho » Sun Aug 07, 2011 8:30 pm

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

dyarker
Posts: 1742
Joined: Fri Aug 22, 2003 1:01 am
Location: Izmir, Turkiye; from Rochester, NY
Contact:

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

Post by dyarker » Sun Aug 07, 2011 9:38 pm

Alternate, alternate ...
A netbook PC with USB port running a script to send a CR at intervals.

Cheers,
Dale Y

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests