]> hackdaworld.org Git - my-code/atmel.git/commitdiff
initial pld stuff -> parents house now! :)
authorhackbard <hackbard>
Mon, 17 Apr 2006 17:38:56 +0000 (17:38 +0000)
committerhackbard <hackbard>
Mon, 17 Apr 2006 17:38:56 +0000 (17:38 +0000)
beginners/pld_stily.asm [new file with mode: 0644]

diff --git a/beginners/pld_stily.asm b/beginners/pld_stily.asm
new file mode 100644 (file)
index 0000000..53a7f9d
--- /dev/null
@@ -0,0 +1,65 @@
+;
+; pld for stily (and yvonne) ;)
+;
+; author: hackbard@hackdaworld.org
+;
+
+.include "../include/2313def.inc"
+
+; ------------------
+; interrupt vectors:
+; ------------------
+; reset
+rjmp INIT
+; int0
+reti
+; int1
+reti
+; timer/counter capt 1
+reti
+; timer/counter compare
+reti
+; timer/counter overflow 1
+rjmp INC_LASER_COUNT
+; timer/counter overflow 0
+reti
+; uart rx complete
+reti
+; uart data register empty
+reti
+; uart tx complete
+reti
+; analog comparator
+reti
+
+INIT:
+; set stackpointer
+ldi r16,low(RAMEND)
+out SPL,r16
+; timer 0 setting
+ldi r16, 3
+out TCCR1B, r16
+; timer 0 enable
+ldi r16, (1<<TOIE1)
+out TIMSK, r16
+; registers
+ldi r23,0
+ldi r24,0
+
+MAIN:
+rcall SET_FREQ ; read/set frequency from adc
+
+rjmp MAIN
+
+SET_FREQ:
+
+
+INC_LASER_COUNT:
+inc r23
+reti
+
+TOGGLE_LASER:
+inc r24
+reti
+
+