Skip to content

Instantly share code, notes, and snippets.

@michaelsarduino
Created July 26, 2015 09:40
Show Gist options
  • Save michaelsarduino/67c1835ac323205e50a5 to your computer and use it in GitHub Desktop.
Save michaelsarduino/67c1835ac323205e50a5 to your computer and use it in GitHub Desktop.
.include "m328Pdef.inc"
ldi r16, 0b11111111 //alle output in Arbeitsregister 16 kopieren
out DDRB, r16 //Arbeitsregister 16 in DDRB kopieren
ldi r16, 0b00000000 //alle input in Arbeitsregister 16 kopieren(der alte Inhalt wird ueberschrieben)
out DDRD, r16 //Arbeitsregister 16 in DDRD kopieren
Endlosschleife:
in r16, PIND //die anliegenden Spannungen des Ports D in Arbeitsregister 16 kopieren(uberschreiben)
out PORTB, r16 //den Inhalt des Arbeitsregisters 16(Spannungen der Inputs) auf die Outputs kopieren
rjmp Endlosschleife //Sprung im Programmcode zur Stelle Endlosschleife:.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment