1. DAC0832 chip - current output D/A converter
8-bit parallel input mode
Resolution 19.5mV (VREF = 5V)
Current build-up time 1μS
Input compatible with TTL level
Single power supply (+5V~+15V)
Low power consumption, 20mw
1. Pin function:
DI0~DI7: 8-bit digital signal input terminal, connected to the data bus P0 port of the microcontroller, used to receive digital quantities sent by the microcontroller to be converted into analog quantities, DI7 is the highest bit.
: Chip select terminal, when it is low level, this chip is selected.
ILE: Data latch enable control terminal, high level is valid.
: First level input register write enable control, low level is effective.
=0, ILE=1, =0, the data signal to be converted is latched into the first-level 8-bit input register.
:Data transmission control, low level is valid.
:DAC register write enable control terminal, low level is valid.
=0, =0, the data to be converted in the input register is transferred to the 8-bit DAC register.
IOUT1: D/A converter current output 1 terminal. When the input digital quantities are all "1", IOUT1 is maximum, and when the input digital quantities are all "0", IOUT1 is minimum.
IOUT2: D/A converter current output 2, IOUT2 + IOUT1 = constant.
Rfb: External feedback signal input terminal. There is an internal feedback resistor Rfb, and an external feedback resistor can also be connected as needed.
VCC: Power input terminal, within the range of +5V to +15V.
2. Structure of DAC0832
Internal composition:
1 8-bit input latch
One 8-bit DAC register
1 8-bit D/A converter
5 control logics (2-level control)
Working process: 8-bit data is sent to the latch in parallel → enters the register under the action of the first-level control signal → enters the converter under the action of the second-level control signal → the conversion result is output by the Iout1 current.
3. Three control methods of DAC0832
Pass-through mode - Both registers are in the pass-through state
The pass-through method cannot be directly connected to the system's data bus and requires an additional latch, so it is rarely used.
Single buffer mode - one register is in pass-through state and the other is in controlled state
Double buffering mode - both registers are in controlled state
2. Interface between STC89C52 and DAC0832
1. Direct control mode---both registers are in direct state
The circuit uses I/O port wiring and direct control mode - all four control terminals are connected to low level, and ILE is connected to high level. Once the digital quantity is input, it directly enters the DAC register for D/A conversion.
2. Single buffer mode --- one of the two internal data buffers is in direct mode, and the other is in latch mode controlled by the microcontroller. In practical applications, if there is only one analog output, or if there are multiple analog outputs but synchronization of multiple outputs is not required, the single buffer mode can be used.
The polarity of the unipolar output is determined by the polarity of VREF.
In the figure, ILE is connected to +5V, IOUT2 is grounded, and the output current of IOUT1 is converted by the operational amplifier to output a unipolar voltage with a range of 0 to +5V. The "8-bit DAC register" of DAC0832 works in direct-through mode. The "8-bit input register" is in a controlled state and is controlled by P2.7.
When the microcontroller executes the following instruction, a low level can be generated on and , allowing DAC0832 to receive the digital value sent by STC89C52.
MOV DPTR,#7FFFH
MOV A,#data
MOVX @DPTR,A
[Example] DAC0832 is used as a waveform generator. Write a program to generate triangular waves and rectangular waves.
Triangle wave
#include #define DAC0832 XBYTE[0x7fff] //Set the access address of DAC0832 unsigned char num; void main() { while(1){ for (num=0;num<0xff;num++) // rising segment waveform DAC0832=whether; for (num=0xff; num > 0 ; num--) //Descending waveform DAC0832=num; //DAC0832 conversion output } } Rectangular wave #include #define DAC0832 XBYTE[0x7fff] //Set the access address of DAC0832 unsigned int i; void main() { while (1) { for(i=0;i<10000;i++) //set the digital value corresponding to the upper limit level, delay DAC0832=255; for(i=0;i<20000;i++) //set the digital value corresponding to the lower limit level, delay DAC0832=0; } } 3. Double buffering mode: both registers are in controlled state separately. For systems that require synchronous conversion and output of multiple D/A converters, a dual-buffer synchronization method should be used. When DAC0832 works in dual-buffer mode, the input latching and D/A conversion of digital quantities are completed in two steps. First, the CPU's data bus inputs the digital quantities to be converted to each D/A converter in a time-sharing manner and latches them in their respective input latches. Then the CPU sends a control signal to all D/A converters, so that the data in the input latches of each D/A converter is entered into the DAC register to achieve synchronous conversion and output. In the case of multi-channel D/A conversion output, in addition to the above method, multi-channel DAC chips can also be used. This DAC chip has two or more identical DACs in the same package, and they can work independently. For example, AD7528 is a dual-channel 8-bit DAC chip that can output two analog quantities at the same time; AD7526 is a quad-channel 8-bit DAC chip that can output four analog quantities at the same time. [Example] According to the figure below, two-way D/A synchronous output is realized to generate upstream and downstream sawtooth waves. #include #define DAC1 XBYTE[0xdfff] //Set the access address of 1#DAC0832 input latch #define DAC2 XBYTE[0xbfff] //Set the access address of 2#DAC0832 input latch #define DAOUT XBYTE[0x7fff] // two DAC0832 DAC register access addresses void main (void){ unsigned char num; //Data to be converted while(1){ for(num =0; num <=255; num++){ DAC1 = num; // Upper sawtooth is sent to 1#DAC DAC2 = 255-num; //Send the lower sawtooth to DAC#2 DAOUT = num; //Two channels of D/A conversion output simultaneously } } } 3. Bipolar voltage output In situations where bipolar voltage output is required, the wiring can be done according to Figure 11-14. In the figure, the digital value of DAC0832 is sent by the microcontroller. A1 and A2 are both operational amplifiers, which are fed back to the input terminal of operational amplifier A2 through a 2R resistor. Point G is the virtual ground. The equations listed by Kirchhoff's law can be solved to get
Previous article:The hardware structure of MCS-51 single chip microcomputer
Next article:A/D Converter (ADC)
Recommended ReadingLatest update time:2024-11-16 17:45
- Popular Resources
- Popular amplifiers
- Introduction to Internet of Things Engineering 2nd Edition (Gongyi Wu)
- Permanent Magnet Synchronous Motor Speed Control System Control Technology (by Hou Limin and Wang Wei)
- Implementing a Deep Learning Framework with Python (Zhang Juefei, Chen Zhen)
- A Complete Illustrated Guide to Operational Amplifier Applications (Written by Wang Zhenhong)
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
- MicroPython Hands-on (15) - AB Buttons on the Control Panel
- TMS320F28335---External key interrupt
- Is FPGA acceleration of CNN an option? What board should I use?
- Security Tools Bombercat
- The solid state drive doesn't seem to be as good as I thought
- [NXP Rapid IoT Review] Local compilation of online generated projects
- EEWORLD University ---- Practical Guide to Motor Application Development - Based on STM32
- Simulation Help Post
- Based in Chengdu, job position: Reliability Engineer
- Use ST's new APP to instantly find the most suitable sensor