0% found this document useful (0 votes)
280 views

Interface of Adc0808 With Microcontroller At89c51

This document discusses interfacing an ADC0808 analog-to-digital converter with an AT89C51 microcontroller. It provides a sample program that converts 8 analog inputs between 0-5V to digital values from 0-255 using the ADC0808, stores the values in an array, and transmits the data to a PC via serial port at 9600 baud rate. The interfacing of the ADC0808 with microcontrollers like the AT89C51 is simple, and this chip can be used for various analog conversions like temperature, pressure, and current loops.

Uploaded by

Srinath Kv
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
280 views

Interface of Adc0808 With Microcontroller At89c51

This document discusses interfacing an ADC0808 analog-to-digital converter with an AT89C51 microcontroller. It provides a sample program that converts 8 analog inputs between 0-5V to digital values from 0-255 using the ADC0808, stores the values in an array, and transmits the data to a PC via serial port at 9600 baud rate. The interfacing of the ADC0808 with microcontrollers like the AT89C51 is simple, and this chip can be used for various analog conversions like temperature, pressure, and current loops.

Uploaded by

Srinath Kv
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Interface of adc0808 with microcontroller at89c51

The ADC0808 or ADC0809 are 8 bit and 8 channel analog to digital converters and have very good results in the conversion. they are easy to use and can be used in variety of projects. Their interfacing with micro controllers like at89s51 is very simple , but they can be used with any type of microcontroller or even with direct PC parallel port through some electronics circuit. I used this chip for several time for different types of conversions, forexample temperature and pressure, load cells, differential pressure transducers which can give us even current loop of 4-20 mA, but for that purpose again current to voltage conversion circuit will be need. Here is a sample program which converts 8 analog inputs of 0-5v to digital 0-255 one by one, stores in an array of 8 number. then this data is transmitted to PC by using serial port with RS 232 on 9600 baud rate. This program is written in Kiel c51 which include adc0809 and microcontroller 8051. #include unsigned char sec1,sec,adc[8],ss; void rdadc0808(void); void send(void); void pause (void); sbit eoc = P3^4; sbit ale = P3^5; sbit oe = P3^6; sbit sc = P3^7; sbit adda = P2^0; sbit addb = P2^1; sbit aadc = P2^2; void timer(void) interrupt 1 { TH0 = 0xdc; sec1++; if(sec10>=100) { rdadc(); setout(); sec1=0; } } void main() { EA = 1; ET0 = 1; SCON = 0x52; TMOD = 0x21; TH1 = 0xfd; // 9600 baud rate TR1 = 1; TR0 = 1;

ES = 1; wt = 1; rd = 1; en = 1; adc = 0; P1 = 0xff; eoc = 1; ale = 0; oe = 0; sc = 0; while(1) { ; } } void send(void) { for(ss=0;ss<8;ss++) { TI = 0; SBUF = adc[ss]; while(!TI){;} } void rdadc0808(void) { for(ss=0;ss<8;ss++) { P2 = ss; pause(); ale = 1; pause(); sc = 1; pause(); ale = 0; sc = 0; while (eoc); while (!eoc); oe = 1; pause(); adc[ss] = P1; oe = 0; } void serial(void) interrupt 4 { If (RI) RI=0; } void pause(void) { unsigned int idelay ; for(idelay=0; idelay < 2500;idelay++); }

Posted by Dr.Rana at 11:29:00 AM Email ThisBlogThis!Share to TwitterShare to Facebook

You might also like