
#include "aduc841.h"
			org		0000h
			sjmp	ayar
			ORG		0033H
			sjmp	adckesmesi
		
ayar:
			mov		ADCCON1,#11111100b; eneji, harici ref, ck1_ck0=11, aq1_aq0=11
			mov		ADCCON2,#00100000B; surekli cevrim modu yaptim
			
			mov		DACCON,#00101101B	; 12 bit dac, rng0=1, sync=1, pd0=1

			setb	eadc
			setb	ea
basla:		sjmp 	$		
			
			
adckesmesi:
			// clr	adci demeye gerek yok
			mov		a,adcdatah
			mov		b,2d
			div		ab
			mov		DAC0H,a
			
			mov		a,adcdatal
			mov		b,2d
			div		ab
			mov		DAC0l,a
			
			reti
	
			END