From 204affb08caa9c97cdd1cc010f5a8fbaa0571992 Mon Sep 17 00:00:00 2001 From: hackbard Date: Sun, 31 May 2009 02:28:27 +0200 Subject: [PATCH] new port init + added schematic url --- led_plex/main.asm | 2 ++ led_plex/port.asm | 21 +++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) 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: -- 2.39.2