Most MCUs allow software configure whether a physical pin be used as
input or output. On the ATMega128 (and other members of the AVR family),
each binary I/O pin has two bits for configuration:
- direction: whether the pin is input or output
- state: for an output pin, whether it should drive high or low
In addition, there is also a ``sense'' or ``input'' bit for each
binary I/O pin that reports either a 1 (for a high voltage) or a
0 (for a low voltage) at the pin.
Subsections
Copyright © 2006-02-15 by Tak Auyeung