From c47dd91780b474f2166a5edc21666445d7fd6405 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Thu, 3 Sep 2020 17:24:11 +0200 Subject: Input Readout bits not negated. Manual clearing of input shift register. --- Software/pinlock.asm | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'Software') diff --git a/Software/pinlock.asm b/Software/pinlock.asm index 84d4dd7..b088dab 100644 --- a/Software/pinlock.asm +++ b/Software/pinlock.asm @@ -24,8 +24,10 @@ init: ldi tmp0, 0b11101110 out DDRD, tmp0 cbi PORTC, 0 + sbi PORTC, 6 sbi DDRC, 0 sbi DDRC, 1 + sbi DDRC, 6 ldi tmp0, 0b00000000 out PORTD, tmp0 ldi heart, 0 @@ -286,8 +288,25 @@ input_write_high: rcall input_write_clk ret input_read: - ; load push tmp0 + ; clear + cbi PORTC, 6 + push par0 + push par1 + push par2 + ldi par0, 1 + ldi par1, 1 + ldi par2, 1 + rcall wait + sbi PORTC, 6 + ldi par0, 1 + ldi par1, 1 + ldi par2, 1 + rcall wait + pop par2 + pop par1 + pop par0 + ; load sbi PORTD, 2 cbi PORTD, 2 push par0 @@ -335,12 +354,12 @@ input_write_clk: ldi par0, 1 ldi par1, 1 ldi par2, 1 - rcall wait + ;rcall wait sbi PORTC, 1 ldi par0, 1 ldi par1, 1 ldi par2, 1 - rcall wait + ;rcall wait pop par2 pop par1 pop par0 @@ -353,12 +372,12 @@ input_read_clk: ldi par0, 1 ldi par1, 1 ldi par2, 1 - rcall wait + ;rcall wait sbi PORTD, 5 ldi par0, 1 ldi par1, 1 ldi par2, 1 - rcall wait + ;rcall wait pop par2 pop par1 pop par0 @@ -367,26 +386,7 @@ input_read_bit: ldi ret2, 0 sbic PIND, 4 ldi ret2, 1 - ; - ;cpi ret2, 0 - ;breq debug_dsp - ;push par0 - ;push par1 - ;ldi par0, 0 - ;ldi par1, 1 - ;rcall display - ;pop par1 - ;pop par0 ret -;debug_dsp: - ;push par0 - ;push par1 - ;ldi par0, 0 - ;ldi par1, 7 - ;rcall display - ;pop par1 - ;pop par0 - ;ret input_read_row_0: andi ret0, 0xF0 or ret0, tmp0 -- cgit v1.2.1