-
Notifications
You must be signed in to change notification settings - Fork 0
/
lcd.asm
88 lines (83 loc) · 1.08 KB
/
lcd.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
;asigns label to memories
portb equ 06h
pcl equ 02h
porta equ 05h
status equ 03h
pointer equ 0dh
bsf status,5
movlw 00h
movwf portb ;sets input and output ports
movwf porta
bcf 03h,5
movlw 00h
movwf porta
movwf portb
;initializes the lcd
movlw 38h ;sets the matrix to 5 by 7
call cmd_wrt
movlw 80h ;shifts the cursor to position 0
call cmd_wrt
movlw 14h
call cmd_wrt
movlw 0eh
call cmd_wrt
movlw 0ch ;hides the cursor
call cmd_wrt
start
movlw d'95'
call data_wrt
movlw 'E'
call data_wrt
movlw 'L'
call data_wrt
movlw 'C'
call data_wrt
movlw 'O'
call data_wrt
movlw 'M'
call data_wrt
movlw 'E'
call data_wrt
movlw 01h
call cmd_wrt
goto start
;delay sub routine
delay
movlw 1
movwf 4dh
times
movlw 2
movwf 4ah
movlw 0
movwf 4bh
movlw 0
movwf 4ch
loop1
loop2
loop3
decfsz 4ch,1
goto loop3
decfsz 4bh,1
goto loop2
decfsz 4ah,1
goto loop1
decfsz 4dh,1
goto times
return
data_wrt
movwf portb
movlw 05h
movwf porta
call delay
movlw 04h
movwf porta
return
cmd_wrt
movwf portb
movlw 01h
movwf porta
call delay
movlw 00h
movwf porta
return
end