4. PREPARE AND SEW ON THE IC SOCKET
4a. Before you start sewing threads onto the IC socket, you should familiarize yourself with the pins of the
microcontroller. Follow along on the pin layout diagram for the ATmega16 chip, shown below.
All the pins labeled PA0-PA7, PB0-PB7, PC0-PC7, and PD0-PD7 are general-purpose input/output pins that
can be used to power LEDs and the like. See my sample code and header files at craftzine.com/01/led to
see how to reference and control individual pins with your code. You can download AVR microcontroller
datasheets from craftzine.com/go/avr8.
4b. Use the following diagram as a guide to tell you which thread goes to which socket. (If you’ve chosen a
different number of rows or columns, you’ll assign them to the PA-PD pings somewhat differently.)
Row 0
Row 1
Row 2
Row 3
Row 4
Row 5
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 10
Column 13
Column 12
Column 11
Column 9
Column 8
(XCK/T0) PB0 1 40 PA0 (ADC0)
(T1) PB1 2 39 PA1 (ADC1)
(IN T2/AIN0) PB2 3 38 PA2 (ADC2)
(OC0/AIN1) PB3 4 37 PA3 (ADC3)
AVR ATmega16
(SS) PB4 5 36 PA4 (ADC4)
(MOS1) PB5 6 35 PA5 (ADC5)
(MISO) PB6 7 34 PA6 (ADC6)
(SCK) PB7 8 33 PA7 (ADC7)
RESET 9 32 AREF
+ VCC 10 31 GND
GND 11 30 AVCC
XTAL2 12 29 PC7 ( TOSC2)
XTAL1 13 28 PC6 ( TOSC1)
(RXD) PD0 14 27 PC5 ( TDI)
( TXD) PD1 15 26 PC4 ( TDO)
(INT0) PD2 16 25 PC3 (TMS)
(IN T1) PD3 17 24 PC2 ( TCK)
- (OC1B) PD4 18 23 PC1 (SDA)
(OC1A) PD5 19 22 PC0 (SCL)
(ICP1) PD6 20 21 PD7 (OC2)