Step 4Let's build!
The ATtiny2313 portion of the schematic is just the Ghetto Development System with three blinkenlights (LED1, 2, and 3, plus R4, 5, and 6) and a pushbutton (S1) hooked to it, plus one additional detail. That detail is the addition of jumpers (JP4, 5, and 6) which can be removed to allow connection of the I2C bus SCL and SDA lines. The jumpers must be in place for programming, then removed so SCL and SDA can be connected. The photos show the jumpers in place and removed. Placement of these jumpers is up to you, you just have to put them on your Ghetto Development System if you want to use the I2C bus. The I2C bus must be disconnected and the jumpers put in place for programming. Note that you only really need to be concerned with JP4 and JP6 for the I2C bus. Put in JP5 if you think you'll ever want to use the SPI bus.
Breadboarding the PCA8574A I/O Port Expander is very simple. Provide Vcc (+5 volts) and Gnd (ground) connections and connect AD0, 1, and 2 to ground (makes the I2C slave address 38 hex). Then connect 4 blinkenlights, and 4 DIP switches. (If you don't have DIP switches you can just use wires. Tie to ground or leave floating to signal on or off respectively.) Finally, connect the pull-up resistors (R11 and 12) from SDA and SCL to Vcc. These are shown as 3.3K, but any value from 1.8K to 5.1K should work (maybe up to 10K but I haven't tried that). Once you've programmed the ATtiny2313 you can remove the jumpers and connect SDA and SCL for testing.
Now for the ATmega168. The only wrinkle here is that you may not have built a Ghetto Development System for this processor. If that's the case, then the schematic I provide (MEGA I2C.pdf) will show you how. This is just a permutation of the ATtiny2313 version. If you plan ahead you can make sure your programming cable will fit both systems. The main difference is the addition of C2 and C3. See the pictures for placement of these, they should be very close to the chip; one of them is actually under the chip. These help keep noise out of the analog to digital converter in particular. You don't need to put in the jumpers unless you plan to use the SPI bus since they're not needed for the I2C bus on this chip. Note that the PCA8754A breadboard will be unchanged. You'll just hook up SDA and SCL and away you go! Easy, huh?
I2C Schematics.zip75 KB| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|

















































