CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Converting to USB.....

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








Converting to USB.....
PostPosted: Wed Jan 24, 2007 3:02 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Jan 24, 2007 3:56 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 26, 2007 1:59 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Fri Jan 26, 2007 3:54 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Fri Jan 26, 2007 5:19 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Sat Jan 27, 2007 2:42 pm     Reply with quote

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.                         ////
////                                                                 ////
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group