📄 samtestc.l
字号:
Mon Dec 22 16:57:25 2003
SAM4 Assembler for 57 Core Ver. 2.09T(Win32) Copyright(c) 1999 Samsung Electronics Co.
--------------------------------------------------------------------
Source File Name : SamTestC.SRC
Output File Name : SamTestC.o
List File Name : SamTestC.l
1 ;----------------------------------------------------------------------------
2 ;
3 ; Project : High Resolution Kitchen SCALE
4 ; File : HighRes.src
5 ; : HighRes.inc
6 ; : 57c2304.reg
7 ; Creation Date : 10 Oct 2000
8 ; By : KP Yiu (Oriental Skill Ltd.)
9 ; Modified By : KL Tsang (Oriental Skill Ltd.)
10 ; Release Date :
11 ; Release Version : v.1.01.0000
12 ; Version Notes : v.1.01.0000
13 ;; - improve count fructration problem by adding PermitUpdate & modified
14 ;; AverageSample function.
15 ;; v.2.02.0000
16 ;; - improve auto-revert to zero feature to make the 2s counting more accurate.
17 ;; Develop Notes : High Resolution Scale
18 ;; v.0.6.0000
19 ;; - improve count taken problem after pull the scale
20 ;; - add 1s delay between Totalling and Tare for get stable count
21 ;; - zero bound change from fix 30 counts to 2 display step
22 ;; v.0.7.0000
23 ;; - add 3s delay before get zero
24 ;; - after creeping & 8s, if display weight = 0, put current count into zero
25 ;; - add 1.5s delay after press keys
26 ;; - change power control logic
27 ;; v.0.8.0000
28 ;; - after creeping and display zero, the time is changed from 8s to 2s
29 ;; - use new LCD
30 ;; v.0.9.0000
31 ;; - display 1x.xxx kg use new LCD
32 ;; - hold any keys, no display change
33 ;; v.0.10.0000
34 ;; - solve the sleep time problem -- scale don't sleep in 1 min after display is zero
35 ;; - add mode 1 - calculate the display
36 ;; - add display method for mode 1
37 ;; v.0.11.0000 (By Pang - 18 Feb 2002)
38 ;; - merge with Dennis program
39 ;; - Correct the mode table to display accurate 115% weight limit.
40 ;; - Correct the power up display as "8888 7/8" for mode 1-5,
41 ;; "18888 7/8" for mode 6 & 7 and "8888" for mode 8
42 ;; - Optimize the routine "SetFactoryMode"
43 ;; - Correct On/Zero button to MaB
44 ;; - Remark dummy instructions in routine "Sleep"
45 ;; v.0.12.0000 (By Pang - 25 Feb 2002)
46 ;; - update the program according to the email dated 25 Feb 2002 from Dennis
47 ;; -> Changed back power up display on mode 6 & 7 to "8888 7/8"
48 ;; -> Fix the power up click sound problem
49 ;; -> Fix a underweight bug
50 ;; v.1.5.0000 (By Dennis Wong - 3 Apr 2003)
51 ;; - Remove emulator rountine
52 ;; - Debug auto power off problem that sleep timer cannot reset at least 5sec
53 ;; v.1.6.0000 (By Dennis Wong - 28 Apr 2003)
54 ;; - Add fl.oz mode for all resolution
55 ;; v.1.6.0001 (By Dennis Wong - 28 May 2003)
56 ;; - Update the maximum capacity of fl.oz mode
57 ;; v.1.7.0000 (By Dennis Wong - 3 Jun 2003)
58 ;; - Use 'HoldEn' to be hold function enable flag to elimate calibration hold problem
59 ;; - Use 'TareNow' to be tare function enable flag
60 ;; - Modify clear icon rountine to free space
61 ;; - Debug fl.oz mode of 200g x 0.1g resolution
62 ;;
63 ;; 03-12-2 (By Hcy )
64 ;; - add 'bits PermitSend' in the label 'UMainCalculate6' for minus weight and tare
65 ;; - replace 'RDspSymbol' to 'RDsp4LDigit' in the subroutine 'ChkBatteryLow' for check battery low
66 ;; ; v02 03-12-4 14:14
67 ; 1. after battery insert to the scale, the display time should be 12:00 a.m.
68 ; 2. the scale can enter calibration moe at anytime during clock display
69 ; 3. to avoid abnormal operarion, program EPSON IC so that it cann't turn on
70 ; within 2s after the scale turn off.
71 ; 4. run-time unit change havn't now
72 ; 5. resolutin 2.8 no decimal point
73 ; 6. press 2s to start time adjustment
74 ; 7. add display version for EPSON IC at calibration mode
75 ; 8. scale cann't change from '----' to '0'
76 ; 9 low battery warning.
77 ;; v03(03-12-9 (By Hcy))
78 ; 1. add the function that program return to the view clock mode if no key
79 ; pressed in the setting clock mode wihin 15 second
80 ; 2. take away 'PermitSend' flag, when the under weight 'LDsp__' --> PrevWeightBCD
81 ; v50 03-12-11 10:08 about 60R01
82 ; 1. lcd return to the original setting.
83 ; 2. key board for new key assignment
84 ; 3. modify the low battery delay
85
86 ;;---------------communication protocal----------------------
87 ;;
88 ;;---------------Communication protocol:
89 ; Name Samsung EPSON Name
90 ; MS_CLK P60 ---> P00 Clk_In
91 ; SL_DIN P11 <--- R01 SL_Dout
92 ; MS_DOUT P62 ---> P01 SL_Din ;
93 ;
94 ; Write to EPSON
95 ;1. Synchronized serial, 4 bit data, with master control
96 ;2. Samsung is the master of the communication
97 ;3. The LS bit will be sent first in a byte.
98 ;4. The clock bit is normal low and SL_Dout is normal high when no transmission.
99 ; Rising edge of clock bit to make attention to EPSON and place the data bit to MS_Dout.
100 ; Wait until EPSON response SL_Dout to Low and the clock bit goes to low to start
101 ; a bit cycle and EPSON received a bit ,it pull high the SL_DIN, Samsung
102 ; will pull high MS_CLK when SL_DIN is high.and the MS_Dout should return to high also.
103 ; The data bit is sent out on the falling edge of the clock
104 ;5. The data bit is assumed to be read out by EPson on the falling edge of the SL_Dout.
105 ;6. The clock line will keep on low when all 8 bits data has been sent out
106 ;
107 ;7. The clock rate is around 0.5KHz
108 ;8. no time out
109 ;
110 ; Data return to Samsung (master)
111 ;1. Synchronized serial, 4 bit data, with master control
112 ;2. Samsung is the master of the communication
113 ;3. The LS bit will be sent first in a byte.
114 ;4. epson pull down the SL_DIN when have any key pressed to tell samsung to ready receive key
115 ; then send data will be put the SL_DIN ,first send 0AH, then send key code.
116 ;5. The clock rate is around 400Hz
117 ;
118 ; Command codes of the communication
119 ;1. The communication begins with code (0BH) normally
120 ;2. If send auto off , the start code is '0DH'
121 ;4. The Epson should ignor all un-defined commands
122 ;5. all communication operation is in foreground.
123 ;
124 ;6. A counter is used to indicate number of bits received or number of bits left to send.
125 ;----------------------------------------------------------------------------
126
127 .include "57c2304.reg"
128 ; 57C2304.REG Copyright (c) 1996 SAMSUNG ELECTRONICS CO.
129
130 .list on
131
132 ; END OF 57C2304.REG
133
134
135 .include "HighRes.inc"
136 ;----------------------------------------------------------------------------
137 ;
138 ; Project : High Resolution Kitchen Scale
139 ; File : HighRes.INC
140 ; Creation Date : 10 Oct 2000
141 ; By : KP Yiu (Oriental Skill Ltd.)
142 ; Release Date :
143 ; Release Version : v.1.01.0000
144 ;
145 ;----------------------------------------------------------------------------
146
147 .list on
148 ;=================================
149 ; ----- Variables Definition -----
150 ; ----- Range % 020h - 0afh -----
151 ; ----- Stack % 0b0h - 0ffh -----
152 ;=================================
153
154 0000 .ram_org VariableStart ; 020h
155 02 .align 2
156
157 0000 .ram_org 020h ;(020h - 02fh)
158 20 OperFlg1 .ram_ds 1 ;(020)
159 20 32 UnitMode: .bit OperFlg1.2 ; b3,2 = 0: g(Default); 1 = oz; 2 = ml; 3 = fl.oz
160 20 33 SolLiqMode: .bit OperFlg1.3 ; 0 = solid, 1 = liquid
161
162 21 OperFlg2 .ram_ds 1 ;(021)
163 21 30 KeyHeldNow: .bit OperFlg2.0 ; b0 = 1: Key held now
164 21 31 CntPeriodNow: .bit OperFlg2.1 ; b1 = 0: Discharging Period; 1:Counting Period
165 21 32 CntDspNow: .bit OperFlg2.2 ; b2 = 1: Count display
166 21 33 WeightTareNow: .bit OperFlg2.3 ; b3 = 1: Weight Tare Now
167 22 OperFlg3 .ram_ds 1 ;(022)
168 22 30 Chge4stepNow: .bit OperFlg3.0 ; b0 = 1: 4 steps changed Now
169 22 31 ZeroDspNow: .bit OperFlg3.1 ; b1 = 1: Screen show zero now
170 22 32 CalibrateOn: .bit OperFlg3.2 ; b2 = 1: Enable Calibration mode
171 22 33 CaliMethod: .bit OperFlg3.3 ; b3 = 1: Calibration Method 2, 0: Calibration Method 1
172 23 OperFlg4 .ram_ds 1 ;(023)
173 23 30 CreepZero: .bit OperFlg4.0
174 23 31 AutoZeroNow: .bit OperFlg4.1 ; b1 = 1: Auto revert to Zero now
175 23 32 HexCalFlg: .bit OperFlg4.2 ; b2 = 1: Hexadecimal calculation
176 23 33 EnCreeping: .bit OperFlg4.3 ; b2 = 1: Enable creeping elimination
177 24 OperFlg5 .ram_ds 1 ;(024)
178 24 30 SleepNow: .bit OperFlg5.0 ; b0 = 1: Sleep time rearched 0
179 24 31 TimrFinished: .bit OperFlg5.1 ; b1 = 1: Creep time finished
180 24 32 HoldEn: .bit OperFlg5.2 ; b2 = 1: Hold function enable
181 24 33 TareNow: .bit OperFlg5.3 ; b3 = 1: Tare occur
182 25 OperFlg6 .ram_ds 1 ;(025)
183 25 30 AutoZeroEn: .bit OperFlg6.0 ; b0 = 1: Auto-zero feature enabled
184 25 31 PowerOffTim: .bit OperFlg6.1 ; b1 = 1: 3min Auto power off time
185 25 32 AutoOffEn: .bit OperFlg6.2 ; b2 = 0: Auto power off feature enabled
186 25 33 UnitSwOpt: .bit OperFlg6.3 ; b3 = 0: priority switch
187
188 26 OperFlg7 .ram_ds 1 ;(026)
189 26 30 OvrHiVoltNow: .bit OperFlg7.0 ; b0 = 1: Over Hi-Volt Boundary Now
190 26 31 BlwLoVoltNow: .bit OperFlg7.1 ; b1 = 1: Below Lo-Volt Boundary Now
191 26 32 OvrAbMaxNow: .bit OperFlg7.2 ; b2 = 1: Now Over Absolute Max Count
192 26 33 IdleBatLowNow: .bit OperFlg7.3 ; b3 = 1: Battery Low display Now
193
194 27 OperFlg8 .ram_ds 1 ;(027)
195 27 30 CnstRdNow: .bit OperFlg8.0 ; b0 = 1: Constant reading now
196 27 31 OvrWtNow: .bit OperFlg8.1 ; b1 = 1: Overloading now
197 27 32 UdrWtNow: .bit OperFlg8.2 ; b2 = 1: Underweighting now
198 27 33 ZeroRdNow: .bit OperFlg8.3 ; b3 = 1: Zero reading now
199
200 28 OperFlg9 .ram_ds 1 ;(028)
201 28 30 IdleCnstRdNow: .bit OperFlg9.0 ; b0 = 1: Constant Reading Now
202 28 31 IdleOvrWtNow: .bit OperFlg9.1 ; b1 = 1: Error display Now
203 28 32 IdleUdrWtNow: .bit OperFlg9.2 ; b2 = 1: Underweight display Now
204 28 33 IdleZeroRdNow: .bit OperFlg9.3 ; b3 = 1: Zero Reading Now
205
206 29 BCNT_183ms .ram_ds 1 ;(029) Count 183ms from BCNT Count
207 2A BCNT_500ms .ram_ds 1 ;(02A) Count 513ms from BCNT Counter
208
209 2B OperFlg10 .ram_ds 1 ;(02B)
210 2B 30 CntOvrflow: .bit OperFlg10.0 ; b0 = 1: discharge counting overflow (mean reg L)
211 2B 31 TotalFlag: .bit OperFlg10.1 ; b1 = 1: Totalling occur
212 2B 32 ChgeSlpTmrNow: .bit OperFlg10.2 ; b2 = 1 : Change Sleep Timer Now
213 2B 33 ZeroOne: .bit OperFlg10.3 ; b3 = 1: reading = 0 to 1
214
215 2C ZeroCount .ram_ds 4 ;(02C) Zero Reading Count in hex(2B)
216
217 0000 .ram_org 034h ;(034h - 03fh)
218 34 BCNT_36ms .ram_ds 1 ;(034) Count 36.6ms from BCNT Counter
219 35 BCNT_1s_H .ram_ds 1 ;(035) Count 1s from BCNT Counter (High nibble)
220 36 BCNT_1s_M .ram_ds 1 ;(036) Count 1s from BCNT Counter (Middle nibble)
221 37 BCNT_1s_L .ram_ds 1 ;(037) Count 1s from BCNT Counter (Low nibble)
222
223 0000 .ram_org 038h
224 38 StartZero .ram_ds 4 ;(038) Store first zero reading turn on
225 3C SleepTimL .ram_ds 2 ;(03C) Sleep timer
226 3E SleepTimH .ram_ds 1 ;(03E) Sleep timer
227 3F HoldTimer .ram_ds 1 ;(03F) Hold timer
228
229 0000 .ram_org 045h ;(045h - 04bh)
230 45 FactoryMode .ram_ds 1 ;(045) Factory setting of Mode(0..7)
231 45 30 FtyMode_K1: .bit FactoryMode.0 ; b0 = K1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -