调试AD7799遇到的问题
voidWriteAD5439(uintContralBits,uintDAdata)
{
unsignedchari;
uintbuf;
uintwave_data;
buf=DAdata;
buf=(buf<2);
wave_data=(ContralBits|buf);
SYNC_SET();
delay(1);
SCLK_SET();
SYNC_CLR();
for(i=0;i<16;i++)
{
SCLK_SET();
if((wave_data&0x8000)!=0)
{SDIN_SET();}
else
{SDIN_CLR();}
delay(1);
SCLK_CLR();
delay(1);
wave_data=(wave_data<1);
}
SYNC_CLR();
//LDAC_CLR();
//delay(1);
SCLK_SET();
//LDAC_SET();
delay(1);
}
unsignedintreadSDO(void)
{
unsignedchari=0;
unsignedintreadData=0;
bititemp;
WriteAD5439_CMD(0X2000);
SYNC_SET();
delay(1);
SYNC_CLR();
for(i=0;i<16;i++)
{
SCLK_SET();
readData<=1;
delay(1);
itemp=P0_5;
SCLK_CLR();
if(itemp)
readData|=1;
delay(1);
}
SYNC_CLR();
returnreadData;
}
voidInitAD5439(void)
{
DACLR_CLR();
delay(5);
DACLR_SET();
}
voidmain(void)
{
num=1023;
//InitAD5439();
WriteAD5439_CMD(0x9000);
WriteAD5439(0x1000,num);
//readSDO();
while(1)
{
num=1023;
WriteAD5439(0x1000,num);
delay(10);
num=0;
WriteAD5439(0x1000,num);
delay(10);
};
}
AD7799脉 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)