本帖最后由 pegion1001 于 2018-5-8 11:17 编辑
正在用STM32L432+AD7794,现在是配置AD7794不对,大家帮忙看看,谢谢!
void USER_AD7794Work(void)
{
uint8_t i = 0,j = 0;
USER_InitAD7794();
/*******************************************/
gSPI3WriteBuff[0] = 0x10;
gSPI3WriteBuff[1] = 0x10;
gSPI3WriteBuff[2] = 0x01;
USER_SPI3_Write(3);
for(i = 0; i < 0xff; i++)
for(j = 0; j < 0x7f; j++)
;
gSPI3WriteBuff[0] = 0x28;
gSPI3WriteBuff[1] = 0x01; //输出10uA的电流
USER_SPI3_Write(2);
for(i = 0; i < 0xff; i++)
for(j = 0; j < 0x7f; j++)
;
gSPI3WriteBuff[0] = 0x08;
gSPI3WriteBuff[1] = 0x20;
gSPI3WriteBuff[2] = 0x0A;
USER_SPI3_Write(3); //运行过这一句,就没有电流输出了
for(i = 0; i < 0xff; i++)
for(j = 0; j < 0x7f; j++)
;
gSPI3WriteBuff[0] = 0x58;
USER_SPI3_Write(1);
USER_SPI3_Read(4);
/****************************************/
} |