ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ltib] LPC3250 CTS/RTS for high speed UART


From: engin
Subject: [Ltib] LPC3250 CTS/RTS for high speed UART
Date: Wed, 4 May 2011 16:11:22 +0800

Dear Kevin,

We are trying to apply hardware flow control to HSUART7, but it seems to be
some problem:

1. The external device is connected to LPC3250 using HSUART7, and everything
is ok if CTS/RTS is disabled. For example:
        termios_new.c_cflag &= ~CRTSCTS;

   And then, we try to enable it, just like the following code:
        termios_new.c_cflag &= ~CSIZE;  //8
        termios_new.c_cflag |= CS8;

        // Set into raw, no echo mode
        termios_new.c_iflag = IGNBRK;
        termios_new.c_lflag = 0;
        termios_new.c_oflag = 0;
        termios_new.c_cflag |= CLOCAL | CREAD;

        termios_new.c_cflag &= ~PARENB;
        termios_new.c_cflag &= ~CSTOPB;

        termios_new.c_cflag &= ~CRTSCTS;
        termios_new.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
        termios_new.c_iflag &= ~(IXON | IXOFF | IXANY);
        termios_new.c_oflag &= ~OPOST;

    // (crtscts)
        termios_new.c_cflag |= CRTSCTS;

   But RTS and CTS level are low after tty is opened. So we looked into
lpc32xx_hs.c and mark out the CRTSCTS modification:
static void serial_lpc32xx_set_termios(struct uart_port *port,
        struct ktermios *termios, struct ktermios *old)
{
        unsigned long flags;
        unsigned int baud, quot;
        u32 tmp;

        /* Always 8-bit, no parity, 1 stop bit 
        termios->c_cflag &= ~(CSIZE | CSTOPB | PARENB | PARODD);
        termios->c_cflag &= ~(HUPCL | CMSPAR | CLOCAL | CRTSCTS);
//      termios->c_cflag |= CS8;
        termios->c_cflag |= CS8 | CREAD | CLOCAL;//8N1

//      termios->c_cflag &= ~(HUPCL | CMSPAR | CLOCAL | CRTSCTS); move to
above
        */
        baud = uart_get_baud_rate(port, termios, old, 0,
                (port->uartclk / 14));
        quot = __serial_get_clock_div(port->uartclk, baud);

   Unfortunately, RTS and CTS are still in low.


2.  We read the value of 0x4001C00C (HSU7_CTRL) register. It is 0x128D2. 
    That is, CTS and RTS are disabled even if CRTSCTS bit is set.
    So we manually write 0x568d2 to 0x4001C00C register. 
    Then RTS will be pull high, but no data will be sent out.
    We checked the driver code, LPC32XX_HSU_HRTS_EN and LPC32XX_HSU_HCTS_EN
are unused.
    So my question is, is hardware flow control function available for high
speed UART?

Thanks a lot!


Best Regards,
Engin Lee 李英準
Climax Technology Co., Ltd.
TEL: +886-2-2794-0001 ext. 234







reply via email to

[Prev in Thread] Current Thread [Next in Thread]