這是通過UART向PC機輸出數據,
void Data_send(u8 send_count)
{ u8 count;
for(count=0;count<send_count;count++){ //發送send_count個數據,接口來自Sgl_lim_count
SBUF=(AD7606_u16_votlage_data[count]>>8)&0XFF;
while(!TI); //等待發送完成
TI=0; //清TI標志位
}
}
在串口助手上顯示的數據為0x30,0x07,0x07,0x07,0x07,0x07,
這是通過printf()輸出向PC機輸出數據
void Data_send(u8 send_count)
{ u8 count;
ES=OFF; //關閉串口中斷
for(count=0;count<send_count;count++){ //發送send_count個數據,接口來自Sgl_lim_count
printf("%x\n",(AD7606_u16_votlage_data[count]>>8)&0XFF); //按順序從0發送16bit電壓數據數組中的每一個數據
}
ES=ON;
}
在串口助手上顯示的數據為0x30,0x30,0x30,0x30,0x30,0x30,
AD7606_u16_votlage_data中的數據期間沒有被篡改,求救大佬 |