Google

Monday, July 9, 2007

Project 1

Project #1
Turn the LEDs on

Feature used: PortD


.include “m8535def.inc” ;the file included depends on kind of micro used

.org 0 ;this is called interrupt vector
rjmp main ;the address 0 means RESET (by power or pin RESET)

main:
ldi r16, low(RAMEND) ;the next 4 rows indicates inisialization of stack register
out SPL, r16
ldi r16, high(RAMEND)
out SPH, r16

ser r16
out DDRD, r16 ;DDRD = $FF, means all of pins at PortD defined as output
out PORTD, r16 ;PORTD = $FF, means each of pins at PortD assigned to out a '1' logic
;the LEDs must be put in high active logic (cathodes connected to GND)

No comments: