Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Serial Communication Using MFC in VC++6 under XP

Posted on 2004-03-23
2
Medium Priority
?
331 Views
Last Modified: 2013-11-20
Hi,
Can any expert tell me "exactly" how MFC matches 50 Baud on serial comport

I had a look at http://msdn.microsoft.com/library/en-us/dnfiles/html/msdn_serial.asp?frame=true 
it only supports [110...19200...Baud]

Can I replace 110 by 50 as an argument in a function.If not, how can I write a class to do such thing.

"Only 50 Baud" !!!
Thanks for read
0
Comment
Question by:e-learning
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 750 total points
ID: 10657490
From MSDN topic DCB:

BaudRate
Specifies the baud rate at which the communications device operates. This member can be an actual baud rate value, or one of the following baud rate indexes:
CBR_110
...

I think you can do this. At least, you can try - call BuildCommDCB with 50 rate and read from output lpDCB parameter actual value.
0
 
LVL 13

Assisted Solution

by:SteH
SteH earned 750 total points
ID: 10668674
50 baud is a possible baud rate. As AlexFM stated you can use either a value or a predifined constant like CBR_xxx. To get all possible baud rates for a standard serial port you need to divide 1.8432 MHz by 16 first and then a 16 bit number which is programmed into a divisor latch. This number can take any value from 1 to 65535 leading to baud rates between 115200 and 1 baud. A value of 2304 corresponds to 50 bauds. So it should be possible.

New chips allow for higher speeds up to ~ 1 MBaud. With those it depends on the size of the divisor number and the initial frequency what baud rates at the low end are possible. But 50 baud should still be most likely possible:
50 * 65535 = 3,276,750. So for maximal baud rates below ~3 MBaud it is very likely that 50 bauds are possible.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Screencast - Getting to Know the Pipeline
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question