OpenCores
URL https://opencores.org/ocsvn/diogenes/diogenes/trunk

Subversion Repositories diogenes

[/] [diogenes/] [trunk/] [examples/] [lcd_demo.asm] - Blame information for rev 238

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 218 fellnhofer
begin:
2
  @ set all 0
3
  ldi   l0, 0
4
  ldi   l3, 0xc0    @ RS
5
  stio  l0, [l3]
6
  nop
7
  ldi   l3, 0xd0    @ RW
8
  stio  l0, [l3]
9
  nop
10
  ldi   l3, 0xe0    @ E
11
  stio  l0, [l3]
12
  nop
13
  ldi   l3, 0xf0    @ DATA
14
  stio  l0, [l3]
15
  nop
16
 
17
  LDL   h3, :wr_cmd
18
  call  h4, 

19
  ldi   l0, 0x33    @ enable 4Bit Mode
20
 
21
  LDL   h6, :wr_data
22
  call  h7, 
23
  ldi   l0, 0x02
24
 
25
  LDL   h3, :wr_cmd
26
  call  h4, 

27
  ldi   l0, 0x28    @ 2line
28
  call  h4, 

29
  ldi   l0, 0x0c    @ disp on
30
  call  h4, 

31
  ldi   l0, 0x01    @ clear
32
 
33
  ldi   l0, 1       @ set RS = 1
34
  ldi   l1, 0xc0
35
  stio  l0, [l1]
36
 
37
  call  h4, 

38
  ldi   l0, 32
39
  call  h4, 

40
  ldi   l0, 32
41
  call  h4, 

42
  ldi   l0, 65
43
  call  h4, 

44
  ldi   l0, 78
45
  call  h4, 

46
  ldi   l0, 68
47
  call  h4, 

48
  ldi   l0, 73
49
  call  h4, 

50
  ldi   l0, 32
51
  call  h4, 

52
  ldi   l0, 38
53
  call  h4, 

54
  ldi   l0, 32
55
  call  h4, 

56
  ldi   l0, 68
57
  call  h4, 

58
  ldi   l0, 65
59
  call  h4, 

60
  ldi   l0, 86
61
  call  h4, 

62
  ldi   l0, 73
63
  call  h4, 

64
  ldi   l0, 68
65
 
66
  brnz  h4, :end
67
  nop
68
 
69
wait_ms:
70
  shi   l1, 7
71
wait_us:
72
  shi   l1, 6
73
lo0:
74
  brnz  l1, :lo0
75
  adi   l1, -1
76
  jump  
77
  nop
78
 
79
wr_cmd:
80
  or    l4, l0, l0
81
  LDL   h6, :wr_data
82
  shi   l0, -4
83
  call  h7, 
84
  nop
85
  ldi   l0, 0x0f
86
  and   l0, l0, l4
87
  call  h7, 
88
  nop
89
  jump  

90
  nop
91
 
92
wr_data:
93
  LDL   h5, :wait_ms
94
  call  h5, 
95
  ldi   l1, 150
96
 
97
  ldi   l1, 0xf0    @ DATA
98
  stio  l0, [l1]
99
  ldi   l1, 0xe0    @ E
100
  ldi   l0, 0x1
101
  stio  l0, [l1]
102
 
103
  LDL   h5, :wait_us
104
  call  h5, 
105
  ldi   l1, 250
106
 
107
  ldi   l1, 0xe0    @ E
108
  ldi   l0, 0x0
109
  stio  l0, [l1]
110
  jump  
111
  nop
112
 
113
end:
114
  stop
115
 
116
 
117
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.