【正文】
or hardware reset. 5 In the Counter function, the register is incremented in response to a 1to0 transition at its corresponding external input pin, T2. In this function, the external input is sampled during S5P2 of every machine cycle. When the samples show a high in one cycle and a low in the next cycle, the count is incremented. The new count value appears in the register during S3P1 of the cycle following the one in which the transition was detected. Since two machine cycles (24 oscillator periods) are required to recognize a 1to0 transition, the maximum count rate is 1/24 of the oscillator frequency. To nsure that a given level is sampled at least once before it changes, the level should be held for at least one full machine cycle. Interrupts The AT89C52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These interrupts are all shown in Figure 10. Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which disables all interrupts at once. Note that Table 5 shows that bit position is unimplemented. In the AT89C52, bit position is also unimplemented. User software should not write 1s to these bit positions, since they may be used in future AT89 products. Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register T2CON. Neither of these flags is cleared by hardware when the service routine is vectored to. In fact, the service routine may have to determine whether it was TF2 or EXF2 that generated the interrupt, and that bit will have to be cleared in software. The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers overflow. The values are then polled by the circuitry in the next cycle. However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which the timer overflows. Reference data: 1. the ATMEL pany AT89S52 technical manuals Development Co., Ltd. AT89C52 University Press, singlechip microprocessor theory, application and test ZHANG Youde, etc. 沈陽工程學院畢業(yè)設(shè)計(論文) 6 基于 AT89C52 的 LED 概述 LED( Light Emitting Diode),發(fā)光二極管,是一種固態(tài)的半導(dǎo)體器件,它可以直 接把電轉(zhuǎn)化為光。當電流通過導(dǎo)線作用于這個晶片的時候,電子就會被推向 P 區(qū),在 P 區(qū)里電子跟空穴復(fù)合,然后就會以光子的形式發(fā)出能量,這就是 LED 發(fā)光的原理。 發(fā)光二極管的核心部分是由 P 型半導(dǎo)體和 N 型半導(dǎo)體組成的晶片,在 P 型半導(dǎo)體和 N 型半導(dǎo)體之間有一個過渡層,稱為 PN 結(jié)。 當它處于正向工作狀態(tài)時(即兩端加上正向電壓),電流從 LED 陽極流向陰極時,半導(dǎo)體晶體就發(fā)出從紫外到紅外不同顏色的光線,光的強弱與電流有關(guān)。而在新設(shè)計的燈中,Lumileds 公司采用了 18 個紅色 LED 光源,包括電路損失在內(nèi),共耗電 14 瓦,即可產(chǎn)生同樣的光效。這種 LED是將 GaN 芯片和釔鋁石榴石( YAG)封裝在一起做成?,F(xiàn)在,對于 InGaN/YAG 白色 LED,通過改變 YAG 熒光粉的化學組成和調(diào)節(jié)熒光粉層的厚度,可以獲得色溫 350010000K 的各色白光。經(jīng)過近 30 年的發(fā)展, 7 現(xiàn)在大家十分熟悉的 LED,已能發(fā)出紅、橙、黃、綠、藍等多種色光。 LED 顯示屏顯示 畫面色彩鮮艷,立體感強,靜如油畫,動如電影,廣泛應(yīng)用于金融、稅務(wù)、工商、郵電、體育、廣告、廠礦企業(yè)、交通運輸、教育系統(tǒng)、車站、碼頭、機場、商場、醫(yī)院、賓館、銀行、證券市場、建筑市場、拍賣行、工業(yè)企業(yè)管理和其它公共場所。LED 的發(fā)展前景極為廣闊,目前正朝著更高亮度、更高耐氣候性、更高的發(fā)光密度、更高的發(fā)光均勻性,可靠性、全色化方向發(fā)展。 按顯示器件分類 LED 數(shù)碼顯示屏:顯示器件為 7 段碼數(shù)碼管,適于制作時鐘屏、利率屏等,顯示數(shù)字的電子顯示屏。室外顯示屏:面積一般幾十平方米至幾百平方米,亮度高,可在陽光下工作,具有防風、防雨、防水功能。 、橫向滾動、垂直滾動和翻頁顯示等。二看屏點亮后壞點,在不在不范圍之內(nèi),(一般來說現(xiàn)在的屏基本上沒有了)色差一致性,顯示文字是否正常,顯示屏圖片等,全彩的要全屏打白色,紅,綠,藍。缺點:色彩一致性差,馬賽克現(xiàn)象較嚴重,顯示效果較差。加工較復(fù)雜,抗靜電要求高。片上 Flash 允許程序存儲器在系統(tǒng)可編程,亦適于常規(guī)編程器??臻e模式下, CPU停止工作,允許 RAM、定時器 /計數(shù)器、串口、中斷繼續(xù)工作??撮T狗計時完成后, RST 腳輸出 96 個晶振周期的高電平。在 flash編程時,此引腳( PROG )也用作編程輸入脈沖。這一位置“ 1”, ALE 僅在執(zhí)行 MOVX 或 MOVC 指令時有效。當 AT89S52從外部程序存儲器執(zhí)行外部代碼時, PSEN 在每個機器周期被激活兩次,而在訪問外部數(shù)據(jù)存儲器時, PSEN 將不被激活。在 flash編程期間, EA 也接收 12伏 VPP電壓。外部程序存儲器和數(shù)據(jù)存儲器都可以 64K尋址。這些中斷每個中斷源都可以通過置位或清除特殊寄存器 IE中的相關(guān)中斷允許控制位分別使得中斷源有效或無效。用戶軟件不應(yīng)給這些位寫 1。實際上,中斷服務(wù)程序必須判定是否是 TF2 或 EXF2激活中斷,標志位也必須由軟件清 0。 參考資料: 1. ATMEL公司 AT89C52的技術(shù)手冊 2.深圳市中源單片機發(fā)展有限公司 AT89C52 3.復(fù)旦大學出版社單片微型機原理、應(yīng)用和實驗張友德等