STC8A8K64D4 Series Manual
MOV
MOV
MOV
MOV
MOV
MOV
MOV
LCALL
CLR
CLR
ORL
ORL
MOV
MOV
MOV
SETB
LCALL
MOV
LCALL
MOV
L_Init_Loop1:
MOV
INC
MOV
INC
MOV
CJNE
MOV
L_Init_Loop2:
MOV
INC
MOV
INC
MOV
CJNE
MOV
L_Init_Loop3:
MOV
INC
MOV
CJNE
MOV
L_MainLoop:
MOV
LCALL
LCALL
DJNZ
MOV
LCALL
SJMP
F_ADC_init:
MOV
MOV
MOV
RET
P3M0,#00H
P3M1,#00H
P4M0,#00H
P4M1,#00H
P5M0,#00H
P5M1,#00H
R7,#50
F_delay_ms
ET0
TR0
AUXR,#080H
AUXR2,#01H
TMOD,#0
TH0,#HIGH Reload
TL0,#LOW Reload
TR0
F_ADC_init
R7,#50
F_delay_ms
R0,#adc_prev
@R0,#03H
R0
@R0,#0FFH
R0
A,R0
A,#(adc_prev + CHANNEL * 2),L_Init_Loop1
R0,#TouchZero
@R0,#03H
R0
@R0,#0FFH
R0
A,R0
A,#(TouchZero+CHANNEL * 2),L_Init_Loop2
R0,#TouchZeroCnt
@R0,#0
R0
A,R0
A,#(TouchZeroCnt + CHANNEL),L_Init_Loop3
cnt_250ms,#5
R7,#50
F_delay_ms
F_ShowLED
cnt_250ms,L_MainLoop
cnt_250ms,#5
;Processing once 0-point automatic tracking value every 250ms
F_AutoZero
L_MainLoop
P1M0,#00H
P1M1,#0FFH
ADC_CONTR,#080H
;Initialize Timer0 to output a 300KHz clock
;Timer0 set as 1T mode
;Enable clock output
;Timer0 set as Timer,16 bits Auto Reload.
;Initialize the previous ADC value
;Initialize the ADC 0-point value
;Initialize the automatic tracking count value
;Delay 50ms
;Handle key value once
; Zero tracking
;8 channels ADC
;Enable ADC
- 508 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?