Home > Basic Circuits >Digital-Analog Circuits > Application of digital-to-analog converter DAC0832 (including circuit and source code)

Application of digital-to-analog converter DAC0832 (including circuit and source code)

Source: InternetPublisher:桂花蒸 Keywords: Digital-to-Analog Conversion Updated: 2025/10/28

Application of Digital-to-Analog Converter DAC0832

[Experimental requirements]

By using the single-chip microcomputer to control DAC0832 to output a sawtooth wave, the light-emitting diode D12 on the experimental board changes from dark to bright and repeats the cycle.

[Purpose of the experiment]

Learn to use a single-chip microcomputer to control the digital-to-analog conversion chip DAC0832.

The DAC0832 is an 8-bit, all-MOS, medium-speed D/A converter. It utilizes an R-2RT resistor decoding network. The conversion result is a pair of differential current outputs with a conversion time of approximately 1µs. It uses a single power supply (+5V, +15V). The reference voltage is -10V to +10V. Here, we choose +5V as the reference voltage. The DAC0832 has three operating modes: pass-through, single-buffered, and double-buffered. Here, we choose pass-through mode, connecting all XFER, WR2, and CS pins to digital ground. Pin 8 connects to the reference voltage, which is +5V in this case. By controlling the regular changes in the output data at port P0, we can generate waveforms such as triangle waves, sawtooth waves, and trapezoidal waves.

[Hardware Circuit]

数模转换DAC0832的应用(含电路和源程序)

[source code]

//TX-1BDA test program, after downloading, you can observe the process of D13 LED changing from dark to bright and then turning off.

#include<reg51.h>

sbit wela=P2^7; //digital tube bit selection

sbit dula=P2^6; //segment selection

sbit dawr=P3^6; //DA write data

sbit csda=P3^2; //DA chip select

unsigned char a,j,k;

void delay(unsigned char i) //delay

{

for(j=i;j>0;j--)

for(k=125;k>0;k--);

}

void main()

{

wela=0;

dula=0;

csda=0;

a=0;

dawr=0;

while(1)

{

P0=a; //Continuously add one to a and send it to DA

delay(50); // Delay about 50ms, add one, and then send DA.

a++; 

}

}

Note: As the digital quantity sent to DA continues to increase, the current converted into analog quantity also continues to increase, so when we observe that the light-emitting diode D12 will change from dark to bright and then go out. . .

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号