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

Re: Set a perticular Baud rate

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

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).

--
Grant Edwards grante Yow! My uncle Murray
at conquered Egypt in 53
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
|> 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).
|>>> 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 |
|---------------------------------------/----------------------------------|
| 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

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!
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.
|>|>>> 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 |
|---------------------------------------/----------------------------------|
| 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

Probably not.
He may need a new xtal or oscillator.

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

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!
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
- » Many Embedded Linux Ebook
- — Next thread in » Embedded Linux
-
- » Frame buffer driver for X server
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » What limits noise in voltage regulators?
- — The site's Newest Thread. Posted in » Electronics Design
-
- » Slow (industrial?) SD cards
- — The site's Last Updated Thread. Posted in » Embedded Programming
-