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