EM78P458/459
OTP ROM
(a) Select A/D input channel ( ADAS2:ADAS0 );
(b) Select the proper gains by writing to the GCON register ( optional );
(c) Define A/D conversion clock rate ( CKR1:CKR0 );
(d) Set the ADPD bit to 1 to begin sampling.
(3) Put “ENI” instruction, if the interrupt function is employed.
(4) Set the ADRUN bit to 1.
(5) Wait for either the interrupt flag to be set or the ADC interrupt to occur.
(6) Read ADDATA, the conversion data register.
(7) Clear the interrupt flag bit (ADIF).
(8) For next conversion, go to Step 1 or Step 2 as required. At least 2 Tct is required before next
acquisition starts.
<Note>: To obtain an accurate value, it is necessary to avoid any data transition on I/O pins during
AD conversion.
2. The Demonstration Programs
; To define the general registers
R_0 == 0
; Indirect addressing register
; Status register
PSW == 3
PORT5 == 5
PORT6 == 6
R_F== 0XF
; Interrupt status register
; To define the control register
IOC50 == 0X5
; Control Register of Port 5
; Control Register of Port 6
; Interrupt Control Register
IOC60 == 0X6
C_INT== 0XF
;ADC Control Registers
ADDATA == 0xA
; The contents are the results of ADC
ADCON R== 0x9
;
7
6
5
4
3
2
1
0
This specification is subject to change without prior notice.
35
06.25.2004 (V1.4)