Rainbow-electronics ATmega128L Uživatelský manuál Strana 64

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 331
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 63
64
ATmega128(L)
2467B09/01
Figure 31. Synchronization when Reading a Software Assigned Pin Value
The following code example shows how to set port B pins 0 and 1 high, 2 and 3 low, and
define the port pins from 4 to 7 as input with pull-ups assigned to port pins 6 and 7. The
resulting pin values are read back again, but as previously discussed, a nop instruction
is included to be able to read back the value recently assigned to some of the pins.
nop in r17, PINx
0xFF
0x00
0xFF
t
pd
out PORTx, r16
SYSTEM CLK
r16
INSTRUCTIONS
SYNC LATCH
PINxn
r17
Zobrazit stránku 63
1 2 ... 59 60 61 62 63 64 65 66 67 68 69 ... 330 331

Komentáře k této Příručce

Žádné komentáře