I am starting to tinker with the GreatFET as a possible candidate to be included in my toolbox of embedded development tools. I2C is a protocol I spend a lot of time messing around with, so that provided a good test case for trying out the GreatFET in a real-world situation.

As of the GreatFET’s 2020.1.2 firmware release, it now has a BusPirate emulation mode. This is in addition to a Python library and command line interface to interacting in a somewhat of a bit-banging manner.

Going back to my first experience with the BusPirate, I busted out a MCP4725 12-bit digital-to-analog converter. It has an address of 0x60 and takes two bytes to control the the output of the converter (0x00 0x00 to 0x0F 0xFF). The MCP4725 is 3V and 5V compatible.

First turn the GreatFET over and find the SDA, SCL, GND and 3V pins.

Make a 1:1 connection between those pins at the MCP4725. (SDA to SDA, SCL to SCL, GND to GND, 3.3V to VDD)

MCP4725 Breakout Board - 12-Bit DAC w/I2C Interface ID: 935 ...

Connect the GreatFET to the computer. Grab the latest firmware and host code here: https://github.com/greatscottgadgets/greatfet

Once installed, we can toggle the DAC to full on and full off as follows:

>gf i2c -a 0x60 -w 0x0F 0xFF -v
>gf i2c -a 0x60 -w 0x00 0x00 -v

I hooked up a logic analyzer and captured the following:

This shows that it takes the DAC about 5.212us to go from full off to full on (3.3V). Furthermore, it takes about 4.678us to from full on (3.3V) to full off.

Pretty cool.

It seems to work well. Plus I can write Python scripts to automate some testing. So looks like the GreatFET does make for a worthy upgrade from the BusPirate.

python_i2c_test.py
——————————-
import greatfet
gf = greatfet.GreatFET()
gf.i2c.scan()

Working I2C address(es): (Address, RW bit, frequency)
0 W [100000, 400000, 1000000]
60 W [100000, 400000, 1000000]
60 R [100000, 400000, 1000000]

W/R bit set at each valid address
0 1 2 3 4 5 6 7 8 9 a b c d e f
00 W- — — — — — — — — — — — — — — —
10 — — — — — — — — — — — — — — — —
20 — — — — — — — — — — — — — — — —
30 — — — — — — — — — — — — — — — —
40 — — — — — — — — — — — — — — — —
50 — — — — — — — — — — — — — — — —
60 WR — — — — — — — — — — — — — — —
70 — — — — — — — — — — — — — — — —