Next:
3. Binary Input/Output
Up:
Robot Programming in ``C''
Previous:
2.2.2.2 Simulavr + Insight
Contents
II
. Basic Input/Output and Peripherals
Subsections
3
. Binary Input/Output
3
.
1
Hardware Aspects
3
.
2
Configuration
3
.
2
.
1
Including header files
3
.
2
.
2
Naming convention
3
.
2
.
3
``Registers'' for the ports
3
.
2
.
4
What is ``pull up''?
3
.
2
.
5
Configuration code
3
.
3
Common Input Techniques
3
.
3
.
1
Edge Sensing
3
.
3
.
1
.
1
Busy Polling
3
.
3
.
1
.
2
Stateful Event Detection
3
.
3
.
2
Debouncing
3
.
3
.
2
.
1
The Concept
3
.
3
.
2
.
2
The Implementation
3
.
3
.
2
.
3
Explanations
4
. The Timer Device
4
.
1
Functions
4
.
1
.
1
As a Stopwatch
4
.
1
.
2
As a Source of Periodic Tick
4
.
1
.
3
Pulse Width Modulation (PWM)
4
.
2
ATMega128 Timer Configuration
4
.
2
.
1
Timer Configuration
4
.
2
.
2
PWM Configuration
5
. Interrupts and Interrupt Service Routines
5
.
1
Concept
5
.
1
.
1
The global interrupt enable flag
5
.
1
.
2
The interrupt vector
5
.
1
.
3
Interrupt service routines
5
.
1
.
4
Writing an ISR
5
.
1
.
5
But what about
INTERRUPT
?
5
.
2
Timer ISR
Copyright © 2006-02-15 by Tak Auyeung