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

USB function and Serial function

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



Joined: 09 Feb 2007
Posts: 1

View user's profile Send private message

USB function and Serial function
PostPosted: Fri Feb 09, 2007 10:28 am     Reply with quote

Hi,

I'm a new user; I have a problem.

My circuiti with 18f4550 have a compnent that comunicate with serial pin and the circuit comunicat with pc between USB port. My problem is , as I make to transfer data acquired of the serial prot of pic into pc?

I must use two funcition, one that acquire to serial data and another that put to usb?

Thanks

PS: Sorry for my english Smile
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Fri Feb 09, 2007 11:46 am     Reply with quote

Greetings francisco,

If you search the CCS forum for FTDI, there are many postings for USB to serial conversion. The FTDI USB-serial chip has the ability to communicate directly with the UART of the PIC. All you do is hook up the chip, install the drivers on the PC side, and you can communicate to your PIC through USB Smile . Other chip manufacturers which make similar chips include Silicon Labs and Maxim. The other alternative would be to use a PIC which supports USB communication.

Cheers,
JMA
Ttelmah
Guest







PostPosted: Fri Feb 09, 2007 3:23 pm     Reply with quote

He has a PIC with USB.
The answer is yes. You need to read the serial data, do any modification you want, and then write it to the USB.
However if all you want is serial to USB transfer, then you don't even need the PIC. The FTDI converters mentioned by the other poster, would do this.

Best Wishes
Guest








Sorry I rectify information
PostPosted: Fri Feb 09, 2007 3:35 pm     Reply with quote

Hi maybe I have write wrong information.

I have a hardware that it works correctly. I don't know as I make transfer data to rs232 on usb. Which funciton can transfer the data that acquire on pin rx and transfer this on usb? I use this code:

Code:

char string[4];
//-----ohter code-------
get_string_usb(string,4);
printf(usb_cdc_putc, "%s\n\r", string);


this code is correctly compiled but not received nothing.

Thanks

Francisco
Ttelmah
Guest







PostPosted: Fri Feb 09, 2007 4:17 pm     Reply with quote

get_string_usb, gets the string _from_ the USB. Look at the source code for this. To get a string from the RX pin, use 'get_string' (included in input.c), which will fetch characters from the serial pin (if this is setup right), and then send the results of _this_ to the USB.

Best Wishes
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