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
- posted
17 years ago
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
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
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 visi.com B.C. And I can prove it too!!
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 ]
That API does not support the desired baud rate.
-- Grant Edwards grante Yow! The PILLSBURY at DOUGHBOY is CRYING for visi.com an END to BURT REYNOLDS movies!!
On Thu, 01 Mar 2007 17:42:32 -0000 Grant Edwards wrote: | On 2007-03-01, Roberto Waltman wrote: |> 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 | | first name lower case at ipal.net / spamtrap-2007-03-01-1201@ipal.net | |------------------------------------/-------------------------------------|
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! visi.com
On Thu, 01 Mar 2007 18:11:04 -0000 Grant Edwards wrote: | On 2007-03-01, snipped-for-privacy@ipal.net 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). | | 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 | | first name lower case at ipal.net / spamtrap-2007-03-02-1224@ipal.net | |------------------------------------/-------------------------------------|
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 visi.com
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
There is no problem. It isn't possible to do the baud rate you require using standard PC hardware.
Peter
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! visi.com
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.