Getting Started

(lily) #1

Chapter 4: C Types, Operators, and Expressions


few as 6 I/O pins on
e ATTINY11 ($0.54) to as many as 54 on the ATMEGA169 ($8.60), the
microcontroller used on the Butterfly. Most of these pins are organized into ports,
collections of pins that are setup and used with port specific access and control
registers. Many of the pins have more than one possible function: they can be
sed to t digital logic data or they might be used for detecting
xternal interrupts or as input for clocks or for analog to digital conversions and
o on. In this section we’ll be looking at digital I/O.


he ATMEGA169 on the Butterfly has six 8-bit and one 4-bit general purpose I/O
ports shown in Figure 13 ATMega169 Block Diagram (copied from the
ATMega169 data book page 3, Figure 2.) Looks mighty complex doesn’t it? Well
this is a simplified block diagram of a circuit that is vastly more complex. When
you see a photomicrograph of these chips they resemble aerial photos of a vast
ancient city with streets laid out in a grid surrounded by a wall. The ports are the
gates to the city where the ancient electrons riding their very tiny ancient donkeys
enter and leave the city. I’d continue in this vein but then I’d probably win a prize
in the awful metaphor competition so I’ll stop.


When this book was written, Digi-Key listed AVRs with as
th


u input or outpu
e
s


T


ATmega169 Silicon Die Curtesty of Christopher Tarnovsky from Flylogic.net
Free download pdf