Solved

76800 Baud in windows

Posted on 2003-11-11
9
1,163 Views
Last Modified: 2007-12-19
Hi there,
I have a problem that if I try to enter 76800 into the DCB structure, the actual baud rate it produces is 115200.
Is there any way I can acheive 76800 as it is required by a piece of gear I need to connect to. (Usually with a micro).
Thanks in advance
David S


BTW: I've been away from this site for a while. Although the site looks very 'pretty' and pleasing to the eye, does anyone find it a tad difficult to navigate?
Although I know it now, I thought the bar at the top is not obvious enough that it is a list of topics. Just my opinion.
 cheers all :o)
0
Comment
Question by:dsch
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 250 total points
ID: 9726552
76800 is not a standard multiple of the UART clock frequency.  Some (but not many) serial port hardware devices can possibly do this but in general you'll need to special and very flexible COM port card with a fully programmable bit clock to do this.

What kind of goofy gear would use this? The standard frequencies are:

150
300
1200
2400
4800
9600
19200
38400
115K
0
 
LVL 1

Author Comment

by:dsch
ID: 9726831
I write software for Radio modules that interface with RS232 data, and the fastest speed for the clock we can acuratley run with on the micro is 76800 which is a speed my customer is requesting. It is OK for his micro, but murder for us to set PC software to do the testing of his modules.
If there's no way to do this then I wouldn't lose too much sleep on it, I just needed to find out if there was a simple solution, setting etc to do it.
Thanx for your comments jhance
DS
0
 
LVL 13

Expert Comment

by:SteH
ID: 9730353
You can set other baud rates than the standard ones by programming the divisor latch.
http://www.lookrs232.com/rs232/dlab.htm
gives some hint how the baud rate is set. The only problem here is that there is no integer divisor to get to your desired value (1.5 is the divisor). Depending on the effort you can put into this you can either try a card which supports other rates or change the quartz from 1.8 MHz to some larger value which should allow the standard frequencies plus your desired one. This could be doubling the frequency but more likely you will find only 18.xx MHz. In that case you need 15 as divisor but have to write a driver to set the DLAB values correctly for normal windows operation. When windows wants to set it to 6 you have to put 60 in it.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9762844
57600 should be a valid rate (CBR_57600) and that would be closer to your goal.

What have you tried?  There is setting the literal value into DCB.BaudRate and there is also BuildCommDCB().  How do you know what value is actually being set?

-- Dan
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:dsch
ID: 9762901
Unfortunatley the Micro's accuracy is over 3% @ 57600 so cannot be used.
SetCommState & GetCommState have been used.
The value does return as if I have set it at 76800.
Haven't used BuildCommDCB(), can't see how It would help as I need SetCommState to apply the DCB to the port.

Thanks again
DS

BTW SteH:
Way, way wayyyyyyyyy over my head! :o) But illuminating non the less. ThanX
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10249028
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 10249338
I believe that jhance's comment is the correct answer.
-- Dan
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10249693
Sorry Dan, but I just guide myself because of the askers comment.
I guess jhance's answer maybe the correct one, but as the asker didn't acknowledge it as such, in fact I believe he did just the opposite, I recommended the PAQ with refund.

Tincho
0
 
LVL 1

Author Comment

by:dsch
ID: 10250853
Hi,
Never got this working in 76800 but if it it the opinion of the panel I will accept jhance as answer. THere was always the off chance that someone may have replied knowing of a working solution.
Thanx
dsch
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now