Set a perticular Baud rate

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi all,
I want to know how to read through serial port with a particular baud
rate of 33.6 Kbaud.
Please help me I am stucked in the problem
Regards,
Meenal


Re: Set a perticular Baud rate

Quoted text here. Click to load it

What UART, what crystal frequency, what baud rate generator (if
separate) ?

When using non-standard bit rates, the first thing is to check if it
is at all possible to load suitable divisor values into the baud rate
generators to achieve the desired bit rate.

After that you may have to modify the device driver to load those
divisor values.

Paul
 

Re: Set a perticular Baud rate

Quoted text here. Click to load it

Most UARTs have one or more registers used to set the baud rate
divisor.  You need to write the divisor value(s) corresponsing
to 33.6K baud to the appropriate register(s).

Quoted text here. Click to load it

--
Grant Edwards                   grante             Yow!  My uncle Murray
                                  at               conquered Egypt in 53
We've slightly trimmed the long signature. Click to see the full one.
Re: Set a perticular Baud rate
Quoted text here. Click to load it

Correct, but since this is comp.os.LINUX.embedded, try

   man termios  [cfsetispeed(), cfsetospeed(), etc.]

Roberto Waltman

[ Please reply to the group,
  return address is invalid ]

Re: Set a perticular Baud rate
Quoted text here. Click to load it

That API does not support the desired baud rate.

--
Grant Edwards                   grante             Yow!  The PILLSBURY
                                  at               DOUGHBOY is CRYING for
We've slightly trimmed the long signature. Click to see the full one.
Re: Set a perticular Baud rate
|> Grant Edwards wrote:
|>>> I want to know how to read through serial port with a particular baud
|>>> rate of 33.6 Kbaud.
|>>
|>>Most UARTs have one or more registers used to set the baud rate
|>>divisor.  You need to write the divisor value(s) corresponsing
|>>to 33.6K baud to the appropriate register(s).
|>
|> Correct, but since this is comp.os.LINUX.embedded, try
|>
|>    man termios  [cfsetispeed(), cfsetospeed(), etc.]
|
| That API does not support the desired baud rate.

Maybe it would be sufficient for the OP to add his own new ioctl() to set
the divisor.  But if there is no way to inquire the clock frequency, then
it makes the caller more device dependent (less of an issue in embeeded
than in hosted).

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org)  /  Do not send to the address below |
We've slightly trimmed the long signature. Click to see the full one.
Re: Set a perticular Baud rate

Quoted text here. Click to load it

After thinking about it some more, the API used by setserial to
talk to tty devices supports setting an arbitrary baud rate
divisior.  I don't know if the low-level driver for the OP's
device supports that API or not.

--
Grant Edwards                   grante             Yow!  MY income is ALL
                                  at               disposable!
We've slightly trimmed the long signature. Click to see the full one.
Re: Set a perticular Baud rate
|
|>|>>> I want to know how to read through serial port with a particular baud
|>|>>> rate of 33.6 Kbaud.
|>|>>
|>|>>Most UARTs have one or more registers used to set the baud rate
|>|>>divisor.  You need to write the divisor value(s) corresponsing
|>|>>to 33.6K baud to the appropriate register(s).
|>|>
|>|> Correct, but since this is comp.os.LINUX.embedded, try
|>|>
|>|>    man termios  [cfsetispeed(), cfsetospeed(), etc.]
|>|
|>| That API does not support the desired baud rate.
|>
|> Maybe it would be sufficient for the OP to add his own new ioctl() to set
|> the divisor.  But if there is no way to inquire the clock frequency, then
|> it makes the caller more device dependent (less of an issue in embeeded
|> than in hosted).
|
| After thinking about it some more, the API used by setserial to
| talk to tty devices supports setting an arbitrary baud rate
| divisior.  I don't know if the low-level driver for the OP's
| device supports that API or not.

Then he doesn't need a new ioctl().  He may need a new driver (or tweak
the one he has).  If it can set a standard baud rate and inquire what the
divisor is, then other rates should be easy.

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org)  /  Do not send to the address below |
We've slightly trimmed the long signature. Click to see the full one.
Re: Set a perticular Baud rate
Quoted text here. Click to load it

Probably not.


He may need a new xtal or oscillator.

Quoted text here. Click to load it

Not necessarily.  For the standard PC UART setup, the baud rate
is 115.2K divided by the baud rate divisor.  That means you
can't get to 33.6K w/o plugging in the soldering iron and
swapping something.

--
Grant Edwards                   grante             Yow!  Is this TERMINAL fun?
                                  at              
We've slightly trimmed the long signature. Click to see the full one.
Re: Set a perticular Baud rate
Hi Grant,
For 33.6 there is no divisor value as if i use the value 4 then i get
28.8 baud rate , and if i use 3 then i get 38400 these both are the
standard baud rate that are available. I want to have 33.6 baud which
is can be achieved if i use 3.4 as divisor , but divisor should be an
integer... i am still stucked in same problem. please help me out.
thanks a lot,
 meenal


Re: Set a perticular Baud rate
Quoted text here. Click to load it

There is no problem. It isn't possible to do the baud rate you require using
standard PC hardware.

Peter



Re: Set a perticular Baud rate

Quoted text here. Click to load it

It's already been explained to you several times.

You can not do 33.6K with a standard PC serial port.

You're going to have to buy a serial board that either can do
33.6K or can be modified by you by replacing a crystal or
oscillator.

Somebody has even suggested a serial board that they knew would
do 33.6K.

I'm tired of repeating myself.

I'm done with this thread.

--
Grant Edwards                   grante             Yow!  My haircut is totally
                                  at               traditional!
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline