-
Notifications
You must be signed in to change notification settings - Fork 0
/
lcd.lst
360 lines (310 loc) · 12.3 KB
/
lcd.lst
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
ARM Macro Assembler Page 1
1 00000000 ; LCD.s
2 00000000 ; Student names: change this to your names or look very
silly
3 00000000 ; Last modification date: change this to the last modifi
cation date or look very silly
4 00000000
5 00000000 ; Runs on LM4F120/TM4C123
6 00000000 ; Use SSI0 to send an 8-bit code to the ST7735 160x128 p
ixel LCD.
7 00000000
8 00000000 ; As part of Lab 7, students need to implement these LCD
_WriteCommand and LCD_WriteData
9 00000000 ; This driver assumes two low-level LCD functions
10 00000000
11 00000000 ; Backlight (pin 10) connected to +3.3 V
12 00000000 ; MISO (pin 9) unconnected
13 00000000 ; SCK (pin 8) connected to PA2 (SSI0Clk)
14 00000000 ; MOSI (pin 7) connected to PA5 (SSI0Tx)
15 00000000 ; TFT_CS (pin 6) connected to PA3 (SSI0Fss)
16 00000000 ; CARD_CS (pin 5) unconnected
17 00000000 ; Data/Command (pin 4) connected to PA6 (GPIO)
18 00000000 ; RESET (pin 3) connected to PA7 (GPIO)
19 00000000 ; VCC (pin 2) connected to +3.3 V
20 00000000 ; Gnd (pin 1) connected to ground
21 00000000
22 00000000 40004100
DC EQU 0x40004100
23 00000000 00000000
DC_COMMAND
EQU 0
24 00000000 00000040
DC_DATA EQU 0x40
25 00000000 400043FC
GPIO_PORTA_DATA_R
EQU 0x400043FC
26 00000000 40008008
SSI0_DR_R
EQU 0x40008008
27 00000000 4000800C
SSI0_SR_R
EQU 0x4000800C
28 00000000 00000004
SSI_SR_RNE
EQU 0x00000004 ; SSI Receive FIFO
Not Empty
29 00000000 00000010
SSI_SR_BSY
EQU 0x00000010 ; SSI Busy Bit
30 00000000 00000002
SSI_SR_TNF
EQU 0x00000002 ; SSI Transmit FIFO
Not Full
31 00000000
32 00000000 EXPORT writecommand
33 00000000 EXPORT writedata
34 00000000
35 00000000 AREA |.text|, CODE, READONLY, ALIGN=
2
36 00000000 THUMB
ARM Macro Assembler Page 2
37 00000000 ALIGN
38 00000000
39 00000000 ; The Data/Command pin must be valid when the eighth bit
is
40 00000000 ; sent. The SSI module has hardware input and output FI
FOs
41 00000000 ; that are 8 locations deep. Based on the observation t
hat
42 00000000 ; the LCD interface tends to send a few commands and the
n a
43 00000000 ; lot of data, the FIFOs are not used when writing
44 00000000 ; commands, and they are used when writing data. This
45 00000000 ; ensures that the Data/Command pin status matches the b
yte
46 00000000 ; that is actually being transmitted.
47 00000000 ; The write command operation waits until all data has b
een
48 00000000 ; sent, configures the Data/Command pin for commands, se
nds
49 00000000 ; the command, and then waits for the transmission to
50 00000000 ; finish.
51 00000000 ; The write data operation waits until there is room in
the
52 00000000 ; transmit FIFO, configures the Data/Command pin for dat
a,
53 00000000 ; and then adds the data to the transmit FIFO.
54 00000000 ; NOTE: These functions will crash or stall indefinitely
if
55 00000000 ; the SSI0 module is not initialized and enabled.
56 00000000
57 00000000 ; This is a helper function that sends an 8-bit command
to the LCD.
58 00000000 ; Input: R0 8-bit command to transmit
59 00000000 ; Output: none
60 00000000 ; Assumes: SSI0 and port A have already been initialized
and enabled
61 00000000 writecommand
62 00000000 ;1) Read SSI0_SR_R and check bit 4,
63 00000000 ;2) If bit 4 is high, loop back to step 1 (wait for BUSY
bit to be low)
64 00000000 ;3) Clear D/C=PA6 to zero
65 00000000 ;4) Write the command to SSI0_DR_R
66 00000000 ;5) Read SSI0_SR_R and check bit 4,
67 00000000 ;6) If bit 4 is high, loop back to step 5 (wait for BUSY
bit to be low)
68 00000000
69 00000000 ; copy/paste Lab 7 solution here
70 00000000 490F LDR R1, =SSI0_SR_R
71 00000002 680A poll LDR R2, [R1]
72 00000004 F002 0310 AND R3, R2, #0x10
73 00000008 2B10 CMP R3, #0x10
74 0000000A D0FA BEQ poll
75 0000000C 490D LDR R1, =DC
76 0000000E F04F 0200 MOV R2, #0x00
77 00000012 700A STRB R2, [R1]
78 00000014 490C LDR R1, =SSI0_DR_R
79 00000016 7008 STRB R0, [R1]
80 00000018 4909 LDR R1, =SSI0_SR_R
81 0000001A 680A polll LDR R2, [R1]
ARM Macro Assembler Page 3
82 0000001C F002 0310 AND R3, R2, #0x10
83 00000020 2B10 CMP R3, #0x10
84 00000022 D0FA BEQ polll
85 00000024
86 00000024 4770 BX LR ; return
87 00000026
88 00000026 ; This is a helper function that sends an 8-bit data to
the LCD.
89 00000026 ; Input: R0 8-bit data to transmit
90 00000026 ; Output: none
91 00000026 ; Assumes: SSI0 and port A have already been initialized
and enabled
92 00000026 writedata
93 00000026 ;1) Read SSI0_SR_R and check bit 1,
94 00000026 ;2) If bit 1 is low loop back to step 1 (wait for TNF bi
t to be high)
95 00000026 ;3) Set D/C=PA6 to one
96 00000026 ;4) Write the 8-bit data to SSI0_DR_R
97 00000026
98 00000026 ; copy/paste Lab 7 solution here
99 00000026 4906 LDR R1, =SSI0_SR_R
100 00000028 680A pollll LDR R2, [R1]
101 0000002A F002 0302 AND R3, R2, #0x02
102 0000002E 2B00 CMP R3, #0x00
103 00000030 D0FA BEQ pollll
104 00000032 4904 LDR R1, =DC
105 00000034 F04F 0240 MOV R2, #0x40
106 00000038 700A STRB R2, [R1]
107 0000003A 4903 LDR R1, =SSI0_DR_R
108 0000003C 7008 STRB R0, [R1]
109 0000003E
110 0000003E
111 0000003E 4770 BX LR ; return
112 00000040
113 00000040
114 00000040 ;***************************************************
115 00000040 ; This is a library for the Adafruit 1.8" SPI display.
116 00000040 ; This library works with the Adafruit 1.8" TFT Breakout
w/SD card
117 00000040 ; ----> http://www.adafruit.com/products/358
118 00000040 ; as well as Adafruit raw 1.8" TFT display
119 00000040 ; ----> http://www.adafruit.com/products/618
120 00000040 ;
121 00000040 ; Check out the links above for our tutorials and wiring
diagrams
122 00000040 ; These displays use SPI to communicate, 4 or 5 pins are
required to
123 00000040 ; interface (RST is optional)
124 00000040 ; Adafruit invests time and resources providing this ope
n source code,
125 00000040 ; please support Adafruit and open-source hardware by pu
rchasing
126 00000040 ; products from Adafruit!
127 00000040 ;
128 00000040 ; Written by Limor Fried/Ladyada for Adafruit Industries
.
129 00000040 ; MIT license, all text above must be included in any re
distribution
130 00000040 ;****************************************************
ARM Macro Assembler Page 4
131 00000040
132 00000040 ALIGN ; make sure the end
of this section is
aligned
133 00000040 END ; end of file
4000800C
40004100
40008008
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M4 --apcs=interw
ork --depend=.\lcd.d -o.\lcd.o -I.\RTE\_SpaceInvaders -IC:\Keil_v5\ARM\PACK\ARM
\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Keil_v5\ARM\PACK\Keil\TM4C_DFP\1.1.0\Devic
e\Include\TM4C123 --predefine="__EVAL SETA 1" --predefine="__UVISION_VERSION SE
TA 526" --predefine="_RTE_ SETA 1" --predefine="TM4C123GH6PM SETA 1" --list=.\l
cd.lst LCD.s
ARM Macro Assembler Page 1 Alphabetic symbol ordering
Relocatable symbols
.text 00000000
Symbol: .text
Definitions
At line 35 in file LCD.s
Uses
None
Comment: .text unused
poll 00000002
Symbol: poll
Definitions
At line 71 in file LCD.s
Uses
At line 74 in file LCD.s
Comment: poll used once
polll 0000001A
Symbol: polll
Definitions
At line 81 in file LCD.s
Uses
At line 84 in file LCD.s
Comment: polll used once
pollll 00000028
Symbol: pollll
Definitions
At line 100 in file LCD.s
Uses
At line 103 in file LCD.s
Comment: pollll used once
writecommand 00000000
Symbol: writecommand
Definitions
At line 61 in file LCD.s
Uses
At line 32 in file LCD.s
Comment: writecommand used once
writedata 00000026
Symbol: writedata
Definitions
At line 92 in file LCD.s
Uses
At line 33 in file LCD.s
Comment: writedata used once
6 symbols
ARM Macro Assembler Page 1 Alphabetic symbol ordering
Absolute symbols
DC 40004100
Symbol: DC
Definitions
At line 22 in file LCD.s
Uses
At line 75 in file LCD.s
At line 104 in file LCD.s
DC_COMMAND 00000000
Symbol: DC_COMMAND
Definitions
At line 23 in file LCD.s
Uses
None
Comment: DC_COMMAND unused
DC_DATA 00000040
Symbol: DC_DATA
Definitions
At line 24 in file LCD.s
Uses
None
Comment: DC_DATA unused
GPIO_PORTA_DATA_R 400043FC
Symbol: GPIO_PORTA_DATA_R
Definitions
At line 25 in file LCD.s
Uses
None
Comment: GPIO_PORTA_DATA_R unused
SSI0_DR_R 40008008
Symbol: SSI0_DR_R
Definitions
At line 26 in file LCD.s
Uses
At line 78 in file LCD.s
At line 107 in file LCD.s
SSI0_SR_R 4000800C
Symbol: SSI0_SR_R
Definitions
At line 27 in file LCD.s
Uses
At line 70 in file LCD.s
At line 80 in file LCD.s
At line 99 in file LCD.s
SSI_SR_BSY 00000010
Symbol: SSI_SR_BSY
Definitions
At line 29 in file LCD.s
Uses
None
ARM Macro Assembler Page 2 Alphabetic symbol ordering
Absolute symbols
Comment: SSI_SR_BSY unused
SSI_SR_RNE 00000004
Symbol: SSI_SR_RNE
Definitions
At line 28 in file LCD.s
Uses
None
Comment: SSI_SR_RNE unused
SSI_SR_TNF 00000002
Symbol: SSI_SR_TNF
Definitions
At line 30 in file LCD.s
Uses
None
Comment: SSI_SR_TNF unused
9 symbols
351 symbols in table