Forums

Using USB instead of RS232 on embeded project

Started by Art K6KFH September 23, 2004
I am developing a product that requires a serial port to transfer a
few bytes of data to a host pc on a repetitive basis.  Currently using
115kbaud on an RS232 port on my board and that works fine. A little
slower is ok  too.  Some feedback has indicated that a USB port would
be an attractive alternative.  Someone commented that a "chip" for USB
is about the same expense as RS232.  I have zero experience with USB
and I have no idea what to look for or if it is even practical.  The
product is a battery charger and is just transferring battery
current/voltage values to a host pc for analysis and graphing so speed
is not a problem.   All I need to do is just transfer a few bytes back
and forth from the host PC.  The processor is a Cygnal C8051F310.  Any
recommendations or advice on how to do this would be appreciated. 

Thanks, 
Art
On Thu, 23 Sep 2004 12:49:32 GMT, Art K6KFH wrote:

> I am developing a product that requires a serial port to transfer a > few bytes of data to a host pc on a repetitive basis. Currently using > 115kbaud on an RS232 port on my board and that works fine. A little > slower is ok too. Some feedback has indicated that a USB port would > be an attractive alternative. Someone commented that a "chip" for USB > is about the same expense as RS232. I have zero experience with USB > and I have no idea what to look for or if it is even practical. The > product is a battery charger and is just transferring battery > current/voltage values to a host pc for analysis and graphing so speed > is not a problem. All I need to do is just transfer a few bytes back > and forth from the host PC. The processor is a Cygnal C8051F310. Any > recommendations or advice on how to do this would be appreciated. > > Thanks, > Art
Cygnal makes a couple of USB chips. The C8051F320 is an 8051 derivative with USB. They also make an RS232 to USB converter to convert legacy RS232 applications to USB which might be an easier way to go. Writing USB drivers is a non trivial task... Bob
You might want to take a look at http://www.ftdichip.com/
Regards,
johannes
"Art K6KFH" <art_horne@phase4wireless.com> wrote in message
news:1sg5l058kidvhh3okk3jcnd8vjg8jogb1p@4ax.com...
> I am developing a product that requires a serial port to transfer a > few bytes of data to a host pc on a repetitive basis. Currently using > 115kbaud on an RS232 port on my board and that works fine. A little > slower is ok too. Some feedback has indicated that a USB port would > be an attractive alternative. Someone commented that a "chip" for USB > is about the same expense as RS232. I have zero experience with USB > and I have no idea what to look for or if it is even practical. The > product is a battery charger and is just transferring battery > current/voltage values to a host pc for analysis and graphing so speed > is not a problem. All I need to do is just transfer a few bytes back > and forth from the host PC. The processor is a Cygnal C8051F310. Any > recommendations or advice on how to do this would be appreciated.
Take a look at http://www.ftdichip.com/ This is a single chip solution that requires no driver writing and know serious knowledge of USB. The chip accepts a serial signal on one end (TX,RX, handshake) and USB on the other end. FTDI supplies you with free drivers that create a virtual com port on your PC. You port your current serial design to USB in less than an hour. Meindert
"Meindert Sprang" <mhsprang@NOcustomSPAMware.nl> skrev i meddelandet
news:10l5n7vncqlo6e3@corp.supernews.com...
> "Art K6KFH" <art_horne@phase4wireless.com> wrote in message > news:1sg5l058kidvhh3okk3jcnd8vjg8jogb1p@4ax.com... > > I am developing a product that requires a serial port to transfer a > > few bytes of data to a host pc on a repetitive basis. Currently using > > 115kbaud on an RS232 port on my board and that works fine. A little > > slower is ok too. Some feedback has indicated that a USB port would > > be an attractive alternative. Someone commented that a "chip" for USB > > is about the same expense as RS232. I have zero experience with USB > > and I have no idea what to look for or if it is even practical. The > > product is a battery charger and is just transferring battery > > current/voltage values to a host pc for analysis and graphing so speed > > is not a problem. All I need to do is just transfer a few bytes back > > and forth from the host PC. The processor is a Cygnal C8051F310. Any > > recommendations or advice on how to do this would be appreciated. >
The AT89C5131 has a built in USB function, and is also 8051 compatible. There is Communication Device Class firmware available. The AT89C5132 is similar but with ADC. There is Communication Device Class firmware available. The new AT91SAM7S64 may be a significantly better alternative with its high performance ARM7 core... To early for firmware yet. -- Best Regards Ulf at atmel dot com These comments are intended to be my own opinion and they may, or may not be shared by my employer, Atmel Sweden.
"Art K6KFH" <art_horne@phase4wireless.com> wrote in message 
news:1sg5l058kidvhh3okk3jcnd8vjg8jogb1p@4ax.com...
>I am developing a product that requires a serial port to transfer a > few bytes of data to a host pc on a repetitive basis. Currently using > 115kbaud on an RS232 port on my board and that works fine. A little > slower is ok too. Some feedback has indicated that a USB port would > be an attractive alternative. Someone commented that a "chip" for USB > is about the same expense as RS232. I have zero experience with USB > and I have no idea what to look for or if it is even practical. The > product is a battery charger and is just transferring battery > current/voltage values to a host pc for analysis and graphing so speed > is not a problem. All I need to do is just transfer a few bytes back > and forth from the host PC. The processor is a Cygnal C8051F310. Any > recommendations or advice on how to do this would be appreciated. > > Thanks, > Art
Dontronics.com has some products. I've used the usbmicro. Its not "the price of a serial chip", but its really easy to use. You buy the chip, and download the DLL's and code examples. I've been communication with the chip directly from Microsoft Access.
On Thu, 23 Sep 2004 12:49:32 GMT, Art K6KFH
<art_horne@phase4wireless.com> wrote:

>I am developing a product that requires a serial port to transfer a >few bytes of data to a host pc on a repetitive basis. Currently using >115kbaud on an RS232 port on my board and that works fine. A little >slower is ok too. Some feedback has indicated that a USB port would >be an attractive alternative.
I know you're a Forth fan, so I can't resist suggesting you look at: www.mpeltd.demon.co.uk/usbstamp.htm which uses a single chip 60MHz ARM (128k Flash, 64k RAM) with an FTDI USB chip glued on the side. I can recommend the FTDI chips, they are ease to design with and all the host drivers are free of charge. Stephen -- Stephen Pelc, stephenXXX@INVALID.mpeltd.demon.co.uk MicroProcessor Engineering Ltd - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 web: http://www.mpeltd.demon.co.uk - free VFX Forth downloads
Art,

If you already have it going why change?

Moving to USB is not a simple step and by the sound of it would achieve
little.
You interface does not sound complex or requiring a lot of speed. Even
115Kbd sounds
like an overkill, but I guess that depends on how often you require samples.
USB is good if you need to transfer a significant amount of data. Also the
support within your
embedded system is much greater for USB than for RS232. The learning curve
for USB is not
trivial either, but is good fun if you like the challenge. Give yourself a
min of 6 months. The initial
learning curve is steep but after that, most learning is by experience.
If your concern for RS232 ports becoming obsolete in some PC's then a simple
USB to RS232
converter will be fine, providing you do not require special timings or
protocol settings.
As with most USB configurations timing can be an issue as you cannot
guarantee delivery time of a message.

If you do intend going down the USB path I would suggest 2 books as a
requirement.

    (1) - USB Complete by Jan Axelson (ISBN-096508195-8)
    (2) - USB Design by Example by John Hyde (ISBN-9702846-5-9)

Some good web sites to visit are
http://www.beyondlogic.org/
http://www.tracesystemsinc.com/

A must have tool is at
http://www.ellisys.com/


regards
PhilW


"Art K6KFH" <art_horne@phase4wireless.com> wrote in message
news:1sg5l058kidvhh3okk3jcnd8vjg8jogb1p@4ax.com...
> I am developing a product that requires a serial port to transfer a > few bytes of data to a host pc on a repetitive basis. Currently using > 115kbaud on an RS232 port on my board and that works fine. A little > slower is ok too. Some feedback has indicated that a USB port would > be an attractive alternative. Someone commented that a "chip" for USB > is about the same expense as RS232. I have zero experience with USB > and I have no idea what to look for or if it is even practical. The > product is a battery charger and is just transferring battery > current/voltage values to a host pc for analysis and graphing so speed > is not a problem. All I need to do is just transfer a few bytes back > and forth from the host PC. The processor is a Cygnal C8051F310. Any > recommendations or advice on how to do this would be appreciated. > > Thanks, > Art
Art K6KFH <art_horne@phase4wireless.com> wrote in 
news:1sg5l058kidvhh3okk3jcnd8vjg8jogb1p@4ax.com:

> I am developing a product that requires a serial port to transfer a > few bytes of data to a host pc on a repetitive basis. Currently using > 115kbaud on an RS232 port on my board and that works fine. A little > slower is ok too. Some feedback has indicated that a USB port would > be an attractive alternative. Someone commented that a "chip" for USB > is about the same expense as RS232. I have zero experience with USB > and I have no idea what to look for or if it is even practical. The > product is a battery charger and is just transferring battery > current/voltage values to a host pc for analysis and graphing so speed > is not a problem. All I need to do is just transfer a few bytes back > and forth from the host PC. The processor is a Cygnal C8051F310. Any > recommendations or advice on how to do this would be appreciated. > > Thanks, > Art
USB is probably the direction that all new development should go. There are many USB-capable microcontrollers out there, and a lot of them are 8051- based so your existing code should even be portable. If you stick with a controller that has a USB state machine, so that you don't have to implement the actual twiddling of the data lines, then USB is not difficult but it is tedious. The nice thing about it is that nearly all of the USB-specific firmware you write will be reusable in other applications. Most of the work is simply handling the identification and configuration requests. Your application-specific code will only touch a couple areas of the USB implementation. It's not hobbyist-friendly. There are thousands of USB firmware implementations out there, all written independently by developers and secreted away behind copyrights. If someone put professional quality generic USB firmware out there for popular microcontrollers under the GPL, it would be a pretty big boost for hobbyist use of USB. I already can't distribute mine; that's the problem, hardly anyone does it until they're paid to.
"Phil W" <electropw@hotmail.com> wrote in message
news:41535638@dnews.tpgi.com.au...
> Art, > > If you already have it going why change?
Well, because of laptops with no serial ports?
> Moving to USB is not a simple step and by the sound of it would achieve > little.
With the chips from FTDI is IS a simple step.
> embedded system is much greater for USB than for RS232. The learning curve > for USB is not > trivial either, but is good fun if you like the challenge. Give yourself a > min of 6 months.
If you just want to replace a serial connection with USB, the FTDI chips let you do it within hours. Meindert