How to set a custom baud rate using 2.6 linux distro on MPC5200 based board?
Eric N. Johnson (ACD)
ejohnson at acdstar.com
Wed Feb 16 10:55:21 EST 2005
>I'm trying to set a custom baud rate (500KBaud, in case anyone cares) on
>one of the PSCs on a MPC5200 board.
[snip]
> serial_info.flags = ASYNC_SPD_CUST | ASYNC_LOW_LATENCY;
> serial_info.custom_divisor = 48; // clock on FTDI chip / 48 == 500KB
>
> if ( ioctl(tty_fd, TIOCSSERIAL, &serial_info ) < 0) {
> perror("config_serial_port: ioctl TIOCSSERIAL");
> return(-1);
> }
>
>This compiled fine under the ppc cross-dev tools we have but it fails with
>an "invalid argument" error when run on the ppc board.
It looks like this code was written for an FTDI serial port. The FTDI is a
USB to Serial converter that handles baud rate generation very differently
from a standard UART.
Eric
More information about the Linuxppc-embedded
mailing list