From 435321341893d026b0b2b194df52d79891c4528a Mon Sep 17 00:00:00 2001 From: hackbard Date: Wed, 25 Oct 2006 20:40:05 +0000 Subject: [PATCH] /* no comment */ --- beginners/light_control.asm | 99 +++++++++++++++++++++++++++---------- beginners/s90_to_tiny.inc | 14 ++++-- 2 files changed, 81 insertions(+), 32 deletions(-) diff --git a/beginners/light_control.asm b/beginners/light_control.asm index 432ca7d..2c70736 100644 --- a/beginners/light_control.asm +++ b/beginners/light_control.asm @@ -7,14 +7,17 @@ ; specify device .include "../include/2313def.inc" +; for register/bit definitions compatibility +.include "./s90_to_tiny.inc" + ; ------------------ ; interrupt vectors: ; ------------------ ; reset -rjmp RESET +rjmp INIT ; int0 -reti +rjmp INT_ROUTINE ; int1 reti ; timer 1 capture @@ -54,47 +57,89 @@ reti ; code: ; ----- -RESET: +INIT: ; set stackpointer ldi r16,low(RAMEND) ; write top of ramend (lowbyte) out SPL,r16 ; to stackpointer ; rs232 init - ldi r16,12 ; "38.4k bps @ 8 mhz" in r16 - out UBRR,r16 ; write to uart baudrate register + ldi r16,0 + out UBRRH,r16 + ldi r16,12 ; "38.4k bps @ 8 mhz" / "4.8k bps @ 1 mhz" + out UBRRL,r16 ; write to uart baudrate register ldi r16,(1<