From: hackbard Date: Sun, 31 May 2009 00:28:27 +0000 (+0200) Subject: new port init + added schematic url X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=204affb08caa9c97cdd1cc010f5a8fbaa0571992;p=my-code%2Fatmel.git new port init + added schematic url --- diff --git a/led_plex/main.asm b/led_plex/main.asm index ef66821..23b33c3 100644 --- a/led_plex/main.asm +++ b/led_plex/main.asm @@ -1,5 +1,7 @@ ; main file of led_plex project ; +; schematics: http://hackdaworld.org/download/led_plex/led_plex.png +; ; author: hackbard@hackdaworld.org ; diff --git a/led_plex/port.asm b/led_plex/port.asm index 55e90e2..b5aec4b 100644 --- a/led_plex/port.asm +++ b/led_plex/port.asm @@ -6,10 +6,20 @@ PORT_INIT: ldi tmp1,0x0f out DDRB,tmp1 - ; g, rck, sck -> low / scl -> high - ldi tmp1,0x07 - out PORTB,tmp1 - sbi PORTB,3 + ; disable hc595 outputs + sbi PORTB,0 + + ; rck -> low + cbi PORTB,1 + + ; clear hc595 registers + cbi PORTB,3 + + ; rck -> high (store shift register data) + sbi PORTB,1 + + ; enable outputs + cbi PORTB,0 ; port d 6 -> output sbi DDRD,6 @@ -17,6 +27,9 @@ PORT_INIT: ; ser -> low cbi PORTD,6 + ; release hc595 register clear + sbi PORTB,3 + ret SET_HC595: