这个初始化程序使我根据时序图写的,我调试过,串行发送的数据是对的,怀疑是时序的问题但是我看手册没发现有什么问题,还是改不出来。请哥哥帮帮忙。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
这个初始化程序使我根据时序图写的,我调试过,串行发送的数据是对的,怀疑是时序的问题但是我看手册没发现有什么问题,还是改不出来。请哥哥帮帮忙。
void DACinit(u16 DAC_DATE)
{
u8 i=0;
u16 date_two=0;
date_two=DAC_DATE|0X1000; //控制高四位数据,选择通道A
SCLK_0;
SYNC_1;
SYNC_0;
delay(1);
for(i=0;i<16;i++)
{
if((date_two&0x8000)==0)
{
DATA_0;
}
else
DATA_1;
SCLK_1;
date_two=date_two<<1;
delay(1);
SCLK_0;
}
SYNC_1;
}
void delay(u8 Xns)
{
while(Xns--);}