Format main.asm

This commit is contained in:
2023-02-22 20:37:27 +04:00
parent 3ea3ca1d01
commit 083b3221a1

View File

@@ -2,41 +2,41 @@
; Author: Maksim Vinogradov ; Author: Maksim Vinogradov
; ;
;-----Ports setup----- ;-----Ports setup-----
ldi r16, 0b10000000 ldi r16, 0b10000000
out DDRD, r16 out DDRD, r16
out PORTD, r16 out PORTD, r16
;-----Waiting for start signal----- ;-----Waiting for start signal-----
start: sbis PIND, 3 ; Check for sync pulse on the 3rd pin start: sbis PIND, 3 ; Check for sync pulse on the 3rd pin
rjmp start rjmp start
;-----Puls formation----- ;-----Pulse formation-----
ldi r18, 5 ; Delay 210 us ldi r18, 5 ; Delay 210 us
ldi r19, 92 ldi r19, 92
delay: dec r19 delay: dec r19
brne delay brne delay
dec r18 dec r18
brne delay brne delay
ldi r19, 11 ; Setup 11 pulses ldi r19, 11 ; Setup 11 pulses
pulses: cbi PORTD, 7 ; Setup 1 onto the 7th pin pulses: cbi PORTD, 7 ; Setup 1 onto the 7th pin
ldi r18, 13 ; Delay 2.6 us ldi r18, 13 ; Delay 2.6 us
pause1: dec r18 pause1: dec r18
brne pause1 brne pause1
sbi PORTD, 7 ; Setup 0 onto the 7th pin sbi PORTD, 7 ; Setup 0 onto the 7th pin
ldi r18, 33 ; De;ay 6.5 us ldi r18, 33 ; Delay 6.5 us
pause2: dec r18 pause2: dec r18
brne pause2 brne pause2
dec r19 dec r19
brne pulses brne pulses
;-----Waiting for the end of the start signal----- ;-----Waiting for the end of the start signal-----
wait: sbic PIND, 3 ; Check for the end of the sync pulse on the 3rd pin wait: sbic PIND, 3 ; Check for the end of the sync pulse on the 3rd pin
rjmp wait rjmp wait
rjmp start rjmp start