Atmega128 I/O Ports: Versus
Atmega128 I/O Ports: Versus
Atmega128 I/O Ports: Versus
The AVR I/O ports are the path to the outside world. Understand how to use them and life is good. Failure to understand how the ports are used will cause grief and possibly cost $'s. An abused I/O port is fairly easy to burn out with excessive current or static damage. -most all the I/O ports are floating inputs that can build up large static charge Never carry your AVR board in a non static-dissipative bag. -dry fall days are perfect for creating conditions for ESD damage -practice safe electronics, use the pink bag Using proper port software conventions will keep code transportable, readable and more bug free. i.e., TIMSK|=(1<<TOIE0);//setsabit Versus TIMSK=b01000000;//clobberstheregister
-protection diodes -programmable pull-up resistor -what happens if voltages exceeding Vcc are applied to an I/O pin? -can you power a chip from an I/O pin?
DDRx 0=in
port pin
analog switch
latch
flip flop
PINx
DDRB
7 6 5 4 0 0 0 0 7 6 5 4 0 0 0 0 7 6 5 4 ? ? ? ?
3 2 1 0 0 0 1 1 3 2 1 0 1 0 0 1 3 2 1 0 ? ? 0 1
PORTB
PINB