【正文】
128 bytes of on board RAM full duplex UART 32 descrete I/O pins (4 groups of 8) which can be individually accesseds entire line of products since it can perform many functions and developers will only have to learn this one platform. The basic architecture consists of the following features: s close on the heels of a special processor, while the ordinary price of the model dropped to one . dollars, the most highend models, only 10 . dollars. Contemporary singlechip microputer system is no longer only the baremetal environment in the development and use of a large number of dedicated embedded operating system is widely used in the full range of singlechip microputer. In PDAs and cell phones as the core processing of highend singlechip or even a dedicated direct access to Windows and Linux operating systems. More than a dedicated singlechip processor suitable for embedded systems, so it was up to the application. In fact the number of singlechip is the world39。s with the big consumer electronics product development, singlechip technology is a huge improvement. INTEL i960 Series with subsequent ARM in particular, a broad range of applications, quickly replaced by 32bit singlechip 16bit singlechip highend status, and enter the mainstream market. Traditional 8bit singlechip performance has been the rapid increase in processing power pared to the 8039。附錄2 外文參考文獻(xiàn)(原文)Principle of MCUSinglechip is an integrated on a single chip a plete puter system. Even though most of his features in a small chip, but it has a need to plete the majority of puter ponents: CPU, memory, internal and external bus system, most will have the Core. At the same time, such as integrated munication interfaces, timers, realtime clock and other peripheral equipment. And now the most powerful singlechip microputer system can even voice, image, networking, input and output plex system integration on a single chip. Also known as singlechip MCU (Microcontroller), because it was first used in the field of industrial control. Only by the singlechip CPU chip developed from the dedicated processor. The design concept is the first by a large number of peripherals and CPU in a single chip, the puter system so that smaller, more easily integrated into the plex and demanding on the volume control devices. INTEL the Z80 is one of the first design in accordance with the idea of the processor, From then on, the MCU and the development of a dedicated processor parted ways. Early singlechip 8bit or all of the four. One of the most successful is INTEL39。這給出了921583指令每秒指令頻率。所需的時間任何8051指令可以除以12例,時鐘頻率通過反演結(jié)果和增殖它的數(shù)字處理器周期所指示的問題?;窘Y(jié)構(gòu)由以下特點:一個8為的算術(shù)邏輯單元32個離散輸入輸出端口(4組8位)可單獨訪問二16位?定時器/計數(shù)器全雙工通用異步接收/發(fā)送裝置6個中斷源與2個優(yōu)先級別128字節(jié)的隨機(jī)存儲器64K分開字節(jié)地址空間的數(shù)據(jù)和代碼的記憶一個數(shù)字處理器周期共有十二振蕩器的時期。8051的變化,達(dá)到40MHz時鐘頻率下降到150伏電壓條件是可得到的。僅次于摩托羅拉68HC11在8位處理器銷售,8051家庭的微控制器, 在制造商上有各種各樣的變化,如因特爾公司、西門子、飛利浦。 單片機(jī)硬件介紹:8051系列微控制器是建立在一個高度優(yōu)化的嵌入式控制系統(tǒng)的結(jié)構(gòu)上。而個人電腦中也會有為數(shù)不少的單片機(jī)在工作?,F(xiàn)代人類生活中所用的幾乎每件電子和機(jī)械產(chǎn)品中都會集成有單片機(jī)。單片機(jī)比專用處理器更適合應(yīng)用于嵌入式系統(tǒng),因此它得到了最多的應(yīng)用。當(dāng)代單片機(jī)系統(tǒng)已經(jīng)不再只在裸機(jī)環(huán)境下開發(fā)和使用,大量專用的嵌入式操作系統(tǒng)被廣泛應(yīng)用在全系列的單片機(jī)上。而傳統(tǒng)的8位單片機(jī)的性能也得到了飛速提高,處理能力比起80年代提高了數(shù)百倍。90年代后隨著消費電子產(chǎn)品大發(fā)展,單片機(jī)技術(shù)得到了巨大的提高?;谶@一系統(tǒng)的單片機(jī)系統(tǒng)直到現(xiàn)在還在廣泛使用。其中最成功的是INTEL的8031,因為簡單可靠而性能不錯獲得了很大的好評。INTEL的Z80是最早按照這種思想設(shè)計出的處理器,從此以后,單片機(jī)和專用處理器的發(fā)展便分道揚鑣。單片機(jī)由芯片內(nèi)僅有CPU的專用處理器發(fā)展而來。而現(xiàn)在最強大的單片機(jī)系統(tǒng)甚至可以將聲音、圖像、網(wǎng)絡(luò)、復(fù)雜的輸入輸出系統(tǒng)集成在一塊芯片上。盡管他的大部分功能集成在一塊小芯片上,但是它具有一個完整計算機(jī)所需要的大部分部件:CPU、內(nèi)存、內(nèi)部和外部總線系統(tǒng),目前大部分還會具有外存。從這次的畢業(yè)論文設(shè)計中,我真正的體會到,知識的重要性,特別是要理論聯(lián)系實際,把我們所學(xué)的理論知識運用到實際生活當(dāng)中,要用知識改變一切。做為新時代的我們,更應(yīng)該提高自身能力,適應(yīng)新時代的發(fā)展。電子時鐘更具人性化,更能提高人們的生活質(zhì)量,更受人們歡迎。硬件設(shè)施基本合乎要求,軟件設(shè)計可以配合硬件實現(xiàn)其功能。功能上基本達(dá)標(biāo):時鐘的顯示,調(diào)時功能。 write_(0x80+14)。0x0F)。 shi=((u2amp。 write_(0x80+10)。0x0F)。 shi=((u2amp。 write_(0x80+7)。0x0F)。 shi=((u2amp。 write_(0x80+4)。0x0F)。 shi=((u2amp。 write_(0x80+0x40+4)。0x0F)。 shi=((u2amp。 write_(0x80+0x40+7)。0x0F)。 //從分寄存器讀 fen=((u1amp。 write_(0x80+0x40+10)。0x0F)。 miao=((uamp。 while(1) { uint u,u1,u2。 } return(ACC)。 sclk = 1。 shu1) { ACC = ACC 1。 for(shu1=8。 sclk=0。 B=B1。shu8。 B=1。 ce=0。 write_date(0x30+ge)。 write_(0x80+add)。 shi=date/10。 write_date(0x30+ge)。 write_(0x80+0x40+add)。 shi=date/10。 TR0=1。 EA=1。 TH0=(6553650000)/256。 delay(5)。num12。} write_(0x80+0x40)。num++) {write_date(table[num])。 for(num=0。 write_(0x01)。 write_(0x0c)。 lcden=0。 }void init(){uchar num。 delay(5)。 delay(5)。 lcden=0。 lcden=0。 lcden=1。 P0=。}void write_(uchar ){rs=0。y0。x0。void delay(uint z){uint x,y。uchar code table[]= 20 W: 。uchar count,s1num。sbit B1=B^0。sbit sclk=P2^6。sbit rd=P3^7。sbit s2=P3^1。sbit lcden=P3^4。 部分程序代碼includeincludedefine uchar unsigned char define uint unsigned intsbit rw=P3^6。此時定時器采用定時中斷的工作方式,這樣可以充分利用CPU資源。RST置1開 始發(fā)送1位命令碼命令碼8位送完?寫一位數(shù)據(jù)數(shù)據(jù)寫完?RST置0(a)時鐘寫結(jié) 束開 始RST置1發(fā)送1位命令碼命令碼8位送完?讀一位數(shù)據(jù)數(shù)據(jù)讀完?RST置0結(jié) 束(b) 時鐘讀 日歷時鐘的寫和讀NYYYYNNN 顯示子程序設(shè)計本設(shè)計的顯示部分具有消隱和閃爍功能,當(dāng)時分秒等高位為0時顯示消隱, 此時在讀時間時更加明了,但低位不能顯示消隱。在串行時鐘的下降沿,DS1302向I/O端口輸出一位數(shù)據(jù),8個串行時鐘脈沖就可以輸出一字節(jié)的數(shù)據(jù)。只有在SCLK為低電平時,才能將RST置為高電平,這一點我們要一定注意。如果在傳送過程中RST置為低電平,則會終止此次數(shù)據(jù)傳送,I/O引腳變?yōu)楦咦钁B(tài)。讀寫都是16位數(shù)據(jù)高8位是地址低8位是數(shù)據(jù),在讀寫時要嚴(yán)格遵從其讀寫時序,否則讀寫將會失效。所有時序都是將主機(jī)作為主設(shè)備,單總線器件作為從設(shè)備。 鍵盤子程序流程圖 日歷時鐘子程序設(shè)計DS1302與CPU的連接需要三條線,即SCLK(7)、I/O(6)、RST(5)。由于鍵盤流程圖非常復(fù)雜,在此只表示秒,其余略。當(dāng)判斷鍵值為1時則為調(diào)秒狀態(tài),對應(yīng)的秒低位閃爍,為2時為調(diào)分狀態(tài)并分閃爍,為3時為調(diào)時狀態(tài)并時閃爍,為4時為調(diào)日狀態(tài)并日閃爍,為5時為調(diào)月狀態(tài)并月閃爍,為6時為調(diào)年狀態(tài)并年閃爍,為7時為調(diào)星期狀態(tài)并星期閃爍。其中K1鍵功能最多,通過判斷K1鍵按下的次數(shù)來判斷是調(diào)時間還是定時,并對對應(yīng)的位置閃爍。本設(shè)計的突出之處在于硬件電路簡單,大大減少了硬件開銷,這樣又勢必增加了軟件開發(fā)的難度,但降低了成本有利于市場的開闊。設(shè)計采用動態(tài)顯示,輪流掃描各個LED使之顯示相應(yīng)的數(shù)型碼,當(dāng)掃描頻率大于人眼所能識別的頻率時就