new port init + added schematic url
[my-code/atmel.git] / led_plex / main.asm
index cfa8c2e..23b33c3 100644 (file)
@@ -1,5 +1,7 @@
 ; main file of led_plex project
 ;
+; schematics: http://hackdaworld.org/download/led_plex/led_plex.png
+;
 ; author: hackbard@hackdaworld.org
 ;
 
@@ -10,6 +12,8 @@
 .def   tmp1            = r16
 .def   tmp2            = r17
 .def   uart_rxtx       = r18
+.def   hc595_sink      = r19
+.def   hc595_source    = r20
 
 ;
 ; interrupts
@@ -31,13 +35,13 @@ reti
 reti
 
 ; T1 OVF1
-rjmp T1_OVF1
+rjmp T1_OVF
 
 ; T0 OVF0
-rjmp T0_OVF0
+rjmp T0_OVF
 
 ; UART RX
-rjmp UART_RX
+rjmp UART_RECEIVE
 
 ; UART UDRE
 reti
@@ -72,18 +76,18 @@ reti
 ; WDT OVF
 reti
 
-
-; include control defines
-.include "ctrl.def"
+;
+; init and main code
+;
 
 RESET:
 INIT:
 
-       ; port init
+       ; gio port init
        rcall PORT_INIT
 
        ; timer init
-       rcall TIMER_INIT
+       ;rcall TIMER_INIT
 
        ; uart init
        rcall UART_INIT
@@ -99,7 +103,14 @@ INIT:
        ;sei 
 
        ; signal ready output
-       ldi uart_rxtx,0x23
+       ldi uart_rxtx,0x68
+       rcall UART_TX
+
+       ; testing ... DO NOT CONNECT LEDS BY NOW !!!
+       ldi hc595_sink,0xff
+       ldi hc595_source,0xff
+       rcall SET_HC595
+       ldi uart_rxtx,0x61
        rcall UART_TX
 
 MAIN:
@@ -118,12 +129,12 @@ MAIN:
 ; interrupt routines
 ;
 
-T1_OVF1:
+T1_OVF:
        reti
 
-T0_OVF0:
+T0_OVF:
        reti
 
-UART_RX:
+UART_RECEIVE:
        reti