Thread Tools
This thread is privately moderated by Jack Crossfire, who may elect to delete unwanted replies.
Apr 14, 2017, 11:57 PM
Registered User
Jack Crossfire's Avatar
Thread OP
Discussion

FT2232 notes


The closest you'll get to a vintage computer might be the FT2232. It's 1 of the older FTDI chips, but apparently still in production, widely available, & quite capable. It's a dual serial interface. The high end is the FT4xxx line which are quad serial interfaces.

The trick with the FT2232 is to not use the commercial drivers, but use libftdi. Most of the commercial drivers don't support it but libftdi does. Also, libmpsse provides limited abstraction of libftdi into SPI, I2C, & GPIO interfaces, but it doesn't allow simultaneous GPIO control & hardware protocols which the FT2232 does allow & it has many bugs. The trick is to refer to libmpsse to get the command structure for the hardware protocols, but directly call libftdi commands in your own program to control the GPIOs.

It's not clear how he figured out the command structure besides sniffing packets as they went through libusb. FTDI doesn't document it anywhere. Fortunately, it's not a very complicated protocol. The chip doesn't have any concept of GPIO, SPI, I2C modes the way libmpsse does. Libmpsse just uses mode settings to determine what commands to send, but the chip can accept any command in any mode.

The hardest part is figuring out the pins labeled GPIOH & GPIOL are ambiguous. What's really happening is all the pins labeled ADBUS are GPIOs written in a traditional 8 bit GPIO register & all the pins labeled ACBUS are written in another 8 bit register. They can be simultaneously driven by a hardware protocol & direct GPIO register writes. Didn't do anything with the B*BUS pins, but they're probably driven by similar overlapping GPIO & protocol registers on the 2nd USB interface.

What libmpsse calls SET_BITS_HIGH should be called SET_ACBUS. SET_BITS_LOW should be called SET_ADBUS. The standard use is to write a GPIO register to set the CS pin, then send the command for an SPI transfer. There's no hardware control of the CS pin. It's only set by GPIO writes.

You probably don't want to access it from a linux command line program but a phone. Forget about IOS. They require a lengthy application to get the developer tools for anything using the lightning port. Android is quite easy to use as a USB host. usb-serial-for-android on github is a useful starting point for porting over the relevant bits of libmpsse & libftdi.
Last edited by Jack Crossfire; Apr 15, 2017 at 03:59 AM.
Sign up now
to remove ads between posts


Quick Reply
Message:
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion FBI Releases Hillary Clinton’s Email Interview Notes kenpoprofessor Life, The Universe, and Politics 4 Sep 04, 2016 11:53 AM
Discussion Maybe a brighter note? Norman Adlam Life, The Universe, and Politics 4 Jul 26, 2016 09:54 AM
Contest Deleted note...Discare Note.. guyg Aerial Photography 1 Aug 19, 2009 11:33 AM