%20applications1_thumb.jpg)
%20%20applications_thumb.jpg)
TLC0832 is 8-bit successive approximation voltage A / D converter, supports single-channel input serial output polarity setting fixed without addressing . A sampling of data in its internal comparator differential input of the emulated signal is converted to digital signal comparison . Moot voltage differential input signal is conducive to suppress common touch , and reduce or eliminate the conversion of the offset error . Moreover, the voltage reference input variable , the small range of Moot voltage signal into a higher time resolution . Standard shift registers or microprocessors by the time change will be assigned to the serial digital signal output, when the IN- grounded single- ended operation , this time for the input IN + , but also after the input differential signal to the N + and N- between , then the device is double-ended working condition. Its main features are as follows : (1 ) 8 -bit resolution ; (2 ) single-channel differential input ; (3) 5V power supply provides adjustable 0-5V reference voltage ; (4 ) input and output with TTL and MOS compatible ; (5 ) The total offset error is 1SB. TLC0831 timing diagram is as follows: Based on the graph C51 can write the following applications: #include #include typedef unsigned int uuint; typedef unsigned char uchar; sbit adcdo = P1 ^ 0; / / define the data lines D0 TLC0831 sbit adccs = P1 ^ 2; / / define the time to line CS TLC0831 sbit adcclk = P1 ^ 1; / / define the clock line CLK TLC0831 void delay (uchar x); / / define the function when Ting uchar readadc (void); / / define function read data void adcck (void); / / define the clock function void delay1(uchar x) { uchar i; for ( i = 0; in {}; } void adcck (void) / / clock function { adcclk=1;delay1(2); adcclk=0;delay1(2); } uchar readadc (void) / / convert data function read TLC0831 { uchar i; uchar ch; adccs = 0; adcck (); ch = 0; for(;adcdo==1;)adcck(); for ( i = 0; i < 8; i + +) { adcck(); ch = ( ch < <1) | adcdo ; } adccs=1; return (ch); / / return value , that is, the converted data } void main (void) / / main function { uchar a; a=readadc(); ACC=a; }