freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

畢業(yè)設(shè)計-基于stc89c52單片機的分時計費智能電表設(shè)計(參考版)

2024-12-05 19:38本頁面
  

【正文】 */ { key_status = key_state_0。 } break。 else { key_status = key_state_2。 break。 KeyPort = 0xff。 key_temp |= KeyPort。 key_temp = KeyPort。 //按鍵狀態(tài) //線反轉(zhuǎn)法掃描鍵盤 KeyPort = 0x0f。 uchar key_num = NO_key。//控制初始化 :寫保護 } 按鍵部分: include //*************************************************************** // 函數(shù)名稱 : KeyBoardScan // 輸入?yún)?shù) : none // 返回參數(shù) : Key Number // 0~ *、 : ASCII code // F F F F4: (A、 B、 C、 D) ASCII code // 說 明 : // //*************************************************************** uchar KeyBoardScan(void) { uchar key_temp。 // 秒 分 時 日 月 星期 年 addr+=2。 i 7。 Write_data(control,0x00)。//禁止數(shù)據(jù)傳輸 return reg_data。//發(fā)送地址數(shù)據(jù) reg_data=Receive_byte()。 RST = 1。 RST = 0。//允許數(shù)據(jù)傳輸 Send_byte(addr | 0x00)。 } else {} } return receive。 SCLK = 0。 _nop_()。i ) { SCLK = 1。 for(i = 8。 SCLK = 1。 } 34 智能化測控應(yīng)用系統(tǒng)設(shè)計報告 else { IOD = 0。 if(datesend amp。i8。 //24 小時制 /////*****發(fā)數(shù)據(jù) (1字節(jié) )****/////// void Send_byte(uchar datesend) { uchar i。 } } iic_stop()。 if(i!=n1) { iic_ack()。in。 iic_ack()。 iic_start()。 iicwr_byte(add)。 iicwr_byte(0xa0)。 buff Return: 無 Others: 此函數(shù)之前需要定義一個合適大小的數(shù)組,調(diào)用本函數(shù)后 ,將 24c02 中數(shù)據(jù)讀進數(shù)組中 ****************************************/ void read_page(uchar *buff,uchar n,uchar add) 33 智能化測控應(yīng)用系統(tǒng)設(shè)計報告 { uint i。 return i。 iic_noack()。 iic_ack()。 iic_start()。 iicwr_byte(add)。 iicwr_byte(0xa0)。 //初始化 iic 總線 sda = 1。 無 Return: i Others: 使用隨機讀的方式,可對芯片內(nèi)任一地址直接讀操作 ****************************************/ uchar read_byte(uchar add) //隨機讀 { uchar i。 } iic_stop()。i++) { iicwr_byte(buff[i])。 for(i=0。 iicwr_byte(add)。 iicwr_byte(0xa0)。 無 Return: 無 Others: 采用指針進行數(shù)組的讀操作 ****************************************/ void write_page(uchar *buff,uchar n,uchar add) { uint i。 iic_stop()。 iicwr_byte(dat)。 iicwr_byte(add)。 iicwr_byte(0xa0)。 //初始化 iic 總線 sda = 1。 } 24C02 部分: include include include 31 智能化測控應(yīng)用系統(tǒng)設(shè)計報告 /************************************** Function: void write_byte(uchar add,uchar dat) Description: 在 24c02 某一地址寫一位數(shù)據(jù) Calls: iic_star(),iic_ack(),iicwr_byte(),iic_stop() Input: add,dat Output。n0。m0。 } } void delay_ms(unsigned int z) { unsigned int m,n。 str++。 //這里不檢測忙信號,發(fā)送地址碼 num=strlen(str)+X。 X |= 0x80。 //限制 X不能大于 15, Y不能大于 1 if (Y) X |= 0x40。 X amp。 Y amp。 //這里不檢測忙信號,發(fā)送地址碼 LCD_write_data(DData)。 X |= 0x80。 //限制 X不能大于 15, Y不能大于 1 if (Y) X |= 0x40。 X amp。 } void DisplayOneChar(unsigned char X, unsigned char Y, unsigned char DData) { Y amp。 // 開顯示,顯示光標(biāo) 0X0B:關(guān)閉顯示 (不顯示字符 ,只有背光亮 ) // 0x0C:開顯示 ,光標(biāo)閃爍都關(guān)閉 // 0X0D:開顯示 ,不顯示光標(biāo) ,但光標(biāo)閃爍 // 0X0E:開顯示 ,顯示光標(biāo) ,但光標(biāo)不閃爍 30 智能化測控應(yīng)用系統(tǒng)設(shè)計報告 // 0X0F:開顯示 ,光標(biāo)閃爍都顯示 LCD_write_instruction(0X06)。 } void LCMInit(void) //初始化 LCD { LCD_write_instruction(0X38)。 LCD_EN=1。 LCD_RW=0。 } void LCD_write_data(unsigned char LCD_data) //輸出一個字節(jié)數(shù)據(jù)到LCD {LCD_check_busy()。 LCD_EN=1。 LCD_RW=0。 } void LCD_write_instruction(unsigned char LCD_instruction) //寫指令到 LCD { LCD_check_busy()。 LCD_EN=1。 LCD_RW=0。 } void LCD_cls(void) //LCD 清屏 { LCD_check_busy()。 if(!LCD_BUSY)break。 LCD_DATA=0xff。 LCD_RS=0。 result=KeyBoardScan()。 //以 1ms 作為基準(zhǔn),即每過 1ms 進入一次定時器中斷 num++。 TH0 = 0x0FC。 } addres=0x80。 PrintChar(DS1302[j]/16)。j++) { DS1302[j] = Read_data(addres)。 for(j=0。 // PrintChar(i)。) { GotoXY(0,0)。 while(1) { 28 智能化測控應(yīng)用系統(tǒng)設(shè)計報告 if(result==39。 Print(TEST BY MB)。 Print(The 1602LCD Test)。 LCD_Initial()。 //等待一下 i = read_byte(7)。 write_page(shuzu,3,5)。 uchar j,temp,addres=0x80。 TR0=1。 //以 1ms 作為基準(zhǔn),即每過 1ms 進入一次定時器中斷 EA=1。 TH0 = 0x0FC。 while(a)。 //測試用數(shù)組 uchar data DS1302[7]。 uchar result。模擬部分(第五版) [M].北京 .高等教育出版社 .2021. 附錄 1 系統(tǒng)設(shè)計圖(原理圖、 PCB版圖、實物圖) 原理圖: 24 智能化測控應(yīng)用系統(tǒng)設(shè)計報告 PCB板圖: 實物圖: 25 智能化測控應(yīng)用系統(tǒng)設(shè)計報告 附錄 2 元件清單: 26 智能化測控應(yīng)用系統(tǒng)設(shè)計報告 元件名 型號 參數(shù) 數(shù)量 單片機 AT89C52 1 電能計量芯片 AD7755 1 LCD 顯示屏 LCD1602 1 時鐘芯片 DS1302 1 存儲芯片 24C02 1 電壓互感器 TV31B02 1 電流互感器 TA32BM 1 電阻 10K 1 1K 7 200Ω 2 電位器 W502 10K 1 瓷片電容 100nf 2 10nf 3 22pf 5 33nf 4 電解電容 10uf 3 按鍵 16 晶振 1 1 1 附錄 3: 程序代碼 : include 27 智能化測控應(yīng)用系統(tǒng)設(shè)計報告 include include include include define uchar unsigned char。 最后, 我還要感謝同組的各位同學(xué)以及我的各位室友,在 課程 設(shè)計的這段時間里,你們給了我很多的啟發(fā),提出了很多寶貴的意見,對于你們幫助和支持,在此我表示深深地感謝! 10 參考文獻 [1] 張毅剛 .單片機原理及應(yīng)用 [M].北京:高等教育出版社, . [2] 張培仁 .基于 C 語言編程 MCS51 單片機原理與應(yīng)用 [M]. 北京:清華大學(xué)出版社,2021. [3] 龍忠琪、金燕、李如春 .模擬集成電路教程 .北京:科學(xué)出版社, 2021. [4] 求是科技 .8051系列單片機 C程序設(shè)計完全手冊 .北京:人民郵電出版社, 2021. [5] 張廣軍 .微機原理及接口技術(shù) [M].成都:電子科技大學(xué)出版社, . [6] 李泉 ,海保軍 .RS232 收發(fā)器接口芯片 SP3223E/ 3243E 的原理及應(yīng)用 [J].國外電子元 23 智能化測控應(yīng)用系統(tǒng)設(shè)計報告 器件, 2021(9): 4244. [7] 王慶 芬、秦
點擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1