Programming FTDI devices in Python

FTDI modules

FTDI chips are frequently used as USB-to-serial adaptors, but the newer devices have the ability to drive more complex protocols such as SPI and I2C.

I like to use Python when first experimenting with new PC hardware, and there are some Python libraries for interfacing to FTDI chips, but I couldn’t find any real projects or complete worked examples.

The following posts demonstrate a step-by-step approach to driving the FTDI chips from Python, to learn about their functionality. In the final part, I implement a pure-Python SWD interface that can access the internals of a CPU while it is running, in a similar way to much more sophisticated debug tools, such as OpenOCD.

Part 1: Initial experimentation

Part 2: Using Linux

Part 3: Using MPSSE to drive an SPI device

Part 4: First steps towards accessing an ARM CPU using SWD

Part 5: Reading CPU internals with SWD

Reporta: Graphical display of ARM CPU activity

Copyright (c) Jeremy P Bentham 2018. Please credit this blog if you use the information or software in it.