ADC0838

The ADC0838 is an 8-bit analog-to-digital converter with multiplexing for up to 8 channels. It can be used to interface analog sensors with digital microcontrollers like the Basic Stamp 2.

Digital Interface
The ADC can be interfaced with using the CS, DI, CLK, and DO pins. To complete a conversion and read the digital output, follow these steps:


 * 1) Pull the CS line low. It must be held low for the entire conversion.
 * 2) A clock is now generated by the processor (if not continuously generated) and sent to the CLK line.
 * 3) On each rising edge of the clock the status of the DI line is read into the MUX address shift register. The start bit is the first logic "1" that occurs on this line. Following this start bit should be the the 4 bits of the MUX assignment word.
 * 4) When the start bit is shifted into the start location of the MUX register, the SAR status (SARS) line goes high to signal that a conversion is in progress and the DI line has been disabled. This takes 1/2 of a clock period.
 * 5) The DO line now comes out of tri-state and provides a leading zero during step 4.
 * 6) On each falling edge of the clock, the DO line gives the output of the SAR comparator, which indicates whether the analog input is greater or less than each successive voltage from the internal resistor ladder. The resulting data stream will give the 8-bit digital result with the MSB coming out first.
 * 7) After 8 clock periods all 8 bits of the digital result have been read out. The SAR status (SARS) line returns to low 1/2 of a clock period later to indicate this. best essay
 * 8) When the CS line is pulled high again all internal registers are cleared. This must be done in order to do another conversion.

Assignment Codes
The following bit sequences are used to read from the various channels of the ADC0838: