Learning I2C With The Bus Pirate

When an air quality display project needed a display, [Inderpreet] looked into small character-based LCDs. [Inderpreet’s] chosen LCD used an I2C interface, which was new to him. Rather than shy away, [Inderpreet] grabbed his Bus Pirate and dove in!

I2C or Inter-Integrated Circuit serial interfaces are often mentioned here on Hackaday. They generally are easy to use, but as with all things, there are little gotchas which can make the road a bit more bumpy the first time you travel it. One of those things is voltage interfacing – I2C uses bidirectional open drain lines, so interfacing 3.3 V and 5V circuits requires a voltage level shifter circuit designed to handle that requirement. Thankfully in [Inderpreet’s] case, both his TI launchpad target devboard and the LCD used 3.3 volt logic levels.

buspirate2Before using the TI though, [Inderpreet] wanted to test with the Bus Pirate first. This would allow him to verify the hardware, and to make sure he was correctly using the I2C bus. The Bus Pirate can operate at 3.3V or 5V logic levels, and has on-board programming specific to the I2C bus. Controlling the Bus Pirate is as easy as hooking up a serial terminal program and plugging in a USB cable.

The I2C bus protocol is relatively simple, but can still be confusing to a new user. Each transaction needs an address, read/write bit, and a start command sent in the proper sequence before the data bytes can begin flowing. There are also acknowledge bits which prove that the data bytes are actually being received by the LCD. The Bus Pirate made all this easy, allowing [Inderpreet] to quickly display “Hello” on his LCD module.

The I2C bus is just the tip of the iceberg for the Bus Pirate. If you’re interested in learning more, check it out over at The Hackaday Store!

[via Dangerous Prototypes]

8 thoughts on “Learning I2C With The Bus Pirate

  1. I know this is a commercial, but couldn’t you find some more interesting project that uses BusPirate (btw. excellent tool)? Writing to I2C display using BP’s I2C capability!?! What’s next, programming EEPROMs using EEPROM programmer?

      1. That’s what I don’t get with people who comment here who complains about their time being “wasted” because of “useless”, or “repeated” articles when they can simply ignore, and refrain from commenting to further reduce their “wasted time”.

    1. Good catch on the ACK bit / byte mistake. But I have to disagree with you on being a summery of the I2C page. Part of the point I was trying to make (and I should have expressed this better in the last paragraph) is that using a known good tool is helpful when working with a new interface. The bus pirate is helpful here – but so are other tools like the Aardvark or the I2C modules built into many modern scopes.

  2. Perhaps there needs to be 2 versions of Hackaday. One for those that know a whole lot of information and another for those of us that may know some things and maybe not other things. There seems to be a lot of flak lately regarding topics and the stories associated with them. Remember people, there are those of us out there that may find stories like this just right as we are getting started in that particular area. I can also say that some of Hackaday’s articles are not interesting to me and that on others, my knowledge is above the level of the story. However I do not feel the need to go online and make comments regarding either of these states.
    One would hope that comments posted to these articles are to be in regards to the technical points of the article, but this is just my two cents worth.

    1. There is a 2nd version of Hackaday, it’s called Wikipedia. You can go there to see how to test I2C display with an I2C capable device. This Hackaday deals with much more complicated and much more interesting projects, that’s why I like it so much. And that’s why I comented and I will comment such nonsense “projects” like this one.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.