In many applications data collected from multiple sensors is transmitted to PC for display or further analysis. The conversion of data from analog to digital form is done using an ADC. The digital data from the ADC is transferred to the computer using serial port. This circuit demonstrates the principle and operation of interfacing an ADC0808 with serial port of PC using the microcontroller AT89C51. The circuit is divided into three parts: ADC, controller and serial port. This circuit can be used as an intermediate circuit in many applications.ADC0808 which is an 8-bit resolution ADC has eight input channels i.e., it can take a maximum of eight analog inputs. The circuit uses the first analog input pin to take the analog input signals from the preset.
To provide clock input to the ADC, Timer0 is used in interrupt enabled mode to generate a clock of frequency 500 KHz. To enable the Timer0 in interrupt enable mode, the register IE is loaded with the value 0x82. Every time the timer completes the counting, pin P1.2 toggles its state.