English
Language : 

ATMEGA8_08 Datasheet, PDF (54/308 Pages) ATMEL Corporation – 8-bit with 8K Bytes In-System Programmable Flash
When reading back a software assigned pin value, a nop instruction must be inserted as indi-
cated in Figure 24. The out instruction sets the “SYNC LATCH” signal at the positive edge of the
clock. In this case, the delay tpd through the synchronizer is 1 system clock period.
Figure 24. Synchronization when Reading a Software Assigned Pin Value
SYSTEM CLK
r16
0xFF
INSTRUCTIONS
out PORTx, r16
nop
in r17, PINx
SYNC LATCH
PINxn
r17
0x00
t pd
0xFF
54 ATmega8(L)
2486T–AVR–05/08