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)
{
}
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)
{
}
}
一周热门 更多>