I2C For The AVR Stick

Note: The AVR Stick mentioned in this post has been retired by SparkFun. For a similar project using the Adafruit Trinket go here.

In my previous post I mentioned the AVR Stick from Sparkfun and how I thought it would make a good development board for experimenting with the AVR ATTiny85. With that in mind, I’ve spent the last couple of weeks working on porting Till Harbaum’s i2c-tiny-usb code to the AVR Stick. The result is something I’ve named the I2C Stick.

As written, the I2C Stick software requires a slightly modification to the AVR Stick board. Pins 2 and 6 (PB3 and PB1) of the ATTiny 85 are used for the I2C clock and data, respectively. Since these are the pins connected to the white and yellow LEDs on an AVR Stick board the two 470 ohm resistors connected to these pins have to be removed. They’re small so you can crush them with a pair of tweezers if you don’t want to go through the trouble of desoldering them; the LEDs can be left in place.

I was surprised at how easily the port went. Most of the time was spent working to understand the original code and getting it to compile in AVR Studio. A project file with the modified code, a Windows driver, and small I2C bus scanner for testing is available on the V-USB wiki .

One more note. I2C clock and data lines are open-collector so they require pullup resistors. These are the two 10K resistors shown as connected to Vcc on the schematic. There is no easy place to include them on the AVR Stick board so they need to be mounted off-board or included in the circuit you are controlling. This can actually work to your advantage if the circuit being controlled operates at different voltage levels than the controller.

Advertisements

Comments are closed.

Tabula Candida

Doodles of a distracted historian

rtl-sdr.com

A blog about RTL-SDR (RTL2832) and cheap software defined radio

DuWayne's Place

Computers, Electronics, and Amateur Radio from KC3XM

QRP HomeBuilder - QRPHB -

Computers, Electronics, and Amateur Radio from KC3XM

Open Emitter

Computers, Electronics, and Amateur Radio from KC3XM

Ripples in the Ether

Emanations from Amateur Radio Station NT7S

m0xpd's 'Shack Nasties'

Computers, Electronics, and Amateur Radio from KC3XM

%d bloggers like this: