English
Language : 

PD17012_15 Datasheet, PDF (156/320 Pages) Renesas Technology Corp – 4-BIT SINGLE-CHIP MICROCONTROLLERS WITH DIGITAL TUNING SYSTEM HARDWARE
µPD17012, 17P012
(3) Program example of binary search method
(a) Method with short conversion time
INIT:
ADCR7
ADCR6
ADCR5
FLG 0.0EH.3
FLG 0.0EH.2
FLG 0.0EH.1
; Dummy
; Dummy
; Defines each bit of data buffer as ADCR data setting flag
ADCR4 FLG 0.0EH.0
ADCR3 FLG 0.0FH.3
ADCR2 FLG 0.0FH.2
ADCR1 FLG 0.0FH.1
ADCR0 FLG 0.0FH.0
CLR2
ADCCH1, ADCCH0
; Sets P1B0/ADC0 pin for the A/D converter
START:
INITFLG NOT ADCR3, NOT ADCR2, NOT ADCR1, NOT ADCR0
INITFLG NOT ADCR7, NOT ADCR6,
ADCR5, NOT ADCR4
PUT
ADCR, DBF
; Sets compare voltage to 31.5/64 VDD
SKT1
CLR1
SET1
ADCCMP
ADCR5
ADCR4
; Detects ADCCMP and subtracts
; 32/64 VDD if “0” and adds
; 16/64 VDD
PUT
SKT1
ADCR, DBF
ADCCMP
; Detects ADCCMP and subtracts
CLR1 ADCR4
; 16/64 VDD if “0” and adds
SET1 ADCR3
; 8/64 VDD
PUT
ADCR, DBF
SKT1 ADCCMP
; Detects ADCCMP and subtracts
CLR1
SET1
ADCR3
ADCR2
; 8/64 VDD if “0” and adds
; 4/64 VDD
A/D conversion
PUT
ADCR, DBF
SKT1
CLR1
SET1
ADCCMP
ADCR2
ADCR1
; Detects ADCCMP and subtracts
; 4/64 VDD if “0” and adds
; 2/64 VDD
PUT
SKT1
ADCR, DBF
ADCCMP
; Detects ADCCMP and subtracts
CLR1 ADCR1
; 2/64 VDD if “0” and adds
SET1 ADCR0
; 1/64 VDD
PUT
ADCR, DBF
SKT1 ADCCMP
; Detects ADCCMP and subtracts
CLR1 ADCR0
; 1/64 VDD if “0”
END:
Number of program steps: 31 steps
Number of execution steps: 31 steps
A/D conversion time:
137.8 µs
154
Data Sheet U10101EJ4V0DS