RS485 RTS Line Toggling Available in FTDI USB<->Serial Hub Chips - Has Anyone Tried This?

308 views
Skip to first unread message

Jeff Andich

unread,
May 2, 2018, 9:13:06 AM5/2/18
to BeagleBoard

Hi,

Our custom board based on the BB-X15 has a(n) FT4232 USB<->serial hub to realize some of our serial ports.  From the data sheet and programming guide, it looks like the chip supports RS485 toggling of a DE pin on a 485 chip via the chip's TXDEN line.  But the data sheet and programming guide suggest that the FTDI chip's EEPROM needs to be programmed with the appropriate flags enabled to enable auto-toggling of TXDEN around transmit and receive.  

I briefly looked through    KERNEL (uname-r = 4.4.110-ti-r142)/drivers/usb/serial/ftdi_* to see if there's already an interface in the driver for initializing/re-initializing the FTDI chip's EEPROM to enable 485 mode.  I did see references to 485 for other devices, but I haven't yet found anything obvious about enabling TXDEN specifically for this family of chips...

Has anyone tried utilizing an FTDI USB<->serial hub for RS485 and is familiar with enabling the TXDEN line for this purpose in Linux?  If so, any insight would be greatly appreciated!!  Also are there any limitations in the driver or the chip that you're aware of?

Thanks!

Jeff

Jeff Andich

unread,
Aug 6, 2018, 4:07:59 PM8/6/18
to BeagleBoard
First of all, my statement was incorrect.  There is no EEPROM on the FTDI FT4232H USB<->4 channel serial hub. You can add an EEPROM and connect it to the FTDI chip per "section 7" in the FTDI datasheet (http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4232H.pdfand then enable the FTDI FT4232's 485 mode, per serial channel by setting a 485 mode flag in the EEPROM.  

We're just in the process of testing out the FT4232's RS485 mode by connecting the FT4232 Mini Module's (a development board for the FTDI 4232H chip) mini USB connector, http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_FT4232H_Mini_Module.pdf
to one of the BeagleBoard-X15's USB port, and then powering the Mini Module off of the BB-X15's USB bus.  A photo of this setup is attached.  

When you connect the Mini Module to the BB-X15, you see /dev/ttyUSB0...USB3.

Thus far, we're able to see the FT4232's TXDEN line auto toggle when we send 10 characters out /dev/ttyUSB3 at 9600 baud.  But we haven't yet done any protocol testing with a 485 XCVR chip and another party to talk to (e.g. MODBUS) with this configuration.

You can write to the EEPROM via the FT4232 chip using the tool, ftdi_eeprom, contained within a later version of libftdi, libftdi1, version, 1.4.  The following page from the CM3 home automation board (containing a PI and the FTDI 4232H chip), describes how to obtain and build the version of libftdi containing ftdi_eeprom which allows you to 
write a configuration to the EEPROM, erase the EEPROM, and flash the EEPROM, not in that order.  This appears to work ok on our BB-X15 (uname -r and /etc/dogtag provided below).


The only thing which seems a little weird to me is, when I use the ftdi_eeprom utility to re-write the EEPROM, the FTDI chip is restarted, and /dev/ttyUSB0..USB3 are disconnected, and then re-connected.  But for some reason, /dev/ttyUSB3 doesn't re-connect until I re-boot the BB-X15.


OS Image versions:

uname -r:                                 4.4.110-ti-r142
cat /etc/dogtag:                        Debian Image (Console Image) 2018-01-01
cat /etc/debian_version:           8.10


Attached are photos of the BB-X15 connected to the FT4232H Mini Module and a photo of the scope shot of the TXDEN line and Txd line for /dev/ttyUSB3 channel with the chd_rs485 flag (channel's a..d) set to true in the EEPROM config file:

Let me know what else you'd like to know about this setup or have any suggestions/concerns.

Will try to update this as I get further along.

Thanks!

Jeff
BBX15_FT4232_MINI_MODULE_SETUP.jpg
SCOPE_OUTPUT_RS485_FT4232H_CHANNEL_D.jpg
Reply all
Reply to author
Forward
0 new messages