调试DAC8563,可以控制它的参考电压使用内部还是外部,两个通道的增益之类,但是就是不能改变输出电压,输出的值总是和参考电压一样,不管我给的是什么值,求解。。
程序:
#define WINRT_A_UPD 0x10
#define WINRT_B_UPD 0x11
#define WINRT_ALL_UPD 0x17
#define WINRT_A_UPDA 0x18
#define WINRT_B_UPDB 0x19
#define WINRT_ALL_UPDA 0x1F
#define UPD_A 0x08
#define UPD_B 0x09
#define UPD_ALL 0x0F
#define SET_GAIN 0x02
#define A2B2 0x0000
#define A1B2 0x0001
#define A2B1 0x0002
#define A1B1 0x0003
#define LDAC 0X30
#define ACAB 0X0000
#define ABIA 0X0001
#define AAIB 0X0002
#define IAAB 0X0003
#define INREF 0X38
#define DIS_REF 0X0000
#define EN_REF 0X0001
void Ini_8563(void)
{
P3SEL &=~ (BIT0 + BIT1 + BIT2);
P3DIR |= (BIT0 + BIT1 + BIT2);
SYNC_1;
SCLK_1;
Write_8563(LDAC,IAAB);
Write_8563(POUP,POUP_AB);
Write_8563(INREF,DIS_REF);
Write_8563(SET_GAIN,A2B2);
Write_8563(WINRT_ALL_UPDA,32768);
}
void Write_8563(ulint data1,ulint data2)
{
ulint data=0;
data += data1;
data <<= 8;data <<= 8;
data += data2;data <<= 8;
SYNC_0;
delay_Nms(5);
for(char i=24;i>0;i–) {
if(data & 0x80000000) DIN_1;
else DIN_0;
SCLK_0;
delay_Nms(5);
SCLK_1;
delay_Nms(5);
data <<= 1;
}
SYNC_1;
delay_Nms(10);
}
这个时候输出的还是参考电压的值
yuan wang3:
回复 user151383853:
额问题解决了,芯片坏了= 。=||