ts-7000
[Top] [All Lists]

[ts-7000] RTS and DTR polarity reversed on /dev/ttyAM0?

To:
Subject: [ts-7000] RTS and DTR polarity reversed on /dev/ttyAM0?
From: "genosensor" <>
Date: Sun, 27 Mar 2005 06:17:33 -0000

Hi,

I've been trying to interface a microcontroller to /dev/ttyAM0
that requires RTS be asserted from the host be output before it will
transmit.

RTS is asserted by the TS-7200 until /dev/ttyAM0 is opened.
Then it is immediately deasserted.

At least, that's what I observe.

After some head scratching, I was forced to conclude that 
RTS and DTR on port AM0 were being output with their polarities
reversed -- they are deasserted when that should be asserted 
and visa-versa.

I've attached a patch to fix this.
Has anyone else run into this problem?
I've seen some posts about trouble with pppd that might be
explained by having these lines inverted.

---------------------

cvs diff -u ep93xx_amba.c (in directory
/home/brent/linux/technologic/linux24/drivers/serial)
Index: ep93xx_amba.c
===================================================================
RCS file:
/home/cvs/linux/technologic/linux24/drivers/serial/ep93xx_amba.c,v
retrieving revision 1.1
diff -u -r1.1 ep93xx_amba.c
--- ep93xx_amba.c       24 Mar 2005 23:35:57 -0000      1.1
+++ ep93xx_amba.c       27 Mar 2005 06:13:58 -0000
@@ -523,20 +523,17 @@
 
 static void csambauart_set_mctrl(struct uart_port *port, unsigned int
mctrl)
 {
-       struct uart_amba_port *uap = (struct uart_amba_port *)port;
-       unsigned int ctrl = 0;
+    struct uart_amba_port *uap = (struct uart_amba_port *)port;
        
        /* If there's no RTS and DTR for this UART, do nothing here */
-       if(     (uap->rts_mask == 0) && (uap->dtr_mask == 0) )
-               return;
-  
-    if ((mctrl & TIOCM_RTS) == 0)
-               ctrl |= uap->rts_mask;
-       
-    if ((mctrl & TIOCM_DTR) == 0)
-               ctrl |= uap->dtr_mask;
-    
-       UART_PUT_MCR(ctrl, port);
+    if ( uap->rts_mask | uap->dtr_mask ) {  
+      unsigned int ctrl = 0;
+      if (mctrl & TIOCM_RTS)
+                 ctrl |= uap->rts_mask;
+      if (mctrl & TIOCM_DTR)
+                 ctrl |= uap->dtr_mask;
+      UART_PUT_MCR(ctrl, port);
+    }
 }
 
 static void csambauart_break_ctl(struct uart_port *port, int break_state)







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



<Prev in Thread] Current Thread [Next in Thread>
  • [ts-7000] RTS and DTR polarity reversed on /dev/ttyAM0?, genosensor <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU