View previous topic :: View next topic |
Author |
Message |
Guest
|
Converting to USB..... |
Posted: Wed Jan 24, 2007 3:02 pm |
|
|
Hi All,
I have a serial-based data acquisition product that has been in production for about 5 years. My boss recently informed me that we need to convert this product to USB for a large customer, and to ensure future sales. Of course, the code is written in CCS C, and works perfectly. I need to give my boss an answer pretty quickly about the degree of difficulty doing this conversion. The only thing that needs to change is the method of communication, so the scope is pretty limited. I just bought the "Complete USB" book, but it won't be here for a few days....... Is this project a '1', a '10', or somewhere in between??
Brett |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Jan 24, 2007 3:56 pm |
|
|
Depends on how you implement USB. The easiest solution would be an FTDI FT232R which "bolts" up to the PIC's UART. Your firmware stays the same and only a hardware change. |
|
|
grasspuddle
Joined: 15 Jun 2006 Posts: 66
|
|
Posted: Fri Jan 26, 2007 1:59 pm |
|
|
To do a 'real' USB functionality. I.E. write usb driver, usb code, etc. etc. is definately a 10 for first time getting into usb drivers.
Fortunately the FTDI chip (mentioned in above post) can really make it as easy as implementing a serial connection. Since you already have the code for serial look at the simple rs232 chips which basically use the Tx and Rx wires from ur serial into its chip and outputs to usb connection. I have yet to try this out, but after researching this is definately the easiest way to go. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Jan 26, 2007 3:54 pm |
|
|
Not really true. You can easily make your own USB to Serial converter out of a PIC. Drivers are standard and there is plenty of code available. Now you wouldn't actually need to make the USB to serial converter, only implement the USB portion. Instead of transmitting the received data out of the UART, you would just act on it. This would require firmware changes and possibly the flow of the program depending on how you are currently handling the received data. |
|
|
gs
Joined: 22 Aug 2005 Posts: 30 Location: Ioannina - Greece
|
|
Posted: Fri Jan 26, 2007 5:19 pm |
|
|
Quote: | You can easily make your own USB to Serial converter out of a PIC. Drivers are standard and there is plenty of code available |
Hey Mark, I'm interested in this could you point me to the right direction?
A few valid links would be nice. _________________ www.hlektronika.gr |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Sat Jan 27, 2007 2:42 pm |
|
|
Code: | /////////////////////////////////////////////////////////////////////////
//// ////
//// ex_usb_serial.c ////
//// ////
//// A demonstration of the USB CDC API that is provided by CCS. ////
//// The USB CDC API that CCS provides will create a virtual UART ////
//// port. USB CDC drivers are included with most versions of ////
//// Microsoft Windows, and when properly loaded will create a COMx ////
//// port from which you can write and read to your PIC device ////
//// like any serial device that has a COMx port. ////
//// ////
//// This example creates a USB<->UART converter. Open ////
//// Hyperterminal to COM1 (or whatever COM port is your usual RS232 ////
//// serial COM port). Plug the PIC to USB. Open Hypertimernal to ////
//// the new COM port that is the USB<->UART COM port (for this ////
//// example say it is COM2). Typing a character in COM1 will cause ////
//// it to be sent out COM2, and vice-versa. ////
//// ////
|
|
|
|
|