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

正文內(nèi)容

電子萬年歷的設(shè)計(jì)畢業(yè)論文一稿(專業(yè)版)

2025-08-08 15:20上一頁面

下一頁面
  

【正文】 //寫入允許 Write1302(0x8a,temp)。 Downkey()。 Upkey()。 } Setkey()。 break。 if(temp==0) temp=0x7。 //秒數(shù)減 1 down_flag=1。 //讀取月數(shù) temp=temp+1。 case 3: temp=Read1302(DS1302_HOUR)。 //禁止寫入done=0。j++)。temp_value+=(aamp。 DQ = 1。uchar dat = 0。Write1302(0x8a,0x04)。 if(hide_sec2) { TimeTimeString[6] = TimeSecond/10 + 39。} else { TimeTimeString[0] = 39。 39。039。039。0x0F)。}void DS1302_GetTime(SYSTEMTIME *Time) //獲取時(shí)鐘芯片的時(shí)鐘數(shù)據(jù)到自定義的結(jié)構(gòu)型數(shù)組{unsigned char ReadValue。 }void Write1302(unsigned char ucAddr, unsigned char ucDa)//ucAddr: DS1302 地址, ucData: 要寫的數(shù)據(jù){ DS1302_RST = 0。define AM(X) Xdefine PM(X) (X+12) // 轉(zhuǎn)成 24 小時(shí)制define DS1302_SECOND 0x80 //時(shí)鐘芯片的寄存器位置,存放時(shí)間define DS1302_MINUTE 0x82define DS1302_HOUR 0x84 define DS1302_WEEK 0x8Adefine DS1302_DAY 0x86define DS1302_MONTH 0x88define DS1302_YEAR 0x8C void DS1302InputByte(unsigned char d) //實(shí)時(shí)時(shí)鐘寫入一字節(jié)(內(nèi)部函數(shù)){ unsigned char i。if(y==1)LCD_Write(LCD_COMMAND,0x80|(x0x40))。DBPort=input。sbit LcdRw =P2^6。sbit wireless_4 = P3^3。由于之前對其接觸較少,對它的性能要求了解不多,還有對它的相關(guān)技術(shù)要求也不是很清楚。 解決辦法:把不相關(guān)的程序暫時(shí)屏蔽,將設(shè)置時(shí)間子程序進(jìn)行獨(dú)立調(diào)試,發(fā)現(xiàn)在調(diào)用設(shè)置時(shí)間自動(dòng)更新時(shí),對數(shù)據(jù)處理不好,所以會(huì)造成錯(cuò)亂。圖 15 系統(tǒng)總體電路然后,使用 Keil C51 軟件對系統(tǒng)程序進(jìn)行編譯和查錯(cuò)。程序流程圖如下圖10 所示。表 2 DS1302 的日歷、時(shí)間寄存器此外,DS1302 還有年份寄存器、控制寄存器、充電寄存器、時(shí)鐘突發(fā)寄存器及與 RAM 相關(guān)的寄存器等。讀、寫時(shí)序如下圖 6 所示。DS1302由 VCC1 和 VCC2 兩者中的較大者供電。綜合考慮,選擇采用 DS1302 作為時(shí)鐘芯片來實(shí)現(xiàn)時(shí)鐘。但通過我們對各種電子鐘表、日歷的不斷觀察和總結(jié),發(fā)現(xiàn)目前市場的電子鐘表、日歷都存在一些不足之處,比如:時(shí)鐘不精確、產(chǎn)品成本太高、無環(huán)境溫度顯示等,這都給人們的使用帶來了某些不便。關(guān)鍵詞:電子萬年歷;單片機(jī);溫度傳感器;時(shí)鐘;液晶顯示器Abstract:Electronic perpetual calendar which is an application of the singlechip processor system, is utilized by bining hardware and software. And Hardware is posed of five modules: Main control unit, clock circuit, temperature test circuit, display circuit, keyboard interface. Main control board adopts AT89S52, clock circuit adopts the DS1302 clock chip, display module adopts the liquid crystal display 1602, and temperature test adopts the DS18B20 temperature sensor, keyboard interface circuit is pleted by connecting ordinary button with pullup resistor. Software takes advantage of C to program, so as to realize the programmed control of singlechip processor. Singlechip processor gets the time data through using the DS1302 clock chip. The DS18B20 gathers temperature signals and transmits them to singlechip processor. Then,the singlechip processor transmits the time data and the temperature data to the LCD1602. Lastly, the LCD displays the solar calendar year,with year, month, day, hour, minute, second, alarm clock, week and temperature.Key words:Electronic perpetual calendar。方案二:采用點(diǎn)陣式數(shù)碼管顯示點(diǎn)陣式數(shù)碼管是由八行八列的發(fā)光二極管組成,對于顯示文字比較合適,使用來顯示數(shù)字則顯得太浪費(fèi),且價(jià)格相對較高,所以不采用此方案。功能包括對會(huì)聚主 IC 內(nèi)部寄存器、數(shù)據(jù) RAM 及外部接口等功能部件的初始化,會(huì)聚調(diào)整控制,會(huì)聚測試圖控制,紅外遙控信號 IR 的接收解碼及與主板 CPU 通信等。SCLK 始終為輸入端。 RAM RD1 A4 A3 A2 A1 A0 /CK /WR表 1 DS1302 的控制字格式(3)數(shù)據(jù)輸入與輸出(I/O)在控制指令字輸入后的下一個(gè) SCLK 時(shí)鐘的上升沿時(shí),數(shù)據(jù)被寫入 DS1302,數(shù)據(jù)輸入從低位即位 0 開始。在調(diào)整時(shí)間過程中,要調(diào)整的位與別的位應(yīng)該有區(qū)別,所以增加了閃爍功能,即調(diào)整的位一直在閃爍,直到調(diào)整下一位。 顯示數(shù)據(jù)刷新子程序 此段程序主要功能是對顯示緩沖器中的顯示數(shù)據(jù)進(jìn)行刷新操作,當(dāng)最高顯示位為“0”時(shí),將符號顯示位移入下一位。 (4)焊接完后,再認(rèn)真對照電路原理圖、安裝圖檢查電路板上有無漏焊、錯(cuò)焊、短路、斷路等錯(cuò)誤現(xiàn)象,確認(rèn)無誤后才能通電。按鍵電路只包含 4 個(gè)按鍵,操作簡單實(shí)用。 //實(shí)時(shí)時(shí)鐘時(shí)鐘線引腳 sbit DS1302_IO = P1^6。 //P3^7。 _nop_()。}//初始化LCD************************************************************void LCD_Initial(){LcdEn=0。unsigned char Day。 for(i=8。 DS1302_CLK = 0。ReadValue = Read1302(DS1302_HOUR)。ReadValue = Read1302(DS1302_YEAR)。 TimeDateString[2] = 39。if(hide_day2){ TimeDateString[8] = TimeDay/10 + 39。 //字符串末尾加 39。039。\039。 //稍做延時(shí) DQ = 0。}/*************ds18b20 寫一個(gè)字節(jié)****************/ void WriteOneChar(uchar dat){ unsigned char i=0。 // this message is wery importantInit_DS18B20()。 TempBuffer[4]=39。 count=0。0x7f)0x59) //超過 59 秒,清零 temp=0。 break。 default:break。 //讀取小時(shí)數(shù)temp=temp1。 //月數(shù)減 1 down_flag=1。 while(wireless_4==1)。 } hide_sec++。 if(hide_min3) hide_min=0。 }while(count==4)。 }while。 if(hide_hour3) hide_hour=0。 down_flag=0。 //禁止寫入 up_flag=0。 //Setkey 按一次,count 就加 1 done=1。 case 6: temp=Read1302(DS1302_MONTH)。 //小于 0 秒,返回 59秒 break。 if(temp0x85) temp=0。 //星期數(shù)加 1 up_flag=1。 //秒數(shù)加 1 up_flag=1。} }}void outkey() //跳出調(diào)整模式,返回默認(rèn)顯示{ uchar Second。 //溫度符號 TempBuffer[3]=39。 // 跳過讀序號列號的操作WriteOneChar(0x44)。 delay_18B20(4)。 DQ = 1。 39。039。TimeDateString[10] = 39。 }TimeDateString[7] = 39。 TimeDateString[1] = 39。0x70)4)*10 + (ReadValueamp。0x70)4)*10 + (ReadValueamp。} unsigned char Read1302(unsigned char ucAddr)//讀取 DS1302 某地址的數(shù)據(jù){ unsigned char ucData。 ACC = ACC 1。unsigned char Hour。}//設(shè)置顯示模式************************************************************define LCD_SHOW 0x04 //顯示開define LCD_HIDE 0x00 //顯示關(guān) define LCD_CURSOR 0x02 //顯示光標(biāo)define LCD_NO_CURSOR 0x00 //無光標(biāo) define LCD_FLASH 0x01 //光標(biāo)閃動(dòng)define LCD_NO_FLASH 0x00 //光標(biāo)不閃動(dòng)void LCD_SetDisplay(unsigned char DisplayMode){LCD_Write(LCD_COMMAND, 0x08|DisplayMode)。 _nop_()。 //減法按鈕sbit out = P2^3。附錄 1 系統(tǒng)電路圖附錄 2 系統(tǒng)程序清單include include //include //include define uint unsigned intdefine uchar unsigned charsbit DS1302_CLK = P1^7。LCD1602 液晶顯示器效果清晰,而且亮度可調(diào)。其余元件必須按正確的極性插裝,否則電路不會(huì)正常工作。 開 始 溫 度 零 下 ? 溫 度 值 取 補(bǔ) 碼 置 “—”標(biāo) 志 置 “+”標(biāo) 志 結(jié) 束 計(jì) 算 小 數(shù) 位 BCD值 計(jì) 算 整 數(shù) 位 BCD值 N Y 圖 12 溫度轉(zhuǎn)換命令子程序流程圖 圖 13 溫度計(jì)算子程
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1