Interface Design between STC89C52 and 8-bit D/A Converter DAC0832

Publisher:花开堂前Latest update time:2022-04-18 Source: eefocusKeywords:STC89C52  8-bit  DAC0832 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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


Keywords:STC89C52  8-bit  DAC0832 Reference address:Interface Design between STC89C52 and 8-bit D/A Converter DAC0832

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

Migration Technology received tens of millions of yuan in Series B financing, focusing on 3D vision robotic arm guidance, "100%" hard-core delivery capability
Migrate Technology recently completed a B round of financing of tens of millions of yuan, led by Shanda Fund. This round of financing will mainly be used to deepen the global market sales system of 3D vision products, strengthen the research and development of underlying technologies and the standardization of 3D
[robot]
Performance characteristics and applications of 3000D series universal USB oscilloscopes
Product introduction: Powerful, portable, and high-performance PicoS000 series computer oscilloscopes are small, lightweight, and portable, and have high-performance specifications, so they can fully meet the requirements of engineers for use in the laboratory or outside. This series of oscilloscopes has 2 or 4 anal
[Test Measurement]
Performance characteristics and applications of 3000D series universal USB oscilloscopes
Pinjia Group promotes Microchip's 3D TV glasses transmission and reception solutions
3D active glasses are an important part of 3D display technology Active shutter 3D technology, also known as ActiveShutter 3D in English, is used with active shutter 3D glasses. This 3D technology is most widely used in TVs and projectors, with relatively more resources and excellent image effects, and is h
[Home Electronics]
Pinjia Group promotes Microchip's 3D TV glasses transmission and reception solutions
STC89C52 MCU DAY 4 LED dot matrix module
LED dot matrix module displays the number 0 #include reg51.h #include intrins.h typedef unsigned char u8; typedef unsigned int u16; sbit SRCLK=P3^6; sbit RCLK=P3^5; sbit SER=P3^6; u8 ledduan ={0x00,0x00,0x3e,0x41,0x41,0x41,0x3e}; u8 ledwei ={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe}; void delay(int i) { while(
[Microcontroller]
D/A Converter (DAC)
Introduction to D/A Converters 1 Overview A digital-to-analog converter, also known as a D/A converter, or DAC for short, is a device that converts digital quantities into analog quantities. A D/A converter is basically composed of four parts, namely a weighted resistor network, an operational amplifier, a reference p
[Microcontroller]
D/A Converter (DAC)
Infineon Technologies Expands AURIX™ Rust Ecosystem with Solutions including HighTec’s ISO 26262 ASIL D Certified Rust Compiler
The Rust programming language has become an effective supplement and potential alternative to C/C++ in automotive software development due to its unique memory safety features. Infineon Technologies AG, a global semiconductor leader in power systems and the Internet of Things, has joined hands with partners
[Embedded]
Infineon Technologies Expands AURIX™ Rust Ecosystem with Solutions including HighTec’s ISO 26262 ASIL D Certified Rust Compiler
Design of program-controlled constant current source based on STC89C52
High-precision programmable constant current power supplies are widely used in instrumentation, sensor technology and testing. In the past, most programmable constant current source circuits used PWM pulse mode, which is easy to control and adjust, but the accuracy is difficult to guarantee, and the waveform duty cycle
[Power Management]
Design of program-controlled constant current source based on STC89C52
Foresight Launches Six Advanced Stereo Sensor Suite to Revolutionize Industrial and Automotive 3D Perception
On November 12, Foresight Autonomous Holdings, an innovator in automotive vision systems, announced the launch of its advanced sensor suite portfolio: ScaleCam™ Vision, ScaleCam™ Thermal and QuadSight® in various configurations. These cutting-edge sensor suites are designed to enhance perception capabilities and mee
[Automotive Electronics]
Foresight Launches Six Advanced Stereo Sensor Suite to Revolutionize Industrial and Automotive 3D Perception
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号