【正文】
與接口.北京:清華大學(xué)出版社.20058. 文艷,譚鴻.Protel 99 SE電子電路設(shè)計(jì).北京:機(jī)械工業(yè)出版社.20069. 趙文博.新型常用集成電路速查手冊(cè).人民郵電出版社.200510. .器件搜索資料.紅外線遙控原理 11. .器件搜索資料.紅外遙控器軟件解碼及其應(yīng)用12. .器件搜索資料.AD590數(shù)據(jù)手冊(cè)13. .器件搜索資料.模數(shù)轉(zhuǎn)換器數(shù)據(jù)手冊(cè)15. .器件搜索資料.DS12887時(shí)鐘數(shù)據(jù)手冊(cè)附錄A:英文資料DS12887FEATURES● Drop–in replacement for IBM AT puter clock/calendar● Pinpatible with the MC146818B andDS1287● Totally nonvolatile with over 10 years of operation in the absence of power● Self–contained subsystem includes lithium, quartz, and support circuitry● Counts seconds, minutes, hours, days, day of the week, date, month, and year with leap year pensation valid up to 2100● Binary or BCD representation of time, calendar, and alarm● 12– or 24–hour clock with AM and PM in 12–hour mode● Daylight Savings Time option● Selectable between Motorola and Intel bus timing● Multiplex bus for pin efficiency● Interfaced with software as 128 RAM locations– 14 bytes of clock and control registers– 114 bytes of general purpose RAM● Programmable square wave output signal● Bus–patible interrupt signals ( IRQ )● Three interrupts are separately software–maskable and testable– Time–of–day alarm once/second to once/day– Periodic rates from 122 ms to 500 ms– End of clock update cyclePIN ASSIGNMENTDESCRIPTIONThe DS12887 Real Time Clock plus RAM is designed to be a direct replacement for the DS1287. The DS12887 is identical in form, fit, and function to the DS1287, and has an additional 64 bytes of general purpose RAM. Access to this additional RAM space is determined by the logic level presented on AD6 during the address portion of an access cycle. A lithium energy source, quartz crystal, and write– protection circuitry are contained within a 24–pin dual inline package. As such, the DS12887 is a plete subsystem replacing 16 ponents in a typical application. The functions include a nonvolatile time–of–day clock, an alarm, a onehundred–year calendar, programmable interrupt, square wave generator, and 114 bytes of nonvolatile static RAM. The real time clock is distinctive in that time–of–day and memory are maintained even in the absence of power.OPERATIONThe block diagram in Figure 1 shows the pin connections with the major internal functions of the DS12887. The following paragraphs describe the function of each pin.BLOCK DIAGRAM DS12887 Figure 1POWER–DOWN/POWER–UP CONSIDERATIONSThe Real Time Clock function will continue to operate and all of the RAM, time, calendar, and alarm memory locations remain nonvolatile regardless of the level of the VCC input. When VCC is applied to the DS12887 and reaches a level of greater than volts, the device bees accessible after 200 ms, provided that the oscillator is running and the oscillator countdown chain is not in reset (see Register A). This time period allows the system to stabilize after power is applied. When VCC falls below volts, the chip select input is internally forced to an inactive level regardless of the value of CS at the input pin. The DS12887 is, therefore, write–protected. When the DS12887 is in a write–protected state, all inputs are ignored and all outputs are in a high impedance state. When VCC falls below a level of approximately 3 volts, the external VCC supply is switched off and an internal lithium energy source supplies power to the Real Time Clock and the RAM memory.SIGNAL DESCRIPTIONSGND, VCC – DC power is provided to the device on these pins. VCC is the +5 volt input. When 5 volts are applied within normal limits, the device is fully accessible and data can be written and read. When VCC is below volts typical, reads and writes are inhibited. However, the timekeeping function continues unaffected by the lower input voltage. As VCC falls below 3 volts typical, the RAM and timekeeper are switched over to an internal lithium energy source. The timekeeping function maintains an accuracy of 177。致 謝在我的課題和論文完成之際,謹(jǐn)向在我大學(xué)四年學(xué)習(xí)的過(guò)程中曾經(jīng)指導(dǎo)過(guò)我的老師,關(guān)懷過(guò)我的領(lǐng)導(dǎo),關(guān)心過(guò)我的朋友,及所有幫助過(guò)我的人們致以崇高的敬意和深深的感謝。通過(guò)軟件編程的設(shè)計(jì),使我對(duì)單片機(jī)的編程方法有了很大的提高。這次的畢業(yè)設(shè)計(jì)難度和工作量都比較大,硬件設(shè)計(jì)難度雖然比較小,但軟件編程難度較大。8–9我們是采用顯示器共陽(yáng)極,是以低電平來(lái)驅(qū)動(dòng)顯示的,在程序TABLE中是以反碼的形式列入表中。5.1.1流程圖:開(kāi)始R6←8查表左移A溫度個(gè)位置CP溫度十位溫度符號(hào)位清CP8次到?R7←15 N開(kāi)始顯示時(shí)間 Y返回15次到? N Y返回 圖51 溫度及時(shí)間顯示流程圖5.1.2 程序分析SMSX:MOV R1,SJRQSZ+17 ;顯示一共有18位 MOV A,R1 ;溫度個(gè)位 MOV DPTR,TABLE ;查表 MOVC A,A+DPTR CALL CXSC1 ;顯示 MOV R1,SJRQSZ+16 MOV A,R1 ;溫度十位 MOV DPTR,TABLE MOVC A,A+DPTR CALL CXSC1 MOV R1,SJRQSZ+15 MOV A,R1 ;溫度符號(hào)位 MOV DPTR,TABLE MOVC A,A+DPTR CALL CXSC1 MOV R7,15 ;時(shí)間共15位 MOV DPTR,TABLE MOV R1,SJRQSZ+14 ;開(kāi)始顯示時(shí)間 SMSX1:MOV A,R1 ;從秒個(gè)位開(kāi)始 MOVC A,A+DPTR CALL CXSC1 DEC R1 DJNZ R7,SMSX1 ;循環(huán)15次,直到時(shí)間全顯示完 RET CXSC1:MOV R6,8 CXSC2:RLC A MOV XSDOT,C ;數(shù)據(jù)線 NOP NOP ;軟件抗干擾 SETB XSCP ;置顯示器脈沖 NOP NOP NOP ;軟件抗干擾 CLR XSCP ;清顯示器脈沖 DJNZ R6,CXSC2 ;循環(huán)到 RET TABLE: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H 。光標(biāo) CALL SMSX MOV R7,4 SHZH8:CALL YKQ JNB ,JCHZH6 CJNE A,DSHIJ,JCHZH7 JMP SHZH2 JCHZH7:CJNE A,WEIXJ,SSZ1 JMP SHZH6 SSZ1:CALL SHSHZHA JNB 05H,JCHZH6 ANL A,0FH MOV