📄 lcd1.lst
字号:
283 ;---- set back port to initial status ----
284 00016 C7C0E300 S mov.b:s #R, pd1 ; set back P10 to P13 to input port
285 ; (set P10 to P13 as input port)
286 0001A F3 rts
287
288
289 ;""SUBR COMMENT""**************************************************************
290 ; ID : ---
291 ; subroutine name : int _lcd1__rd_nibble_creg(void)
292 ; function : read command register of LCD(SC1602BS*2)
293 ; input : none
294 ; output : int value have been read(only low 4 bits available)
295 ; subroutine used : none
296 ; stack : 0 byte
297 ; notice : because Write is fixed in OAKS8-LCDBoard, can not read
298 ; : get return value from R0(return value transfer rule)
299 ; :
300 ; : control the timing as below, there is rule for time
301 ; : --------------------------+--+--+--+-------+----+-----
302 ; : TIME RS RW E I/O-DIR LCD M16C
303 ; : --------------------------+--+--+--+-------+----+-----
304 ; : def= x 0 0 RD | IN IN
305 ; : BCLR:G RS 50*3=187.5 0 . . . | . .
306 ; : BSET:G RW 50*3=187.5 . 1 . . | OUT .
307 ; : BSET:G E 50*3=187.5 . . 1 . | . .
308 ; : NOP 50*1= 62.5 . . . . | . .
309 ; : NOP 50*1= 62.5 . . . . | . .
310 ; : NOP 50*1= 62.5 . . . . | . .
* R8C/Tiny SERIES ASSEMBLER * SOURCE LIST Fri Oct 15 09:24:03 2004 PAGE 006
SEQ. LOC. OBJ. 0XMSDA ....*....SOURCE STATEMENT....7....*....8....*....9....*....0....*....1....*....2....*....3....*....4
311 ; : MOV.B:G 50*2=125.0 . . . . |(RD Command)
312 ; : AND.W:G 50*3=187.5 . . . . | . .
313 ; : BCLR:G E 50*3=187.5 . . 0 . | . .
314 ; : BCLR:G RW 50*3=187.5 . 0 . . | IN .
315 ; History : ---
316 ;""SUBR COMMENT END""**********************************************************
317 .section program ; same section as the C program
318 .glb __lcd1__rd_nibble_creg
319 ; global definition
320 00000 __lcd1__rd_nibble_creg:
321 ;---- select command ----
322 00000 7E8F0E07 bclr:g p1_6_RS ; select command
323 ; (set RS port of LCD module as "L")
324
325 ;---- set as reading from LCD ----
326 ;mov.b:s #R, pd1 ; set CPU port as input
327 ; ; (set P10 to P13 as input port)
328 ;bset:g p1_x_RW ; set LCD module as output
329 ; (set RW of LCD as "H":READ)
330 ; Write is fixed in OAKS8-LCDBoard
331 ; comment out
332
333 ;---- read 4 bits ----
334 00004 7E9F0F07 bset:g p1_7_E ; set E port of LCD module as "H"
335 00008 04 nop ; fit timing
336 00009 04 nop ; fit timing
337 0000A 72F0E100 mov.b:g p1, R0L ; set value read from LCD as return value (R0)
338 0000E 77200F00 and.w:g #0fH, R0 ; (R0 = p1&0x0f)
339 00012 7E8F0F07 bclr:g p1_7_E ; set E port of LCD module as "L"
340
341 ;---- set back port to initial status ----
342 ;bclr:g p1_x_RW ; set back LCD module to input status
343 ; (set as L:WRITE)
344 ; Write is fixed in OAKS8-LCDBoard
345 ; comment out
346 00016 F3 rts
347
348
349 ;""SUBR COMMENT""**************************************************************
350 ; ID :
351 ; subroutine name : int _lcd1__rd_nibble_dreg(void)
352 ; function : read data register of LCD(SC1602BS*2)
353 ; input : none
354 ; output : int value have been read(only low 4 bits available)
355 ; subroutine used : none
356 ; stack : 0 byte
357 ; notice : because Write is fixed in OAKS8-LCDBoard, can not read
358 ; : get return value from R0(return value transfer rule)
359 ; :
360 ; : control the timing as below, there is rule for time
361 ; : --------------------------+--+--+--+-------+----+-----
362 ; : TIME RS RW E I/O-DIR LCD M16C
363 ; : --------------------------+--+--+--+-------+----+-----
364 ; : def= x 0 0 RD | IN IN
365 ; : BSET:G RS 50*3=187.5 1 . . . | . .
366 ; : BSET:G RW 50*3=187.5 . 1 . . | OUT .
367 ; : BSET:G E 50*3=187.5 . . 1 . | . .
368 ; : NOP 50*1= 62.5 . . . . | . .
369 ; : NOP 50*1= 62.5 . . . . | . .
370 ; : MOV.B:G 50*2=125.0 . . . . |(RD Data)
371 ; : AND.W:G 50*3=187.5 . . . . | . .
372 ; : BCLR:G E 50*3=187.5 . . 0 . | . .
* R8C/Tiny SERIES ASSEMBLER * SOURCE LIST Fri Oct 15 09:24:03 2004 PAGE 007
SEQ. LOC. OBJ. 0XMSDA ....*....SOURCE STATEMENT....7....*....8....*....9....*....0....*....1....*....2....*....3....*....4
373 ; : BCLR:G RW 50*3=187.5 . 0 . . | IN .
374 ;; History : ---
375 ;""SUBR COMMENT END""**********************************************************
376 .section program ; same section as the C program
377 .glb __lcd1__rd_nibble_dreg ; global definition
378 00000 __lcd1__rd_nibble_dreg:
379 ;---- select data ----
380 00000 7E9F0E07 bset:g p1_6_RS ; select data
381 ; (set RS port of LCD module as "H")
382
383 ;---- set as reading from LCD ----
384 ;mov.b:s #R, pd1 ; set CPU port as input
385 ; ; (set P10 to P13 as input port)
386 ;bset:g p1_x_RW ; set LCD module as output
387 ; (set RW of LCD as "H":READ)
388 ; Write is fixed in OAKS8-LCDBoard
389 ; comment out
390
391 ;---- read 4 bits ----
392 00004 7E9F0F07 bset:g p1_7_E ; set E port of LCD module as "H"
393 00008 04 nop ; fit timing
394 00009 04 nop ; fit timing
395 0000A 04 nop ; fit timing
396 0000B 72F0E100 mov.b:g p1, R0L ; set value read from LCD as return value (R0)
397 0000F 77200F00 and.w:g #0fH, R0 ; (R0 = p14&0x0f)
398 00013 7E8F0F07 bclr:g p1_7_E ; set E port of LCD module as "L"
399
400 ;---- set back port to initial status ----
401 ;bclr:g p1_x_RW ; set back LCD module to input status
402 ; (set as L:WRITE)
403 ; Write is fixed in OAKS8-LCDBoard
404 ; comment out
405 00017 F3 rts
406
407
408 .end
Information List
TOTAL ERROR(S) 00000
TOTAL WARNING(S) 00000
TOTAL LINE(S) 00408 LINES
Section List
Attr Size Name
CODE 0000008(00008H) program
CODE 0000012(0000CH) program
CODE 0000027(0001BH) program
CODE 0000027(0001BH) program
CODE 0000023(00017H) program
CODE 0000024(00018H) program
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -