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

正文內(nèi)容

基于51單片機(jī)的數(shù)字頻率計(jì)設(shè)計(jì)(編輯修改稿)

2024-07-09 08:21 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 則停止計(jì)數(shù)。 根據(jù)定時(shí)器的結(jié)構(gòu)原理,若我們將 GATE位、 TR0均設(shè)為‘ 1’, INT0端輸人被測(cè)頻率信號(hào),當(dāng)被測(cè)信號(hào)的高電平到來(lái)時(shí),開(kāi)始計(jì)數(shù);當(dāng)被測(cè)信號(hào)的低電平到來(lái)時(shí),計(jì)數(shù)器停止計(jì)數(shù),此時(shí) TL0、 TH0的數(shù)據(jù)就是相應(yīng)的 N值。 河南工業(yè)職業(yè)技術(shù)學(xué)院 —— 基于 51 單片機(jī)的數(shù)字頻率計(jì) 14 結(jié) 束 語(yǔ) 數(shù)字頻率計(jì)是計(jì)算機(jī)、通訊設(shè)備、音頻視頻等科研生產(chǎn)領(lǐng)域不可缺少的測(cè)量?jī)x器。在進(jìn)行模擬、數(shù)字電路的設(shè)計(jì)、安裝、調(diào)試過(guò)程中,由于其使用十進(jìn) 制數(shù)顯示,測(cè)量迅速,精確度高,顯示直觀,會(huì)被經(jīng)常使用到。 通過(guò)本次課程的設(shè)計(jì),不但加深我對(duì)在課程上所學(xué)到的單片機(jī)理論知識(shí)的認(rèn)識(shí)和理解,重新讓自己認(rèn)識(shí)到了這門(mén)學(xué)科的在應(yīng)用方面的廣闊前景,并且通過(guò)知識(shí)與應(yīng)用于實(shí)踐的結(jié)合更加豐富了自己的知識(shí)。擴(kuò)展了知識(shí)面,不但掌握了本專(zhuān)業(yè)的相關(guān)知識(shí),而且對(duì)其他專(zhuān)業(yè)的知識(shí)也有所了解,而且較系統(tǒng)的掌握單片機(jī)應(yīng)用系統(tǒng)的開(kāi)發(fā)過(guò)程,因而自身的綜合素質(zhì)有了全面的提高 。 經(jīng)過(guò)這次一個(gè)較完整的產(chǎn)品設(shè)計(jì)和制作過(guò)程,對(duì)于認(rèn)識(shí)到自己在知識(shí)方面存在的不足,明確今后的學(xué)習(xí)方向是非常有益的,為將來(lái)的的就業(yè) 提前打了下堅(jiān)實(shí)的基礎(chǔ)。在設(shè)計(jì)過(guò)程中,得到了我的指導(dǎo)老師的悉心指導(dǎo)與幫助,還有其他老師和同學(xué)的大力支持和協(xié)助,在此一并表示衷心的感謝。 河南工業(yè)職業(yè)技術(shù)學(xué)院 —— 基于 51 單片機(jī)的數(shù)字頻率計(jì) 15 參考文獻(xiàn) [1]李光飛 ,樓苗然主編 .51系列單片機(jī) .北京:北京航空航天大學(xué)出版社, 2021 [2]黃正瑾編著 .CPLD系統(tǒng)設(shè)計(jì)技術(shù)入門(mén)與應(yīng)用 . 北京 : 電子工業(yè)出版社 , 2021 [3]謝自美編著 .電子線路設(shè)計(jì)178。實(shí)驗(yàn)178。測(cè)試 .華中理工大學(xué)出版社 ,2021 [4]陳永甫編著 .電子電路智能化設(shè)計(jì) .實(shí)例與應(yīng)用 .北京:電子工業(yè)出版 , [5]康華光主編 .電子技術(shù) 基礎(chǔ) (第四版 ).北京:高等教育出版社, 1999 河南工業(yè)職業(yè)技術(shù)學(xué)院 —— 基于 51 單片機(jī)的數(shù)字頻率計(jì) 16 附錄 C 語(yǔ)源程序代碼 include include include define uchar unsigned char define uint unsigned int define S_RST DS_RST=1 define C_RST DS_RST=0 define S_CLK DS_CLK=1 define C_CLK DS_CLK=0 define Write_Disable RW_DS1302(0x8e,0x80) //寫(xiě)保護(hù) define Write_Enable RW_DS1302(0x8e,0x00) //允許寫(xiě)入 sbit SET = P1^5。 //設(shè)置按鍵 sbit ADD = P1^4。 //調(diào)整加 sbit DEC = P1^6。 //調(diào)整減 define RdefineT1 TH1=0。TL1=0。TR1=0。a=0。 //初始化超時(shí)檢測(cè) //define Delay2us() _nop_()。_nop_()。 //延時(shí) 2us,每 nop 1us //define Delay8us() _nop_()。_nop_()。_nop_()。_nop_()。_nop_()。_nop_()。_nop_()。_nop_()。 define ReDetectTime 20 //設(shè)置重復(fù)檢測(cè)次次數(shù),超出次數(shù)則超時(shí) //ds18b20命令 define SkipROM 0xCC define MatchROM 0x55 define ReadROM 0x33 define SearchROM 0xF0 define AlarmSearch 0xEC define Convert 0x44 //啟動(dòng)溫度轉(zhuǎn)換 define WriteScr 0x4E define ReadScr 0xBE define CopyScr 0x48 define RecallEE 0xB8 define ReadPower 0xB4 define md collect_time[0]amp。0x0f define mg (collect_time[0]amp。0x70)/16 define fd collect_time[1]amp。0x0f define fg (collect_time[1]amp。0x70)/16 define sd collect_time[2]amp。0x0f 河南工業(yè)職業(yè)技術(shù)學(xué)院 —— 基于 51 單片機(jī)的數(shù)字頻率計(jì) 17 define sg (collect_time[2]amp。0x30)/16 sbit DS_RST = P1^2。 //DS復(fù)位端 sbit DS_CLK = P1^0。 //SCLK端 sbit DS_IO = P1^1。 //IO端 sbit DS18B20 = P1^3。 //溫度傳感器接口 bit keyboard,flash,STA=1。 uchar choose,a。 uchar collect_time[3]={0x45,0x23,0x11}。//定義變量秒分時(shí) uchar collect_temperature[2] = {0}。 uchar num[10] = {0x7e,0x48,0x3d,0x6d,0x4b,0x67,0x77,0x4c,0x7f,0x6f}。 //七段數(shù)碼管顯示的段碼 uchar display[8] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08}。 void delay(uint i) { uint k。 while(i) { for(k=0。k120。k++){。} } } void Dat_Int(void)//數(shù)據(jù)初始化 { P0=0xff。 P1=0xff。 P2=0xff。 choose=0。 flash=1。 } void Time01_Int(void) { TMOD = 0x12。 //定時(shí)器 0為 8位自動(dòng)重載定時(shí)采樣,定時(shí)器 1為 16位超時(shí)檢測(cè)處理 TCON = 0x00。 TH0 = 0x60。 TL0 = 0x60。 TR0 = 1。 IE = 0x0a。 //允許定時(shí)器 0、 1中斷 IP = 0x00。 河南工業(yè)職業(yè)技術(shù)學(xué)院 —— 基于 51 單片機(jī)的數(shù)字頻率計(jì) 18 } /******************************************************** * * * DS18B20溫度傳感器程序段 * * * ********************************************************/ /***********11微秒延時(shí)函數(shù) **********/ // void delayus(uint t) { for(。t0。t)。 } /***********18B20復(fù)位函數(shù) **********/ void ow_reset(void) { char presence=1。 while(presence) { while(presence) { DS18B20 = 1。_nop_()。_nop_()。 DS18B20 = 0。 delayus(50)。 // 550us DS18B20 = 1。 delayus(6)。 // 66us presence=DS18B20。 // presence=0繼續(xù)下一步 } delayus(45)。 //延時(shí) 500us presence = ~DS18B20。 } DS18B20 = 1。 } /**********18B20寫(xiě)命令函數(shù) *********/ //向 1WIRE 總線上寫(xiě)一個(gè)字節(jié) void write_byte(uchar val) { uchar i。 for (i=8。 i0。 i) // 河南工業(yè)職業(yè)技術(shù)學(xué)院 —— 基于 51 單片機(jī)的數(shù)字頻率計(jì) 19 { DS18B20 = 1。_nop_()。_nop_()。 DS18B20 = 0。_nop_()。_nop_()。_nop_()。_nop_()。_nop_()。//5us DS18B20 = valamp。0x01。 //最低位移出 delayus(6)。 //66us val=val/2。 //右移一位 } DS18B20 = 1。 delayus(1)。 } // /*********18B20讀 1個(gè)字節(jié)函數(shù) ********/ //從總線上讀取一個(gè)字節(jié) uchar read_byte(void) { uchar i。 uchar value = 0。 for (i=8。i0。i) { DS18B20 = 1。_nop_()。_nop_()。 value=1。 DS18B20 = 0。 // _nop_()。_nop_()。_nop_()。_nop_()。 //4us DS18B20 = 1。_nop_()。_nop_()。_nop_()。_nop_()。 //4us if(DS18B20)value|=0x80。 delayus(6)。 //66us } DS18B20 = 1。 return(value)。 } // /***********讀出溫度函數(shù) **********/ // void Ds18b20_ReadEE(void) { ow_reset()。 write_byte(SkipROM)。 // Skip ROM write_byte(Convert)。 // 發(fā)轉(zhuǎn)換命令 ow_reset()。 //總線復(fù)位 write_byte(SkipROM)。 // 發(fā) Skip ROM命令 write_byte(ReadScr)。 // 發(fā)讀命令 collect_temperature[0]=read_byte()。 //溫度低 8位 collect_temperature[1]=read_byte()。 //溫度高 8位 河南工業(yè)職業(yè)技術(shù)學(xué)院 —— 基于 51 單片機(jī)的數(shù)字頻率計(jì) 20 } /******************************************************** * * * DS1302時(shí)鐘芯片程序段 * * * ********************************************************/ void DS1302_InputByte(uchar byte) //往 DS1302寫(xiě)入 1Byte數(shù)據(jù) { uchar i。 uchar temp。 temp = byte。 for(i=8。 i0。 i) { DS_IO = tempamp。0x01。 S_CLK。 C_CLK。 temp = temp 1。 } } uchar DS1302_OutputByte(void) //從 DS1302讀取 1Byte數(shù)據(jù) { uchar i。 uchar temp=0。 for(i=0。 i8。i++) { C_CLK。 if(DS_IO!=0) temp|=(1i)。 S_CLK。 } return(temp)。 } void RW_DS1302(uchar reg, uchar byte)//向 DS1302寄存器寫(xiě)數(shù)據(jù) { C_RST。 C_CLK。 S_RST。 河南工業(yè)職業(yè)技術(shù)學(xué)院 —— 基于 51 單片機(jī)的數(shù)字頻率計(jì) 21 DS1302_InputByte(reg)。 DS1302_InputByte(byte)。 S_CLK。 C_RST。 } uchar Read_DS1302(uchar reg)//從 DS1302寄存器讀數(shù)據(jù) { uchar byte。 C_RST。
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1