Improve timing

This commit is contained in:
Jonathan BAUDIN 2023-09-21 18:46:22 +02:00
parent 84f57e00e8
commit 5fc62ae0a1

View file

@ -11,8 +11,8 @@
loop_init_low: ; wait 992 ms loop_init_low: ; wait 992 ms
jmp x-- loop_init_low [31] jmp x-- loop_init_low [31]
set pins, 1 ; set pin to high set pins, 1 [19] ; set pin to high (for 20µS)
set pindirs, 0 ; set pin as input set pindirs, 0 ; set pin as input
wait 0 pin 0 ; Wait for low wait 0 pin 0 ; Wait for low
wait 1 pin 0 ; wait for high wait 1 pin 0 ; wait for high
@ -25,12 +25,13 @@
wait 1 pin 0 ; wait for high wait 1 pin 0 ; wait for high
nop [29] ; wait for ~ 30 µS nop [29] ; wait for ~ 30 µS
nop [9] ; wait for ~ 10 µS
in pins, 1 ; read the pin state and store bit value in pins, 1 ; read the pin state and store bit value
push iffull noblock ; Push data if full jmp x--, loop_data ; Loop while there are bits left to read
jmp x--, loop_data ; Run until read all bitsw
push iffull noblock ; Push data if full
jmp y--, init_loop_data jmp y--, init_loop_data
push ; Push the last bytes push ; Push the last bytes