forked from prefectcj/dwin-T5L
-
Notifications
You must be signed in to change notification settings - Fork 0
/
T5L_OS_8051.INC
152 lines (133 loc) · 3.33 KB
/
T5L_OS_8051.INC
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
;Defin T5L ASIC OS 8051 core SFR interface definition
;определение интерфейса SFR ядра T5L ASIC OS 8051
;******************* SFR(Special Function Registers) ядра 8051 ****************
$NOMOD51
P0 DATA 80H
SP DATA 81H
DPL DATA 82H
DPH DATA 83H
PCON DATA 87H
TCON DATA 88H
TF1 BIT TCON.7
TR1 BIT TCON.6
TF0 BIT TCON.5
TR0 BIT TCON.4
IE1 BIT TCON.3
IT1 BIT TCON.2
IE0 BIT TCON.1
IT0 BIT TCON.0
TMOD DATA 89H
TH0 DATA 8CH
TL0 DATA 8AH
TH1 DATA 8DH
TL1 DATA 8BH
CKCON DATA 8EH
P1 DATA 90H
DPC DATA 93H
PAGESEL DATA 94H ;Должно быть 0x01
D_PAGESEL DATA 95H ;Должно быть 0x02
SCON0 DATA 98H ;UART2
TI0 BIT SCON0.1
RI0 BIT SCON0.0
SBUF0 DATA 99H
SREL0H DATA 0BAH
SREL0L DATA 0AAH
SCON1 DATA 9BH ;UART3
SBUF1 DATA 9CH
SREL1H DATA 0BBH
SREL1L DATA 09DH
IEN2 DATA 9AH
P2 DATA 0A0H
IEN0 DATA 0A8H
EA BIT IEN0.7
ET2 BIT IEN0.5
ES0 BIT IEN0.4
ET1 BIT IEN0.3
EX1 BIT IEN0.2
ET0 BIT IEN0.1
EX0 BIT IEN0.0
IP0 DATA 0A9H
P3 DATA 0B0H
IEN1 DATA 0B8H
ES3R BIT IEN1.5
ES3T BIT IEN1.4
ES2R BIT IEN1.3
ES2T BIT IEN1.2
ECAN BIT IEN1.1
IP1 DATA 0B9H
IRCON2 DATA 0BFH
IRCON DATA 0C0H
TF2 BIT IRCON.6
T2CON DATA 0C8H
TRL2H DATA 0CBH
TRL2L DATA 0CAH
TH2 DATA 0CDH
TL2 DATA 0CCH
PSW DATA 0D0H
CY BIT PSW.7
AC BIT PSW.6
F0 BIT PSW.5
RS1 BIT PSW.4
RS0 BIT PSW.3
OV BIT PSW.2
F1 BIT PSW.1
P BIT PSW.0
ADCON DATA 0D8H
ACC DATA 0E0H
B DATA 0F0H
;***********************Определение аппаратного расширения******************
;Доступ к RAM(переменной памяти) DGUS
RAMMODE DATA 0F8H
APP_REQ BIT RAMMODE.7
APP_EN BIT RAMMODE.6
APP_RW BIT RAMMODE.5 ;1=READ 0=WRITE
APP_ACK BIT RAMMODE.4
ADR_H DATA 0F1H
ADR_M DATA 0F2H
ADR_L DATA 0F3H
ADR_INC DATA 0F4H
DATA3 DATA 0FAH
DATA2 DATA 0FBH
DATA1 DATA 0FCH
DATA0 DATA 0FDH
;UART4
SCON2T DATA 96H
SCON2R DATA 97H
BODE2_DIV_H DATA 0D9H
BODE2_DIV_L DATA 0E7H
SBUF2_TX DATA 9EH
SBUF2_RX DATA 9FH
;UART5
SCON3T DATA 0A7H
SCON3R DATA 0ABH
BODE3_DIV_H DATA 0AEH
BODE3_DIV_L DATA 0AFH
SBUF3_TX DATA 0ACH
SBUF3_RX DATA 0ADH
;CAN interface
CAN_CR DATA 08FH
CAN_IR DATA 091H
CAN_ET DATA 0E8H
;GPIO
P0MDOUT DATA 0B7H
P1MDOUT DATA 0BCH
P2MDOUT DATA 0BDH
P3MDOUT DATA 0BEH
MUX_SEL DATA 0C9H
PORTDRV DATA 0F9H ;мощность выходного привода
;MAC&DIV
MAC_MODE DATA 0E5H
DIV_MODE DATA 0E6H
;SFR Порты расширения
EXADR DATA 0FEH
EXDATA DATA 0FFH
;Ниже приведены псевдоинструкции, определяемые макросами.
WDT_ON MACRO ;WDT включен
ORL MUX_SEL,#02H
ENDM
WDT_OFF MACRO ;WDT выключен
ANL MUX_SEL,#0FDH
ENDM
WDT_RST MACRO ;WDT reset (feed the dog) / Сброс WDT (покормить собаку)
ORL MUX_SEL,#01H
ENDM