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 CCS Technical Support

USB<->UART Bridge

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



Joined: 02 Feb 2010
Posts: 354

View user's profile Send private message

USB<->UART Bridge
PostPosted: Wed May 27, 2020 2:58 am     Reply with quote

Hello,

I'm using CCS usb cdc uart bridge with no problems. Is it possible to set uart baud rate when opened in windows application?

Best Regards!
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Wed May 27, 2020 6:45 am     Reply with quote

Yes, but you will have to write your program to do it.

The 'bridge' over the USB, runs at a constant rate. Baud rate changes
don't change anything about this. Typically one packet is sent every mSec
giving a maximum of 64000bytes/second.
When you change the baud rate on the virtual port, Windows sends a
'set line coding' request to the USB device. This is automatically copied into
the usb_cdc_line_coding structure by the receive code. The first 32bits of this
structure is an int32, containing the baud rate required.
So your code would need to read the value in this, and change the physical
UART rate to match it. The line coding is normally always re-transmitted as
part of opening the port.
kmp84



Joined: 02 Feb 2010
Posts: 354

View user's profile Send private message

PostPosted: Wed May 27, 2020 6:56 am     Reply with quote

Hi Mr.Ttelmah,

Yes, I saw also example "ex_usb_to_serial.c" in ccs's exaples folder.

Thanks and Best Regards!
kmp84



Joined: 02 Feb 2010
Posts: 354

View user's profile Send private message

PostPosted: Wed May 27, 2020 7:23 am     Reply with quote

I forgot to ask one more important question:
Is it possible and easy to emulate two serial ports with this driver?

Best Regards!
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Wed May 27, 2020 7:38 am     Reply with quote

You would have to generate a composite device. Look at the example for
keyboard and mouse which shows how this is done.
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