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
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
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- MCU Principles and Interface Technology C51 Programming (Edited by Zhang Yigang)
- 51 Single Chip Microcomputer C Language Programming Classic Examples (2nd Edition) (Hou Yubao)
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Why is 16MHZ not available for msp430?
- The live broadcast has ended [Microchip Embedded Security Solutions | Anti-counterfeiting protection for disposable products]
- An application example of a certain brand of high power density power module
- Will the DS1100 delay chip affect my analog signal?
- [Sipeed LicheeRV 86 Panel Review] 12. lvgl and pthread to implement TCP Client
- TPS61022 Constant Adjustable Heating Unit Power Supply Solution
- ST MEMS Creative Competition Post 6 - Machine Learning Core Learning (1) (MLC)
- [NXP Rapid IoT Review] Touch button does not respond - I2C deadlock release method
- A basic question about FPGA Verilog
- Ten milestones on the road to 5G future development