-
Notifications
You must be signed in to change notification settings - Fork 0
/
finepwm.asm
67 lines (53 loc) · 796 Bytes
/
finepwm.asm
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
57
58
59
60
61
62
63
64
65
66
.module charlie
.include "pdk.asm"
.include "uart.asm"
.include "charlie.asm"
;.include "animation.asm"
.include "map.asm"
.area DATA (ABS)
.include "memmap.asm"
tmp: .ds 1
.area CODE (ABS)
.org 0x00
clock_4mhz
easypdk_calibrate 4000000, 5000
charlie_init
uart_init
; ani_init
watchdog_enable
; animation
exit_countdown:
charlie_reset
mov a, #LED0_DIR
mov pac, a
mov a, #LED0_HIGH
mov new_pa, a
mov a, #1
mov i, a
clear new_pa
clear tmp
dec tmp
l1:
inc tmp
mov a, #0xf
and tmp, a
mov a, tmp
mov brightness_lo, a
sl brightness_lo
sl brightness_lo
inc brightness_lo
t0sn pa, #UART_RX_PIN
nop
t0sn pa, #UART_RX_PIN
nop
t0sn pa, #UART_RX_PIN
nop
t0sn pa, #UART_RX_PIN
nop
charlie_low_nibble l2
l2:
t0sn pa, #UART_RX_PIN
nop
t0sn pa, #UART_RX_PIN
nop
goto l1