;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;; MAX 6957 Eingabe ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; maxpruefen: ldi r25,0b10001011 ; Lese Port Configuration P15,P14,P13,P12 ldi tmp2,0b01010101 ; GPIO output rcall maxeingabe ldi r25,0b01001100 ; schreibe in Port P12...P19 ldi tmp2,0b00000000 ; schreibe alle auf 0 rcall maxeingabe ende:rjmp ende maxeingabe: ldi werte,0 ; setzt werte auf 0 maxeingabe2: sbrc r25,7 ; springe wenn bit7 Low sbi PORTB,0 ; setze PORTB,BIT0 auf High sbrs r25,7 ; springe wenn Bit7 High cbi PORTB,0 ; setze Bit7 auf 0 nop nop ; sbi PORTB,3 ; Setze BIT3 SCLK auf high nop nop cbi PORTB,3 ; Setze Bit3 SCLK auf Low lsl r25 ; schiebe r25 nach links 01010101==>10101010 inc werte ; erhöhe Werte um 1 ==> 1 Wert geschrieben cpi werte,16 ; vergleiche werte mit 16 breq maxende ; wenn gleich ==> 16 Werte geschrieben ==> Maxende cpi werte,8 ; vergleiche Werte mit 8 brne maxeingabe2 ; Wenn ungleich ==> Maxeingabe2 mov r25,tmp2 ; kopiere tmp2 in r25 rjmp maxeingabe2 ; springe maxeingabe2 ing tmp2 ein maxende: ; __ sbi PORTB,2 ; Setze CS auf 1 nop nop ; __ cbi PORTB,2 ; Setze CS auf 0 nop nop Ret