clock for ADC0808

Status
Not open for further replies.

infinity

New Member
I am interfacing ADC0808 with 8051 microcontroller. I have to give a clock input of 640KHz to the ADC. Is there any way to give the ADC clk through the microcontroller i.e. through the XTAL pins of 8051? Or do we have to give the clock externally? If we have to give externally , then please tell me which circuit to use?
 
According to national's Datasheet the maximum Clock Frequency is 1.280 MHz.
What is the speed of your 8051 clock.
If more than 1 MHz than you should use some kind of divider !
4040 may do the trick !

Good luck.

STEVE
 
It is possible to give clock to ADC using any of the I/O pins of 8051. Use its internal Timer to generate interrupt at regular interval and on every interrupt complement the desired port pin. But using software interrupt your requirement of 640kHz clock won't be fulfilled. The frequency will be much lower.

If you are using new generation of 8051s ie. 89Xxx series then you also have an option of using internal CCP module or Timer2 to direcly generate square wave at the output pins of P1. This method can achieve higher output frequencies.
 
Hi

I am testing ADC0808 but ain't getting a proper output. Can u tell me of a proper procedure to check ADC0808? Is the output latched on the outpin pins of the ADC if we connect ALE and OE to Vcc? Or should we check the output at some port of 89C51?
 
You need to select proper addresses using Address pins and pulse ALE pin to latch it.
OE needs to be raised high when you are reading the converted data.
The following code will read out 8-bit data from the selected channel.
Code:
;**************************************************************
; READ ADC DATA AND STORE IN ADC_DATA VARIABLE
;**************************************************************
CONVERT:
	SETB	EOC		; SET EOC PIN
	SETB	START		; SET START PIN
	LCALL	ADC_DELAY	; WAIT FOR SOME TIME
	CLR	START		; CLEAR  START PIN
CONV_1:	LCALL	ADC_CLOCK	; CLOCK THE ADC
	JNB	EOC,CONV_1	; CLOCK TILL CONVERSION IS OVER
	SETB	OE
	MOV	A,DATA_PORT	; COPY ADC DATA TO ACC
	MOV	ADC_DATA,A	; COPY ACC TO ADC_DATA
	CLR	OE
	RET			; RETURN TO CALLER


;**************************************************************
; GIVES ONE CLOCK PULSE TO ADC
;**************************************************************
ADC_CLOCK:
	SETB	CLOCK		; SET CLOCK PIN
	ACALL	ADC_DELAY	; WAIT FOR SOME TIME
	CLR	CLOCK		; CLEAR CLOCK PIN
	ACALL	ADC_DELAY	; WAIT FOR SOME TIME
	RET			; RETURN TO CALLER


;**************************************************************
; CLOCK DELAY ROUTINE OF APPROX. 10uS @ 11.0592MHz
;**************************************************************
ADC_DELAY:
	MOV	R7,#01h		; LOAD COUNT IN R7
ADC_DLY1:
	DJNZ	R7,ADC_DLY1	; LOOP UNTIL R7 IS 0
	NOP
	RET			; RETURN TO CALLER
 
parallel programing

the program yu have return is good but i have a question that i want to read the data from tha adc and i want to send it through rhe tx pin as wella s receive the data form the rx pin and perform the operation from the rx pin and perform the operation. so in this case i dont think giving the clock from the microcontroler to the adc is a good idea.
so is ther any other way to set the clock in auto mode and run the microcontroler for other operations or could it perform the parallel programing?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…