SWHarden
SWHarden

Reputation: 146

FTDI Bit-Bang Jitter (FT232R vs FT232H)

When I bit-bang the RX and TX pins on the FT232H, output is beautiful. When I repeat on the FT232R it is awful. What is causing signals to look so bad on the FT232R? Note that I'm using a FT232R breakout board (from sparkfun) and a FT232H breakout board (from ADAfruit).

enter image description here

The image above is from this C# program running on both breakout boards:

const byte PIN_TX = 0b00000001;
const byte PIN_RX = 0b00000010;

public static FTDI ftdi = new FTDI();
public static FTDI.FT_STATUS ft_status = FTDI.FT_STATUS.FT_OK;
public static UInt32 bytesWritten = 0;

static void Main(string[] args)
{

    // open and configure the FTDI device
    ftdi.OpenByIndex(0);
    ftdi.SetBitMode(0, 0);
    ftdi.SetBitMode(PIN_TX | PIN_RX, 0x01); // Asynchronous Bit Bang Mode
    ftdi.SetBaudRate(9600);

    // create some data to send
    byte[] data = new byte[1234];
    for (int i = 0; i < data.Length; i++)
    {
        data[i] = 0;
        if (i % 2 == 1) data[i] |= PIN_RX;
        if (i % 4 == 1) data[i] |= PIN_TX;
    }

    while (true)
    {
        ftdi.Write(data, data.Length, ref bytesWritten);
    }

}

Upvotes: 1

Views: 3053

Answers (2)

Andrew Lentvorski
Andrew Lentvorski

Reputation: 306

This is an Errata that is supposed to only be Revision A of the FT232R. However, I can confirm that this is still broken in 2019.

Upvotes: 1

SWHarden
SWHarden

Reputation: 146

Apparently this is a known problem with FT232R. It is addressed in the FT232R errata (page 4) and demonstrated on these web pages:

Upvotes: 3

Related Questions