⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 highres.inc

📁 用SAM72N9写的电子秤文档
💻 INC
📖 第 1 页 / 共 2 页
字号:

OperFlg2	.ram_ds	1		;(021)
 KeyHeldNow:	.bit	OperFlg2.0	; b0 = 1: Key held now
 CntPeriodNow:	.bit	OperFlg2.1	; b1 = 0: Discharging Period; 1:Counting Period
 CntDspNow:	.bit	OperFlg2.2	; b2 = 1: Count display
 WeightTareNow:	.bit	OperFlg2.3	; b3 = 1: Weight Tare Now
OperFlg3	.ram_ds	1		;(022)
 Chge4stepNow:	.bit	OperFlg3.0	; b0 = 1: 4 steps changed Now
 ZeroDspNow:	.bit	OperFlg3.1	; b1 = 1: Screen show zero now
 CalibrateOn:	.bit	OperFlg3.2	; b2 = 1: Enable Calibration mode
 CaliMethod:	.bit	OperFlg3.3	; b3 = 1: Calibration Method 2, 0: Calibration Method 1
OperFlg4	.ram_ds	1		;(023)
 CreepZero:     .bit	OperFlg4.0
 AutoZeroNow:	.bit	OperFlg4.1	; b1 = 1: Auto revert to Zero now
 HexCalFlg:	.bit	OperFlg4.2	; b2 = 1: Hexadecimal calculation
 EnCreeping:	.bit	OperFlg4.3	; b2 = 1: Enable creeping elimination
OperFlg5	.ram_ds	1		;(024)
 SleepNow:	.bit	OperFlg5.0	; b0 = 1: Sleep time rearched 0
 TimrFinished:	.bit	OperFlg5.1	; b1 = 1: Creep time finished
 HoldEn:	.bit	OperFlg5.2	; b2 = 1: Hold function enable
 TareNow:	.bit	OperFlg5.3	; b3 = 1: Tare occur
OperFlg6	.ram_ds	1		;(025)
 AutoZeroEn:	.bit	OperFlg6.0	; b0 = 1: Auto-zero feature enabled
 PowerOffTim:	.bit	OperFlg6.1	; b1 = 1: 3min Auto power off time
 AutoOffEn:	.bit	OperFlg6.2	; b2 = 0: Auto power off feature enabled
 UnitSwOpt:	.bit	OperFlg6.3	; b3 = 0: priority switch
 
OperFlg7	.ram_ds	1		;(026)
 OvrHiVoltNow:	.bit	OperFlg7.0	; b0 = 1: Over Hi-Volt Boundary Now
 BlwLoVoltNow:	.bit	OperFlg7.1	; b1 = 1: Below Lo-Volt Boundary Now
 OvrAbMaxNow:	.bit	OperFlg7.2	; b2 = 1: Now Over Absolute Max Count
 IdleBatLowNow:	.bit	OperFlg7.3	; b3 = 1: Battery Low display Now

OperFlg8	.ram_ds	1		;(027)
 CnstRdNow:	.bit	OperFlg8.0	; b0 = 1: Constant reading now
 OvrWtNow:	.bit	OperFlg8.1	; b1 = 1: Overloading now
 UdrWtNow:	.bit	OperFlg8.2	; b2 = 1: Underweighting now
 ZeroRdNow:	.bit	OperFlg8.3	; b3 = 1: Zero reading now

OperFlg9	.ram_ds	1		;(028)
 IdleCnstRdNow:	.bit	OperFlg9.0	; b0 = 1: Constant Reading Now
 IdleOvrWtNow:	.bit	OperFlg9.1	; b1 = 1: Error display Now
 IdleUdrWtNow:	.bit	OperFlg9.2	; b2 = 1: Underweight display Now
 IdleZeroRdNow:	.bit	OperFlg9.3	; b3 = 1: Zero Reading Now

BCNT_183ms	.ram_ds	1		;(029) Count 183ms from BCNT Count
BCNT_500ms	.ram_ds	1		;(02A) Count 513ms from BCNT Counter

OperFlg10	.ram_ds	1		;(02B)
 CntOvrflow:	.bit	OperFlg10.0	; b0 = 1: discharge counting overflow (mean reg L)
 TotalFlag:	.bit	OperFlg10.1	; b1 = 1: Totalling occur
 ChgeSlpTmrNow:	.bit	OperFlg10.2	; b2 = 1 : Change Sleep Timer Now
 ZeroOne:	.bit	OperFlg10.3	; b3 = 1: reading = 0 to 1
 
ZeroCount	.ram_ds	4		;(02C) Zero Reading Count in hex(2B)

	.ram_org	034h		;(034h - 03fh)
BCNT_36ms	.ram_ds	1		;(034) Count 36.6ms from BCNT Counter
BCNT_1s_H	.ram_ds	1		;(035) Count 1s from BCNT Counter (High nibble)
BCNT_1s_M	.ram_ds	1		;(036) Count 1s from BCNT Counter (Middle nibble)
BCNT_1s_L	.ram_ds	1		;(037) Count 1s from BCNT Counter (Low nibble)

	.ram_org	038h
StartZero	.ram_ds	4		;(038) Store first zero reading turn on
SleepTimL	.ram_ds 2		;(03C) Sleep timer
SleepTimH	.ram_ds 1		;(03E) Sleep timer
HoldTimer	.ram_ds	1		;(03F) Hold timer 
	
	.ram_org	045h		;(045h - 04bh)
FactoryMode	.ram_ds	1		;(045) Factory setting of Mode(0..7)
 FtyMode_K1:	.bit	FactoryMode.0	; b0 = K1
 FtyMode_K2:	.bit	FactoryMode.1	; b1 = K2
 FtyMode_K3:	.bit	FactoryMode.2	; b2 = K3
 FtyMode_K4:	.bit	FactoryMode.3	; b3 = K4
AverageCount	.ram_ds	4		;(046) Average Count of Sample Count 0 & 1 in hex
LDigitPos	.ram_ds	1		;(04A) LCD Large Digit Position (0..3)
AutoZeroTim	.ram_ds	1		;(04B) Auto revert to zero delay timer

	.ram_org	056h		;(056h - 05fh)
SampleCount0	.ram_ds	4		;(056) Sample Count 0 in hex(2B)
SampleCount1	.ram_ds	4		;(05A) Sample Count 1 in hex(2B)
CntTCNT		.ram_ds	2		;(05E) Count num of TCNT Match

	.ram_org	066h		;(066h - 06fh)
PreviousCount	.ram_ds	4		;(066) Previous count for creeping checking
NewWeightCnt	.ram_ds	4		;(06A) Weight Count = Average Count - Zero Count in hex
Tag2sec		.ram_ds	2		;(06E) Store 2sec time for key hold

	.ram_org	075h		;(075h - 07fh)
MaB_Key		.ram_ds	1		;(075) Flag for Mab key
 KeyKGLB:	.bit	MaB_Key.0	; kg/lb key
 KeyFlozML:	.bit	MaB_Key.1	; Fl.oz/ml key
 KeyHold:	.bit	MaB_Key.2	; Hold key
 IsOnZeroKey:	.bit	MaB_Key.3
 
SleepTimLRL	.ram_ds	2		;(076) Sleep Timer Low nibble Reload value
SleepTimHRL	.ram_ds	1		;(078) Sleep Timer High nibble Reload value
CreepTimer	.ram_ds	1		;(079) Creeping timer
ZeroBound	.ram_ds	4		;(07A) Zero Boundary to display underload(absolute count)
SDigitx_8	.ram_ds	1		;(07E) LCD Small Digit display Value
HoldState	.ram_ds 1		;(07F) For Hold check stable count
 HoldStableChk:	.bit	HoldState.0	; b0 = 1: Goto check hold stable
 HoldRd:	.bit	HoldState.1	; b1 = 1: Holding Reading
 HoldRdChange:	.bit	HoldState.2	; b2 = 1: Hold Reading Change
 HoldNotAllow:	.bit	HoldState.3	; b3 = 1: Hold Reading is allowed

	.ram_org	085h
HaveData	.ram_ds	1		;(085) Sampling Flags
 HaveSample0:	.bit	HaveData.0	; Bit 0 = 0: Sample Count 0 is Empty
 HaveSample1:	.bit	HaveData.1	; Bit 1 = 0: Sample Count 1 is Empty
 UpdateSample0:	.bit	HaveData.2	; Bit 2 = 0: Update Sample 0
 PermitUpdate:	.bit	HaveData.3	; Bit 3 = 0: Permit update Sample
Iconset0	.ram_ds	1		;(086) lb, kg, S3 icons (can directly load to 1e0h for dsp)
 Icon_lb:	.bit	Iconset0.0	; lb icon       (Iconset0 must at even address)
 Icon_kg:	.bit	Iconset0.1	; kg icon
 Icon_LoBat:	.bit	Iconset0.2	; low battery icon (S3)
 Icon_DPt2:	.bit	Iconset0.3	; decimal pt. 2 icon "##.###"
Iconset1	.ram_ds	1		;(087) P1, COL, g, oz icons
 Icon_DPt1:	.bit	Iconset1.0	; decimal pt. 1 icon "#.####"
 Icon_Col:	.bit	Iconset1.1	; colon mark icon
 Icon_g:	.bit	Iconset1.2	; g icon
 Icon_oz:	.bit	Iconset1.3	; oz icon
Iconset2	.ram_ds	1		;(088) S2, S1, fl.oz, ml icons (can load directly for dsp)
 Icon_Hold:	.bit	Iconset2.0	; Hold icon (S2)
; Icon_Timr:	.bit	Iconset2.1	; Timer icon (S1)
 Icon_fl:	.bit	Iconset2.2	; fl.oz icon
 Icon_ml:	.bit	Iconset2.3	; ml icon
Iconset3	.ram_ds	1		;(089)
 Icon_DPt3:	.bit	Iconset3.0	; Decimal pt. 3 icon "####.#"
 Icon_Tare:	.bit	Iconset3.1	; Tare icon
 Icon_One:      .bit    Iconset3.2      ; One 
 
Chge4stepTimer		.ram_ds	1		;(08A) For 4 step change delay

	.ram_org	08Ch
HoldChkCount		.ram_ds	4		;(08C) 

; the followings variables need a fixed address
HexBuf		.equ	030h	; Max 16-bit Hex
HexBuf0		.equ	030h	; most msb
HexBuf1		.equ	031h	;
HexBuf2		.equ	032h	;
HexBuf3		.equ	033h	; most lsb

DecBuf		.equ	040h	; Max 5-digit BCD
DecBuf0		.equ	040h	; most msb
DecBuf1		.equ	041h	;
DecBuf2		.equ	042h	;
DecBuf3		.equ	043h	;
DecBuf4		.equ	044h	; most lsb

; the followings variables need a fixed address
LDigit___1	.equ	4ch	; LCD Large Digit dsp for decimal place(1B)
LDigitxxx1	.equ	4eh	; LCD Large Digit dsp value(1B)
LDigitxx1x	.equ	50h	; LCD Large Digit dsp value(1B)
LDigitx1xx	.equ	52h	; LCD Large Digit dsp value(1B)
LDigit1xxx	.equ	54h	; LCD Large Digit dsp value(1B)

; for arithmetic calculation
YS_F_REG        .equ	060h
YS_F_REG_0      .equ	060h	; most msb
YS_F_REG_1      .equ	061h	;
YS_F_REG_2      .equ	062h	;
YS_F_REG_3      .equ	063h	;
YS_F_REG_4      .equ	064h	; most lsb

YS_L_REG        .equ	070h
YS_L_REG_0      .equ	070h	; most msb
YS_L_REG_1      .equ	071h	;
YS_L_REG_2      .equ	072h	;
YS_L_REG_3      .equ	073h	;
YS_L_REG_4      .equ	074h	; most lsb

YS_R_REG        .equ	080h
YS_R_REG_0      .equ	080h	; most msb
YS_R_REG_1      .equ	081h	;
YS_R_REG_2      .equ	082h	;
YS_R_REG_3      .equ	083h	;
YS_R_REG_4      .equ	084h	; most lsb

; the followings variables need a fixed address
NewWeightBCD	.equ	090h	; New Weight obtained from AverageCount(2B)
NewWeightBCD0	.equ	090h	; most msb
NewWeightBCD1	.equ	091h	;
NewWeightBCD2	.equ	092h	;
NewWeightBCD3	.equ	093h	;
NewWeightBCD4	.equ	094h	; most lsb


; the followings variables need a fixed address
Step1		.equ	096h	; 1st region dsp step(2B) - multipied by 10
Bound1		.equ	09Ah	; 1st Boundary of weighting display(2B)
MaxBound	.equ	09Ah	; MaxBound
UnitCnt		.equ	09Eh	; Unit count value(1B)
gRatio		.equ	09Eh	; - 1g count ratio
oz1_8Ratio	.equ	09Eh	; - 1/8oz count ratio
ozRatio		.equ	0A0h	; 1oz count ratio(2B)
lbRatio		.equ	0A4h	; 1lb count ratio(2B)

;-----------------------------
;TimeoutTmr	.equ	0A8h	; (1N) communication timeout timer 183*3 ms
;RxDataH		.equ	0A9h
;RxDataL		.equ	0AAh

CommVar		.equ	0A8h
 PermitSendAPO:	.bit	CommVar.0
 UdrAlrDsp:	.bit	CommVar.1
 EquPrevWt:	.bit	CommVar.2
 PermitSend:	.bit	CommVar.3
 
PrevIconSet0	equ	0aah
PrevIconSet1	equ	0abh
PrevIconSet2	equ	0ach
PrevIconSet3	equ	0adh 

PrevSDigit	equ	0aeh
 
;-----------------------------
; these variables are used to communication
PrevWeight	.equ	0B0h	; New Weight obtained from AverageCount(2B)
PrevWeight0	.equ	0B0h	; most msb
PrevWeight1	.equ	0B1h	;
PrevWeight2	.equ	0B2h	;
PrevWeight3	.equ	0B3h	;
PrevWeight4	.equ	0B4h	; most lsb

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -