Interface Design between Serial AD Converter TLC2543 and 51 Single Chip Microcomputer

Publisher:DataExplorerLatest update time:2012-01-04 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

TLC2543 is a 12-bit analog-to-digital converter with 11 input terminals. It has the advantages of fast conversion, good stability, simple interface with microprocessor, low price, etc., and has good application prospects. Since it has a serial peripheral interface (SPI, Seri-al PeripheralInterface), and the 51 series microcontroller does not have SPI, it is very meaningful to study its interface with the 51 microcontroller. 1 Pins and functions of TLC2543 TLC2543 is a 12-bit switched capacitor successive approximation analog-to-digital converter with multiple packaging forms. The pin diagram of DB, DW or N package is shown in Figure 1. The functions of the pins are briefly classified as follows.



I/OCLOCK: Controls the clock of input and output, input from the outside.
DATAINPUT: Control word input terminal, used to select the conversion and output data format.
DATAOUT: Output terminal of A/D conversion result. 2 How to use TLC2543 2.1 Format of control word The control word is 8-bit data serially input from the DATAINPUT terminal, which specifies the analog channel to be converted by TLC2543, the length of the converted output data, and the format of the output data. The high 4 bits (D7~D4) determine the channel number. For channels 0 to 10, the 4 bits are 0000~1010H respectively. When they are 1011~1101, they are used for self-test of TLC2543, testing the values ​​of (V REF ++V REF -)/2, V REF -, and V REF + respectively. When it is 1110, TLC2543 enters the sleep state. The lower 4 bits determine the output data length and format, among which D3 and D2 determine the output data length. 01 indicates that the output data length is 8 bits, 11 indicates that the output data length is 16 bits, and the others are 12 bits. D1 determines whether the output data is sent out first with the high bit or the low bit first. 0 indicates that the high bit is sent out first. D0 determines whether the output data is unipolar (binary) or bipolar (2's complement). If it is unipolar, this bit is 0, otherwise it is 1. 2.2 Conversion process After power-on, the chip select CS must go from high to low to start a working cycle. At this time, EOC is high, the input data register is set to 0, and the content of the output data register is random. At the beginning, the CS chip select is high, I/O CLOCK and DATA INPUT are disabled, DATA OUT is in high impedance, and EOC is high. Make CS low, I/OCLOCK and DATAINPUT enabled, and DATAOUT is out of high impedance. 12 clock signals are added from the I/OCLOCK terminal in sequence. With the addition of the clock signal, the control word is sent to TLC2543 from DATAINPUT one by one at the rising edge of the clock signal (the high bit is sent first), and at the same time, the A/D data converted in the previous cycle, that is, the data in the output data register, is shifted out from DATAOUT one by one. After TLC2543 receives the 4th clock signal, the channel number has also been received. At this time, TLC2543 starts sampling the analog quantity of the selected channel and keeps it until the falling edge of the 12th clock. At the falling edge of the 12th clock, EOC becomes low, and the A/D conversion of the analog quantity sampled this time begins. The conversion time takes about 10μs. After the conversion is completed, EOC becomes high, and the converted data is in the output data register, waiting to be output in the next working cycle. After that, a new working cycle can be carried out. 3 Interface between TLC2543 and MCU and acquisition program The 51 series MCU currently used does not have an SPI interface. In order to interface with TLC2543, the SPI function can be implemented by software functions. Its hardware interface is shown in Figure 2. This example uses delay for acquisition, so the interface of the EOC pin is omitted.












The following is an A/D conversion program written in C51. Port is the analog channel number to be collected, and ad_data is the sample value. delay() is a delay function, which is about 20 microseconds.

References [1] TEXAS Product Manual [Z]. 2000. [2] Ma Mingjian, Zhou Changcheng. Data Acquisition and Processing [M]. Xi'an: Xi'an Jiaotong University Press, 1998. [3] He Limin. MCS-51 Single Chip Microcomputer Application System [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 1998





Reference address:Interface Design between Serial AD Converter TLC2543 and 51 Single Chip Microcomputer

Previous article:Design of Ultrasonic Distance Measuring Device Based on 51 Single Chip Microcomputer
Next article:Design of Low Frequency Digital Phase Measuring Instrument Based on Single Chip Microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号