📄 inductioncooker050413ver1.lst
字号:
1 000000 include define.asm
2 000000 ;********************************************************
3 000000 ; COMPANY : CHOMP *
4 000000 ; PROJECT NAME : *
5 000000 ; Author : carman *
6 000000 ; Original : *
7 000000 ; VERSION : V0.0 *
8 000000 ; START DATE : 2005.04.13 *
9 000000 ; COMPLISH DATE: 2005. *
10 000000 ; Modify : 2005. *
11 000000 ; BODY : SN8P2708 *
12 000000 ; COMPILER : ICE2k *
13 000000 ; CRYSTAL : 4MHz *
14 000000 ; Modify function: *
15 000000 ; *******************************************************
16 000000
17 000000 ;//Set ICE emulation mode.Pay attention to it be reset after emulation.
18 000000 ;//ICE_MODE EQU 1
19 000000 ;// Please set ICE_MODE equ 0 and recompiler before write the code into IC body
20 E 00000000 ICE_MODE EQU 0
21 000000
22 000000 chip sn8p2715
23 000000 //{{SONIX_CODE_OPTION
24 000000 .Code_Option LVD LVD_M ; 2.0V Reset Enable LVD24 bit of PFLAG for 2.4V Low Voltage Indicator
25 000000 .Code_Option RST_P0.3 P0.3
26 000000 .Code_Option Watch_Dog Enable ; Normal mode: Enable Watchdog Green and Sleep mode: Stop Watchdog
27 000000 .Code_Option High_Clk 4M_X'tal ; Crystal/Resonator: 2Mhz~10Mhz
28 000000 .Code_Option Fcpu #2 ; Fcpu = Fosc/4
29 000000 .Code_Option Security Enable
30 000000 .Code_Option Noise_Filter Enable
31 000000 //}}SONIX_CODE_OPTION
32 000000
33 000000 ;-----------------------------------------------
34 000000 .DATA
35 000000 ;bank0
36 000000 org 0h ;Bank 0 data section start from RAM address 0x000
37 0000 D AccBuf ds 1 ;Accumulater buffer
38 0001 D PflagBuf ds 1 ;PFLAG buffer
39 0002 D timer1s ds 1
40 0003 D timer1m ds 1
41 0004 D timer2h ds 1
42 0005 D timerbuf ds 1 ;用于定时处理,00~99分钟
43 000006
44 0006 D keyinbuf ds 1
45 0007 D keychkbuf ds 1
46 0008 D keycvtbuf ds 1
47 0009 D keyoldbuf ds 1
48 000A D Keychat ds 1
49 000B D aplcode ds 1
50 00000C ;----
51 00000C ;// ADCcount ds 1
52 000C D ADCvaluel ds 1
53 000D D ADCvalueh ds 1
54 000E D ADCtemp ds 1
55 00000F ;----
56 000F D pwmpulsebuf ds 1
57 0010 D pwmpulsetemp ds 1
58 000011 ;----
59 0011 D seg1buf ds 1
60 0012 D seg2buf ds 1
61 0013 D seg3buf ds 1
62 0014 D seg4buf ds 1
63 0015 D combuf ds 1
64 000016
65 000016
66 0016 D Flag ds 1
67 0017 D flag1 ds 1
68 0018 D flag2 ds 1
69 0019 D flag3 ds 1
70 00001A ;---------------------------------------------
71 001A D temp0 ds 1
72 001B D temp1 ds 1
73 001C D temp2 ds 1
74 001D D temp3 ds 1
75 001E D temp4 ds 1
76 001F D temp5 ds 1
77 0020 D temp6 ds 1
78 0021 D temp7 ds 1
79 000022 ;-----
80 0022 D var1 ds 1
81 0023 D var2 ds 1
82 0024 D var3 ds 1
83 0025 D var4 ds 1
84 000026
85 000026 ;***************************************************
86 000026 ;*************** Define flag ***********************
87 E 00000016 t10msflag equ Flag.0
88 E 00010016 t1sflag equ Flag.1
89 E 00020016 t1mflag equ flag.2
90 E 00030016 t2hflag equ Flag.3
91 E 00040016 keystatflag equ Flag.4
92 000026 ;// keyokflag equ flag.5
93 000026 ;// getonekeyflag equ Flag.6
94 000026 ;// keypushflag equ flag.7
95 E 00050016 refurbishflag equ flag.5 ;刷新数码管显示标志
96 000026
97 000026 ;----
98 E 00000017 volADCflag equ flag1.0 ;过压、欠压检测
99 E 00010017 curADCflag equ flag1.1 ;过流检测
100 E 00020017 IgbtADCflag equ flag1.2 ;IGBT过温检测
101 E 00030017 cookerADCflag equ flag1.3 ;锅底温度检测
102 E 00040017 cookerflag equ flag1.4 ;无锅、尺寸不合、小物件检测
103 E 00050017 operateflag equ flag1.5 ;开始工作标志
104 E 00060017 buzzerflag equ flag1.6 ;蜂鸣器响标志
105 E 00070017 fanrunflag equ flag1.7 ;风扇运转标志
106 000026 ;----
107 E 00000018 frieddishflag equ flag2.0 ;炒菜标志
108 E 00010018 chaffydishflag equ flag2.1 ;火锅标志
109 E 00020018 barbecueflag equ flag2.2 ;烧烤标志
110 E 00030018 cookingflag equ flag2.3 ;煮饭标志
111 E 00040018 soupingflag equ flag2.4 ;煲汤标志
112 E 00050018 warmmilkflag equ flag2.5 ;热奶标志
113 E 00060018 boilwaterflag equ flag2.6 ;煮水标志
114 E 00070018 keepwarmflag equ flag2.7 ;保温标志
115 000026 ;----
116 E 00000019 malfunctionflag equ flag3.0 ;故障标志
117 E 00010019 poweronflag equ flag3.1 ;初始通电标志
118 E 00020019 ADCendflag equ flag3.2 ;A/D转换结束标志
119 E 00030019 changestaflag equ flag3.3 ;状态切换标志
120 E 00040019 settimeflag equ flag3.4 ;定时标志
121 E 00050019 timecomeflag equ flag3.5 ;定时到标志
122 E 00060019 Igbtstartupflag equ flag3.6 ;IGBT启动标志
123 000026
124 000026 ;--------------
125 E 00070008 lineflag equ keycvtbuf.7 ;=0:line0 上按键,=1:line1 上按键
126 000026 ;----
127 E 00040015 com1flag equ combuf.4
128 E 00050015 com2flag equ combuf.5
129 E 00060015 com3flag equ combuf.6
130 E 00070015 com4flag equ combuf.7
131 000026 ;****************************************************
132 000026 ;*******************constant define******************
133 000026
134 000026
135 000026 ;*******************************************************
136 000026 ;**********************Port define**********************
137 000026 ;key input port row6~row0 is port2.6~port2.0
138 000026 ;key output port line3~lin0 is port1.6~port1.3
139 000026 ;-----
140 E 000000D5 line0 equ p5.0
141 E 000100D5 line1 equ p5.1
142 000026 ;-----
143 E 000200D5 ptfan equ p5.2
144 E 000300D5 ptpwm equ p5.3
145 E 000400D5 ptbuzzer equ p5.4
146 E 000500D5 ptcout equ p5.5
147 000026
148 000026 ;**************************************************
149 000026 ;*****************LCD字符表*************************
150 000026 ;**************************************************
151 000026
152 000026
153 000026 ;*********Micro define as following****************
154 000026 ;-----
155 000026 ;bank select:
156 000026 bank0 macro
157 000026 b0bclr frbnks0
158 000026 endm
159 000026 bank1 macro
160 000026 b0bset frbnks0
161 000026 endm
162 000026 wdtc macro
163 000026 mov a,#0x5a
164 000026 mov wdtr,a ; Clear the watchdog timer counter.
165 000026 endm
166 000026
167 000026
168 000026
169 000026
170 000026 include main.asm
171 000026 ;-----------------------------------------------
172 000026 ;******************Program code segment*********
173 000026 ;-----------------------------------------------
174 000000 .CODE
175 000000
176 000000 ORG 000h ;Code section start
177 000000 8010 jmp Start ;Reset vector
178 000001 ;Address 4 to 7 are reserved
179 000008 ORG 008h
180 000008 8063 jmp InterruptSub ;Interrupt vector
181 000009
182 000010 ORG 010h
183 000010 ;**************************************************
184 000010 ;***************************************************
185 000010 reset:
186 000010 Start:
187 000010 0000 nop
188 000011 0000 nop
189 000012 C05A call Pdelay ;//Power on delay
190 000013 ;-----
191 000013 7F86 b0bts1 fnt0
192 000014 8018 jmp wdtresetsub ;//watch dog reset way,no need initialize
193 000015 ;-----
194 000015 TurnOnInitial:
195 000015 C035 call PortInitial
196 000016 C023 call RAMInitial
197 000017 C042 call SysInitial
198 000018 ;-----
199 000018 wdtresetsub:
200 000018
201 000018 ;**********************************************
202 000018 MainLoop:
203 000018 ;//User need write the main routine Program.
204 000018 0000 nop
205 000019 @RST_WDT ;//User can use Macro instrution REST_WATCHDOG
206 000019 2D5A MOV A, #0x5A
207 00001A 2FCC B0MOV WDTR, A
208 00001B C022 call mnchecktime
209 00001C C082 call mnintgnd ;//interface between interrupt and main
210 00001D mainloop00:
211 00001D ;// call getdatatable
212 00001D C165 call mndisplay
213 00001E C189 call mntwinkle
214 00001F C083 call mnkey ;//Interface between machine and human
215 000020 C0E3 call mnapp
216 000021 ;// call mnsleep
217 000021
218 000021 8018 jmp MainLoop
219 000022 ;*****************************************************
220 000022 ;*****************************************************
221 000022 ;*****************************************************
222 000022 mnchecktime:
223 000022
224 000022 mnchecktime90:
225 000022 0E00 ret
226 000023 include initialize.asm
227 000023 ;**********************************************
228 000023 ;Name :RAMInitial
229 000023 ;Function:clr bank0~bank1
230 000023 ;Input :
231 000023 ;Output :
232 000023 ;Register Used:
233 000023 ;***********************************************
234 000023 RAMInitial:
235 000023 2B84 clr y
236 000024 2D7F mov a,#7fh
237 000025 2F83 b0mov z,a
238 000026 Clrbank0:
239 000026 2BE7 clr @YZ ;Clear @YZ content
240 000027 2683 decms Z ;z = z - 1 , skip next if z=0
241 000028 8026 jmp Clrbank0
242 000029 2BE7 clr @YZ ;Clear address 0x00
243 00002A ;-----
244 00002A ;preset some constant
245 00002A
246 00002A mov_ timer1s,#100 ;1s
247 00002A 2D64 mov a, #100
248 00002B 1F02 mov timer1s, a
249 00002C mov_ timer1m,#60 ;1m
250 00002C 2D3C mov a, #60
251 00002D 1F03 mov timer1m, a
252 00002E mov_ timer2h,#120 ;2h
253 00002E 2D78 mov a, #120
254 00002F 1F04 mov timer2h, a
255 000030 mov_ combuf,#11111111b ;set all com high level
256 000030 2DFF mov a, #11111111b
257 000031 1F15 mov combuf, a
258 000032 mov_ pwmpulsebuf,#10 ;set initialize pwm pusle=10/32
259 000032 2D0A mov a, #10
260 000033 1F0F mov pwmpulsebuf, a
261 000034
262 000034 0E00 ret
263 000035 ;**********************************************
264 000035 ;Name :PortInitial
265 000035 ;Function:
266 000035 ;Input :
267 000035 ;Output :
268 000035 ;Register Used:
269 000035 ;***********************************************
270 000035 PortInitial:
271 000035
272 000035 ;// mov a,#11111100b
273 000035 ;// mov p0m,a ;set p0.0 is input port,others is output
274 000035 ;// mov a,#0ffh
275 000035 ;// mov p0,a ;set p0 is high level
276 000035
277 000035 2DFF mov a,#0ffh
278 000036 1FC2 mov p2m,a ;set p2 is output port
279 000037 1FD2 mov p2,a ;set all p2 pin high level
280 000038
281 000038 2DF0 mov a,#11110000b ;set p4.7~p4.4 is output,others is input
282 000039 1FC4 mov p4m,a
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -