EmbeddedRelated.com
Forums

Using USB instead of RS232 on embeded project

Started by Art K6KFH September 23, 2004
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. 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
Thanks to all who replied. I think I will give the Cygnal CP2101 some serious thought. It looks like it will do what I need and the price of the development board to try it is very reasonable. Regards, Art
hamilton <hamilton@deminsional.com> wrote in 
news:4155a596_4@omega.dimensional.com:

> AT43USB380 is a host. >
Yes, but how do you write software on both ends? Remember, the Palm software is written to be a master on a serial bus. There is no code to be a slave on the USB bus (those functions on the Palm<->PC end were taken care of by hotsync). On the other end, how does an 8-bit embedded device run such a host mode USB controller, when it expects to be the slave on a serial bus? You see what I mean now when I say transparent USB/serial converters don't cover all classes of serial to USB switchovers? Any intermediate device to do the conversion that I can dream up will be in such low volumes it would cost more than the Palm or the embedded device. Adding USB host capabilities to the embedded device, again at relatively low volumes (less than 10,000 a year, I think) would increase the device cost by nearly 100%, unacceptable in a very cost sensitive market. Most Palm's seem to come with card slots now (used to be CF, but I think they are now SmartMedia) and people have added peripherals to those slots like 802.11b cards and the like, but even an RS-232 peripheral for one of those slots wouldn't be acceptable, as the cable connection would be so flimsy as to be useless. IR still exists, but there are several problems there as well, such as problems with multiple peripherals in range, as well as the rewrite of s/w on both ends to support it. With Bluetooth/802.11b gaining in popularity, I fear about the time I made the switch to IR, it would be dropped as well. Anyway, sorry to vent, but this is an issue that's been bugging me for a while. Jeff.

Jeffrey A. Wormsley wrote:
> hamilton <hamilton@deminsional.com> wrote in > news:4155a596_4@omega.dimensional.com: > > >>AT43USB380 is a host. >> > > Yes, but how do you write software on both ends? Remember, the Palm
USB was never meant to be a multi-master buss. The PC was the master and that all there was to it. Now that serial ports are a thing of the past, USB has become a defacto standard. The USB manufactures have noticed that embedded systems need to be masters as well. But not enough to be a big profit center. So master chips and code is slow coming. If you are under a time crunch, then look into purchasing a USB stack(?) from one of the master chip makers. I have just finished a USB slave device. I am not a PC programmer, and the PC guy is not a embedded programmer. ( i.e. he really didn't understand hardware quirks, I don't really understand how M$ could make thing so difficult ) Lots of fun creating a package that works well on both ends.
> software is written to be a master on a serial bus. There is no code to be > a slave on the USB bus (those functions on the Palm<->PC end were taken > care of by hotsync). On the other end, how does an 8-bit embedded device > run such a host mode USB controller, when it expects to be the slave on a > serial bus?
Welcome to a brave new world. You are not the only one in this.
> Anyway, sorry to vent, but this is an issue that's been bugging me for a > while. > > Jeff.
Good luck, after you solve your problems and get things working, someone in a few months will ask (like you), if you would share your code. You will of course say no. Just like people are not able to share now. There companies have spent $$ months to solve this product problem, and do not want to just give it away. When USB vendors decide that our embedded systems need support as well as slave peripherals, maybe we will get some help. hamilton
hamilton <hamilton@deminsional.com> wrote in 
news:415833ea$1_1@omega.dimensional.com:

> If you are under a time crunch, then look into purchasing > a USB stack(?) from one of the master chip makers.
We don't use a commercial RTOS, and the hardware resources aren't available (for instance, our CPU runs with the internal 4K RAM and 128K flash, with no external RAM or Flash/ROM). Adding the required memory adds a lot of cost, in a cost critical device (one member of the device family is at a $50 price point, adding even $5 to the base cost puts it out of the market, price wise).
> Good luck, after you solve your problems and get things working, > someone in a few months will ask (like you), if you would share > your code.
Nah, I know I won't get code for free. Actually, I don't want to use USB at all, if I don't have to. I'm just, like others, lamenting the loss of RS-232. Jeff.