;-----------------------------

; 500

;-----------------------------

_500KHz1:

cjne kf1, #004h, _250KHz1


; c

mov SFRPAGE, #001h

mov RCAP3H,#0FFh

mov RCAP3L,#05Ch

mov DPTR, #000h

Input1_4:

mov SFRPAGE, #00Fh ;3

mov A, Padc1 ;2

movx @DPTR, A ;3

inc DPTR ;1

mov A, #0F0h ;2

mov SFRPAGE, #001h ;3

mov TMR3CN, #004h ;3


; 1690


jnb TMR3CN.7,$ ;4

nop

nop



mov TMR3CN,#000h ;3

mov TMR3H,#0FFh ;3

mov TMR3L,#05Ch ;3


cjne A, DPL, Input1_4 ;5

;-----------------------------

; 250

;-----------------------------

_250KHz1:

cjne kf1, #005h, _50KHz1


; c

mov SFRPAGE, #001h

mov RCAP3H,#0FEh


mov RCAP3L,#094h

mov DPTR, #000h

Input1_5:

mov SFRPAGE, #00Fh

mov A, Padc1

movx @DPTR, A

inc DPTR

mov A, #0F0h

mov SFRPAGE, #001h

mov TMR3CN, #004h


; 3690


jnb TMR3CN.7,$

nop

nop


mov TMR3CN,#000h

mov TMR3H,#0FEh ;3

mov TMR3L,#094h ;3


cjne A, DPL, Input1_5


;-----------------------------

; 50

;-----------------------------

_50KHz1:

cjne kf1, #006h, _25KHz1


; c

mov SFRPAGE, #001h

mov RCAP3H,#0F8h

mov RCAP3L,#054h


mov DPTR, #000h

Input1_6:

mov SFRPAGE, #00Fh

mov A, Padc1

movx @DPTR, A

inc DPTR

mov A, #0F0h

mov SFRPAGE, #001h

mov TMR3CN, #004h


; 19690

jnb TMR3CN.7,$

nop

nop


mov TMR3CN,#000h

mov TMR3H,#0F8h

mov TMR3L,#054h


cjne A, DPL, Input1_6

;-----------------------------

; 25

;-----------------------------

_25KHz1:

cjne kf1, #007h, _5KHz1


mov SFRPAGE, #001h

mov RCAP3H,#0F0h

mov RCAP3L,#084h


mov DPTR, #000h

Input1_7:

mov SFRPAGE, #00Fh

mov A, Padc1

movx @DPTR, A

inc DPTR

mov A, #0F0h

mov SFRPAGE, #001h

mov TMR3CN, #004h


; 39 690

jnb TMR3CN.7,$

nop

nop

mov TMR3CN,#000h

mov TMR3H,#0F0h

mov TMR3L,#084h

cjne A, DPL, Input1_7

;-----------------------------

; 5

;-----------------------------

_5KHz1:

cjne kf1, #008h, _2_5KHz1


mov SFRPAGE, #001h

mov RCAP3H,#0B2h

mov RCAP3L,#004h


mov DPTR, #000h

Input1_8:

mov SFRPAGE, #00Fh

mov A, Padc1

movx @DPTR, A

inc DPTR

mov A, #0F0h

mov SFRPAGE, #001h

mov TMR3CN, #004h


; 199690

jnb TMR3CN.7,$

nop

nop


mov TMR3CN,#000h

mov TMR3H,#0B2h

mov TMR3L,#004h

cjne A, DPL, Input1_8

;-----------------------------

; 2.5

;-----------------------------

_2_5KHz1:

cjne kf1, #009h, _500Hz1


mov SFRPAGE, #001h

mov RCAP3H,#063h

mov RCAP3L,#0E4h


mov DPTR, #000h

Input1_9:

mov SFRPAGE, #00Fh

mov A, Padc1

movx @DPTR, A

inc DPTR

mov A, #0F0h

mov SFRPAGE, #001h

mov TMR3CN, #004h


; 399 690

jnb TMR3CN.7,$

nop

nop

mov TMR3CN,#000h

mov TMR3H,#063h

mov TMR3L,#0E4h

cjne A, DPL, Input1_9


;-----------------------------

; 500

;-----------------------------

_500Hz1:

cjne kf, #010h, _250Hz1


; c

mov SFRPAGE, #001h

mov RCAP3L,#000h

mov RCAP3H,#000h


mov DPTR, #000h

Input1_10:

mov SFRPAGE, #00Fh

mov A, Padc1

movx @DPTR, A

inc DPTR

mov A, #0F0h

mov SFRPAGE, #001h

mov TMR3CN, #004h

; 1 999 690

mov i,#3

M1_10:


mov TMR3CN, #004h

jnb TMR3CN.7,$

mov TMR3CN,#000h

mov TMR3H,#000h

mov TMR3L,#000h

djnz i, M1_10

cjne A, DPL, Input1_10


;-----------------------------

; 250

;-----------------------------

_250Hz1:

cjne kf1, #011h, ExitInputADC


; c

mov SFRPAGE, #001h

mov RCAP3L,#000h

mov RCAP3H,#000h


mov DPTR, #000h

Input1_11:

mov SFRPAGE, #00Fh

mov A, Padc1

movx @DPTR, A

inc DPTR

mov A, #0F0h

mov SFRPAGE, #001h

mov TMR3CN, #004h

; 3 999 690

mov i,#006d

M1_11:


mov TMR3CN, #004h

jnb TMR3CN.7,$

mov TMR3CN,#000h

mov TMR3H,#000h

mov TMR3L,#000h

djnz i, M1_11

cjne A, DPL, Input1_11

ExitInputADC:

ret



;----------------------------------------------------------------

; XRAM ,

;

;----------------------------------------------------------------

Converting:

mov DPTR, #200h



L1: ; 240

mov A, DPH

clr C

subb A, #02h

mov DPH,A

movx A, @DPTR

mov R1, A ; R1

;

mov B, #08h

div AB

mov R3, A ; R3

;

inc A

mov B, #08h

mul AB

clr C

subb A, R1

;

mov R7, A

inc R7

mov A, #01h


L0: RLC A

dec R7

cjne R7, #00h, L0

mov R7, A ; R7


; XRAM 젠

mov DPH, #02h

mov DPL, R3

mov A,R7

movx @DPTR, A

mov A, DPH

cjne A, #1Fh, L1


;

mov DPTR, #2000h

mov A, #0A1h

movx @DPTR, A

ret




;----------------------------------------------------------------

;

;----------------------------------------------------------------


; SED1335.

;

msg1: db 30h, 87h, 07h, 27h, 39h, 0EFh, 28h, 0h, 0A1h

;

msg2: db 0, 0, 0EFh, 0B0h, 04h, 0EFh, 0, 0, 0, 0, 0A1h


msg3: db 04h, 86h, 0A1h;


msg4: db 01h, 0A1h;


msg5: db 16h, 0A1h; /


msg6: db 0B0h, 04h, 0A1h;


msg11: db' ', 01Ah


msg18: db 0, 01Ah;


END





, .

:

      

      

      

10 . .

\ .

. , .
















 

1.     .. , .. . . . M: " ", 1985.

2.     ADG211- . : [#"1.files/image041.jpg">

1

, . LEVEL , .

Ain0.0 . Ain0.0 0 1 . Ain0.0 10 ADC0.


2

0 AMX0CF, AMX0SL, ADC0CF, ADC0CN 1.1.


1.1 0

AMX0CF

xxxx0000

AMUX0

AMX0SL

xxxx0000

AMUX0

ADC0CF

11111000

0

ADC0CN

10000000

0

ADC0H

11111111

0

ADC0L

11111111

0


Ain0.0 - Ain0.7 .

Ain0.0 .

:

,

- (100 );

- , 3 7 ADC0CF.

1.

ADC0CN:

7: AD0EN: 0.

0: 0 . 0 .

1: 0 . 0 .

6: AD0TM: 0.

0: : 0 , , .

1: : AD0CM1-0 (. ).

5: AD0INT: 0 ( ).

.

0: 0 ( ).

1: 0 .

4: AD0BUSY: 0.

:

0: .

AD2INT 1.

1: 0.

:

0: .

1: 0, AD2CM1-0 = 00b.

3-2: AD0CM1-0: 0.

AD2TM = 0:

00: 1 AD2BUSY.

01: 3.

10: CNVSTR2.

11: 2.

AD2TM = 1:

00: () 1 AD2BUSY 3 0; .

01: () 3 3 0; .

10: () CNVSTR2; CNVSTR2.

11: () 2 3 0; .

1: AD2WINT: 0 ( )

0: ( ).

1:

0: AD2LJST:

0: ADC0H:ADC0L

1: ADC0H:ADC0L









3 InputADC1



3



( ):

;----------------------------------------------------------------

; 0

;----------------------------------------------------------------

mov SFRPAGE, #000h

mov AMX0CF, #000h

mov AMX0SL, #000h

mov ADC0CF, #0F8h

mov ADC0CN, #080h






InputADC1, 500 ( ):


;-----------------------------

; 500

;-----------------------------

_500KHz1:

cjne kf1, #004h, _250KHz1


; c

mov SFRPAGE, #001h

mov RCAP3H,#0FFh

mov RCAP3L,#05Ch

mov R4, #000h ; synchronization

mov DPTR, #000h

Input1_4:

mov SFRPAGE, #00Fh ;3

mov A, Padc1 ;2

movx @DPTR, A ;3

inc DPTR ;1

cjne R3,#000h, L0

clr AD0INT

setb AD0BUSY ;

jz AD0INT,&

mov A, ADC0L

mov R0, A


clr C

subb A,R0

cjne A, #000h, Input1_4

mov R4, #001h


mov A, #0F0h ;2


L0: mov SFRPAGE, #001h ;3

mov TMR3CN, #004h ;3


; 1690


jnb TMR3CN.7,$ ;4

nop

nop



mov TMR3CN,#000h ;3

mov TMR3H,#0FFh ;3

mov TMR3L,#05Ch ;3


cjne A, DPL, Input1_4 ;5







: 1, 2, 3, 4






           

2009 .