新闻中心

EEPW首页>嵌入式系统>设计应用> DAC0832数模转换实验

DAC0832数模转换实验

作者: 时间:2016-11-13 来源:网络 收藏
#include

#include
#define uchar unsigned char
#define uint unsigned int
uchar tt;
uint temp;

本文引用地址: //m.amcfsurvey.com/article/201611/316311.htm

void delay(uint z)
{
uint x,y;
for(x=110;x>0;x--)
for(y=z;y>0;y--);
}
void main()
{
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
while(1)
{

for(temp=0x80;temp<0xff;temp++)
{
P0=temp;
delay(10);

}
for(temp=0xff;temp>0x80;temp--)
{
P0=temp;
delay(10);
}

}
}

void timer0()interrupt1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tt++;
}



关键词:DAC0832数模转

评论


技术专区

关闭