hwi2c

Early Bus Pirate prototypes used PIC24FJ64GA002 revision A3 chips. A3 has a bug in the I2C hardware, so we’ve always used a software library to provide I2C on the Bus Pirate. Many, but not all, of the Bus Pirates manufactured by Seeed Studio have a newer, revision B4 chip with working I2C hardware. We showed how to check your PIC revision last week.

Project contributors (thanks JoseJX!) with revision B4 silicon were able to get the hardware I2C module working. We’ve included this update in the latest nightly firmware. You can follow our guide to firmware updates on Windows or Linux/OSX.

Read more about hardware I2C on the Bus Pirate after the break.

HiZ>m<<<mode menu
1. HiZ
<<<10 other modes clipped to save space
12. HWI2C
(1) >12 <<<hardware I2C
MODE SET
WARNING: HWI2C mode is broken on this PIC! (REV A3) <<<warning for broken PIC
Set speed:
1. 100KHz
2. 400KHz
3. 1MHz
SPEED>(1) ><<<we selected default speed of 100KHz
HWI2C READY
HWI2C>

The hardware I2C mode is currently option 12, though that may change before the final release. A warning is displayed if the I2C hardware on your PIC is buggy (revision A3 or earlier). If you see a warning, you can verify your PIC revision from the status information menu (i). Hardware I2C mode will only work on PIC revisions B4 or later.

A nice feature of the library is support for low, full, and high-speed I2C using the accurate internal I2C baud rate generator. Select a speed during setup, press enter for the default speed (100KHz).

If you’ve got A3 silicon and you really want to use the hardware I2C features, we’ll show you how to do a PIC transplant in a future post.

Advertisements