From: hackbard Date: Sun, 18 Dec 2011 21:31:53 +0000 (+0100) Subject: final version (before xmas) X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=6552af2f6025fc1fd8b9ee6af76ad663d0ec430b;p=my-code%2Fatmel.git final version (before xmas) --- diff --git a/beginners/rgb_moritz.asm b/beginners/rgb_moritz.asm index 51e4c32..bc3a72a 100644 --- a/beginners/rgb_moritz.asm +++ b/beginners/rgb_moritz.asm @@ -7,20 +7,27 @@ ; author: hackbard@hackdaworld.org -.include "../include/2313def.inc" +.include "../include/tn2313def.inc" ; defines & equals .def zero = r0 .def one = r1 +.def two = r2 .def tmp = r16 .def count = r17 .def red = r18 .def green = r19 .def blue = r20 .def rgb_level = r21 +.def rgb_dir = r22 +.def rgb_upd_cnt = r23 .equ pin_red = 0x01 .equ pin_green = 0x02 .equ pin_blue = 0x04 +.equ max = 255 +.equ min = 0 +.equ mid = 170 +.equ rgb_upd = 10 ; interrupt vectors ; reset @@ -34,9 +41,9 @@ reti ; timer/counter compare reti ; timer/counter overflow 1 -rjmp TCO1 -; timer/counter overflow 0 reti +; timer/counter overflow 0 +rjmp TCO0 ; uart rx complete reti ; uart data register empty @@ -57,18 +64,20 @@ ldi tmp,low(RAMEND) out SPL,tmp ; timer: clock/8 -ldi tmp,(1< output ; port b 0-2 -> high @@ -76,22 +85,40 @@ ldi tmp,0x07 out DDRB,tmp out PORTB,tmp +; uart +ldi tmp,0 +out UBRRH,tmp +ldi tmp,25 +out UBRRL,tmp +ldi tmp,(1<