English
Language : 

PD17012_15 Datasheet, PDF (157/320 Pages) Renesas Technology Corp – 4-BIT SINGLE-CHIP MICROCONTROLLERS WITH DIGITAL TUNING SYSTEM HARDWARE
µPD17012, 17P012
(b) Method with fewer program steps
ADWORK1 MEM
0.00H
ADWORK0 MEM
0.01H
; Work area for changing compare voltage
INITFLG NOT ADCCH1, NOT ADCCH0
; Sets P1B0/ADC0 pin for the A/D converter
START:
MOV
DBF1, #0010B ; Sets compare voltage to initial value of 31.5/64 VDD
MOV
DBF0, #0000B
MOV
ADWORK1, #0001B
MOV
ADWORK0, #0000B
AD_CHECK:
PUT
ADCR, DBF
; Sets compare voltage VREF
SKT1 ADCCMP
; Detects ADCCMP flag
BR
ADIN_L
ADD
DBF0, ADWORK0 ; Increases compare voltage if “1”
ADDC DBF1, ADWORK1
BR
NEXT_AD
A/D
ADIN_L:
conversion
SUB
DBF0, ADWORK0 ; Decreases compare voltage if “0”
SUBC DBF1, ADWORK1
;
NOP
; Described to keep A/D conversion time constant
NEXT_AD:
RORC ADWORK1
RORC ADWORK0
SKT1 CY
; 6 bits completed?
BR
AD_CHECK
PUT
ADCR, DBF
SKT1 ADCCMP
AND
DBF0, #1110B
...
Number of program steps: 22 steps
Number of execution steps: 58 to 63 steps
A/D conversion time:
257.8 to 280 µs
Where the A/D conversion time is held constant
Number of program steps: 23 steps
Number of execution steps: 63 steps
A/D conversion time:
280 µs
Data Sheet U10101EJ4V0DS
155