云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 红外体温计的设计 - 图文

红外体温计的设计 - 图文

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 6:23:14

江苏理工学院毕业设计说明书(论文)

if(TX_byte(SlaveAddress)){ //Send SlaveAddress-------------------??? }

DataL=RX_byte(ACK);

//Read low data,master must send

goto

repeat; //Repeat comunication again

ACK

DataH=RX_byte(ACK); Pec=RX_byte(NACK);

//Read high data,master must send ACK

//Read PEC byte, master must send

NACK

STOP_bit();

arr[5]=SlaveAddress; arr[4]=command;

//

//

//Stop condition

arr[3]=SlaveAddress; arr[2]=DataL; arr[1]=DataH; arr[0]=0;

//Load array arr

// // //

PecReg=PEC_calculation(arr);//Calculate CRC

//If received and calculated CRC are equal go

}while(PecReg != Pec);

out from do-while{} }

unsigned char PEC_calculation(unsigned char pec[])

第 25 页 共 61 页

*((unsigned char *)(&tdata))=DataH; //

*((unsigned char *)(&tdata)+1)=DataL; //data=DataH:DataL

return tdata;

江苏理工学院毕业设计说明书(论文)

{

do{

crc[5]=0; crc[4]=0; crc[3]=0; crc[2]=0; crc[1]=0x01; crc[0]=0x07; BitPosition=47; shift=0;

/* Set maximum bit position at 47 */

/* Load CRC value 0x000000000107 */

unsigned char crc[6]; unsigned char unsigned char unsigned char unsigned char unsigned char

BitPosition=47; shift; i; j; temp;

//Find first 1 in the transmited message i=5; j=0;

while((pec[i]&(0x80>>j))==0 && i>0){

BitPosition--; if(j<7){ } else{ }

第 26 页 共 61 页

j=0x00; i--; j++;

/* Set highest index */

江苏理工学院毕业设计说明书(论文)

}/*End of while */

shift=BitPosition-8; /*Get shift value for crc value*/

//Shift crc value while(shift){

for(i=5; i<0xFF; i--){

if((crc[i-1]&0x80) && (i>0)){ } else{ }

crc[i]<<=1; crc[i]+=temp;

temp=0; temp=1;

}/*End of for*/ shift--;

}/*End of while*/

//Exclusive OR between pec and crc for(i=0; i<=5; i++){

pec[i] ^=crc[i];

}/*End of for*/

}while(BitPosition>8);/*End of do-while*/

return pec[0];

}/*End of PEC_calculation*/

第 27 页 共 61 页

江苏理工学院毕业设计说明书(论文)

4.2显示模块设计

4.2.1显示模块分析

本次设计采用的是LCD5110液晶显示屏进行数值的显示,单片机将接收到的数字信号进行内部处理之后送至LCD5110进行数值显示。LCD5110驱动指令如表4-1所示:

表4-1驱动指令

4.2.2软件程序:

图4-4软件程序流程图。

第 28 页 共 61 页

搜索更多关于: 红外体温计的设计 - 图文 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

江苏理工学院毕业设计说明书(论文) if(TX_byte(SlaveAddress)){ //Send SlaveAddress-------------------??? } DataL=RX_byte(ACK); //Read low data,master must send goto repeat; //Repeat comunication again ACK DataH=RX_byte(ACK); Pec=RX_byte(NACK); //Read high data,master must send ACK

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com