-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TM1637.pio
56 lines (43 loc) · 891 Bytes
/
TM1637.pio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.program TM1637
.side_set 1 opt
set pins, 1 side 1
START:
pull block
START_COND:
set x, 7
set pins, 1 side 1 [7]
set pins, 0
set pins, 0 side 0
BIT_SHIFT_LOOP:
out pins, 1 side 0
nop side 1
jmp x-- BIT_SHIFT_LOOP side 0
ACK_COND:
set pins, 0 side 0
nop side 1
nop side 0 [1]
STOP_COND:
set pins, 0 side 1
set pins, 1 side 1
jmp !OSRE START_COND_SEND_DIGIT
jmp START
START_COND_SEND_DIGIT:
set pins, 1 side 1 [7]
set pins, 0
set pins, 0 side 0
SEND_CMD_AND_DATA:
set x, 7
BIT_SHIFT_LOOP_SEND_DIGIT:
out pins, 1 side 0
nop side 1
jmp x-- BIT_SHIFT_LOOP_SEND_DIGIT side 0
ACK_COND_SEND_DIGIT:
set pins, 0 side 0
set y, 1 side 1
nop side 0 [1]
jmp !OSRE SEND_CMD_AND_DATA
STOP_COND_SEND_DIGIT:
set pins, 0 side 1
set pins, 1 side 1
IN y, 32;
PUSH noblock;