Re: [PATCH 2/2] serial: imx: Fix the CTS_B polarity in RS485 mode

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

 



On Sat, Feb 18, 2017 at 11:35:51AM +0100, Maarten Brock wrote:
> On 2017-01-30 12:12, Fabio Estevam wrote:
> > From: Fabio Estevam <fabio.estevam@xxxxxxx>
> > 
> > When userspace passes the SER_RS485_RTS_ON_SEND flag it means that the
> > CTS_B pin should go to logic level high before the transmission begins.
> 
> So setting the SER_RS485_RTS_ON_SEND flag sets CTS_B active high during
> send.

No, CTS_B is an active-low output, so SER_RS485_RTS_ON_SEND leads to a
logic level low CTS_B during transmit.

> 
> > When userspace passes the SER_RS485_RTS_AFTER_SEND flag it means that
> > the
> > CTS_B pin should go to logic level low after the transmission finishes.
> 
> And setting the SER_RS485_RTS_AFTER_SEND flag sets CTS_B active low after
> send ?

No, this also sets CTS_B to logic level low, but after the transmission
ends.

> 
> I don't get it. First, isn't CTS an input instead of an output?

On the i.MX6, CTS_B is an output and can be connected for example to the
transceive-enable input of a RS-485 transceiver.
The name is confusing, I guess this is due to the different meaning in
DTE/DCE mode.

> And if I follow this through and want CTS_B high during a transmit only then
> I
> must set both SER_RS485_RTS_ON_SEND and SER_RS485_RTS_AFTER_SEND.

If you want CTS_B to be logic high during transmit, then you only set
SER_RS485_RTS_AFTER_SEND and clear SER_RS485_RTS_ON_SEND.

On our board we invert the signal in hardware, so we can use the default
setting (only SER_RS485_RTS_ON_SEND), then go through the inverter to
the active-high transmit-enable input of the transceiver.

Clemens
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux