T5L_ASIC Development Guide
- 17
-
www.dwin-global.com
DWIN Technology
Professional,
Creditable,
S
uccessful
Example
Read and write two double words in 0x0800 address (corresponding to DGUSII variable memory
address 0x1000).
MOV
ADR_H,#00H
;Configure DGUS variable memory address
MOV
ADR_M,#08H
MOV
ADR_L,#00H
MOV
ADR_INC,#01H
;Configuration address increment
MOV
RAMMODE,#0AFH
;Start read mode
JNB
APP_ACK,$
;Waiting for confirmation
MOV
R0,#TEST_BUF
;Reading demo
MOV
R1,#2
RDVP:
SETB
APP_EN
;Start reading data once
JB APP_EN,$
MOV
@R0,DATA3
INC
R0
MOV
@R0,DATA2
INC
R0
MOV
@R0,DATA1
INC
R0
MOV
@R0,DATA0
INC
R0
DJNZ
R1,RDVP
CLR
APP_RW ;Writing mode; writing demo
MOV
ADR_L,#00H
;Adjust the address to 0x08:0000
MOV
R0,#TEST_BUF
MOV
R1,#2
WRVP:
MOV
DATA3,@R0
INC
R0
MOV
DATA2,@R0
INC
R0
MOV
DATA1,@R0
INC
R0
MOV
DATA0,@R0
SETB
APP_EN
;Start writing data once
JNB
APP_EN,$
INC
R0
DJNZ
R1,WRVP
MOV
RAMMODE, #00H
;Variable memory read and write ends