Getting Started

(lily) #1

Chapter 7: Microcontroller Interrupts and Timers


me of this code will have concepts that will be explained later. Expect a little
nap.

Table 22 on page 47. Two of these

figured to trigger a PCI0 interrupt
PCI1 interrupt.

on both Port B and Port E making

joystick like it was intended. The joystick pins

So
confusion. Now may be a good time for a


The Atmega169 data book lists 23 interrupts in
interrupts, the Pin Change Interrupts: PCI0 and PCI1 are triggered by changes on
some of the port pins. Pins on Port E can be con
and pins on Port B can be configured to trigger a


The joystick just happens to be attached to pins
it an ideal candidate to study interrupts with the added benefit that when we get
though, we’ll be able to use the
map as follows:


Bit 7 6 5 4 3 2 1 0


A O
D C


E B A O D C


t

-------------------

PORTB B

PORTE

PORTB | PORT

=======

Where:
A = up
B = down
O = center push
D = lef
C = right

Free download pdf