有没有人用过AD5420这个芯片

2019-07-20 23:33发布

如题,来个示例程序
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
12条回答
jeraw
2019-07-21 02:54
官方移植
 int main(void)
 {
 
delay_init();     //延时函数初始化  
NVIC_Configuration(); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
intGPIO();

buf[2] = 0x56;
buf[1] = 0x00;              //Disable Slew Rate
buf[0] = 0x01;
WriteToAD5420(3,buf); //Write 551005 to SHIFT REGISTER  to write 1005 to control register
delay(5000);
buf[2] = 0x55;
buf[1] = 0x30;
buf[0] = 0x07;
WriteToAD5420(3,buf);
delay(5000);

 buf[2] = 0x01;
buf[1] = 0x11;
buf[0] = 0x11;
WriteToAD5420(3,buf); //Write 019966H to SHIFT REGISTER  to write 9966 to DATA REGISTE

GPIO_SetBits(GPIOB,GPIO_Pin_11);;
delay(100);
GPIO_ResetBits(GPIOB,GPIO_Pin_11);
delay(100);    //Dalay some time before reading the STATUS REGISTER and DATA REGISTER  
    while(1)
{  
}  

}  
 

一周热门 更多>