【正文】
脈沖 中斷系統(tǒng)中斷系統(tǒng)是為使CPU具有對(duì)外界緊急事件的實(shí)時(shí)處理能力而設(shè)置的。同時(shí),STC89C52提供有四種復(fù)位方式:外部引腳RST復(fù)位,軟件復(fù)位,掉電/上電復(fù)位,看門狗復(fù)位。當(dāng)直接使用外部時(shí)鐘源時(shí),此引腳是外部時(shí)鐘源的輸入端。GND(20腳):接地端。STC89C52系列單片機(jī)是STC推出的高速、低功耗、強(qiáng)抗干擾的單片機(jī),內(nèi)置8K片內(nèi)存儲(chǔ)器,片上集成1280字節(jié)或512字節(jié)RAM。作為一個(gè)計(jì)算機(jī)發(fā)展的重要分支,單片機(jī)廣泛用于儀器儀表、家用電器、網(wǎng)絡(luò)通信、汽車電子等各種智能化管理和控制領(lǐng)域。為保證磁頭不與盤片接觸,各大廠商都開發(fā)了保護(hù)技術(shù),從原理上來說無非是通過檢測(cè)墜落,在硬盤遇到明顯的加速度和失重的情況下,讓磁頭復(fù)位,從而起到保護(hù)數(shù)據(jù)的作用。Fall sensing。同時(shí),根據(jù)三軸測(cè)量結(jié)果,計(jì)算各方向的傾斜角度,實(shí)現(xiàn)對(duì)系統(tǒng)姿態(tài)的感知。為提高耐用性我們必須能夠可靠的檢測(cè)到“自由落體”墜落,保證硬盤磁頭在碰撞到來前停止工作,從而避免或減輕硬盤可能受到的損壞。ADXL345是一款非常適合移動(dòng)設(shè)備的加速度傳感器,低功耗、高分辨率,可通過SPI或IIC數(shù)字接口訪問數(shù)字輸出數(shù)據(jù)。關(guān)鍵詞: MEMS;ADXL345;單片機(jī);墜落檢測(cè);The Fall sensing System Based on Digital AccelerometerGao Xiang(School of Physics and Electronics, Henan University, Henan Kaifeng 475004, China)Abstract: The space between the read head and disc is so small while hard disk is reading or writing data, the speed is very high in the same time, a little shock may cause considerable damage to the hard disk and destroy data. We must detect Freefall reliable to ensure the read head stop reading or writing data before the shock es, in order to avoid or less damaging,The ADXL345 is a small, thin, ultralow power accelerometer with high resolution, which is well suited for mobile device applications, its digital output data is accessible through erther a SPI or IIC digital measures the static acceleration of gravity and dynamic acceleration resulting from motion or shock. Freefall sensing detects if the device if falling. By the way of check the measurements of acceleration, to judge whether the system is falling down, we can simulate the fall sensing system of hard disk. Similar, paring the acceleration on any axis and calculate the inclination changes, to realize the detection and control of the system.Key words: MEMS。0 前言隨著高保真多媒體內(nèi)容的不斷演進(jìn),大大的改善了我們的視聽體驗(yàn),同時(shí)也帶來巨大的存儲(chǔ)容量需求,高容量硬盤更多的用在便攜式電子設(shè)備中,硬盤驅(qū)動(dòng)器的自我保護(hù)變得至關(guān)重要。單片機(jī)(SingleChip Microcontrollers)是一種集成電路芯片,它不是為了完成某個(gè)邏輯功能的芯片,而是一個(gè)微型的計(jì)算機(jī)系統(tǒng)。本文主要介紹以STC89C52單片機(jī)為核心的加速度傳感器應(yīng)用,利用ADI公司的ADXL345數(shù)字加速度計(jì)測(cè)量加速度,判斷系統(tǒng)的姿態(tài),通過IIC串行總線方式將數(shù)據(jù)傳送給單片機(jī),輔以LCD1602液晶顯示單元將數(shù)據(jù)實(shí)時(shí)顯示出來,通過定時(shí)監(jiān)測(cè)加速度數(shù)據(jù),可以分析系統(tǒng)的傾斜方向、運(yùn)動(dòng)狀態(tài)等信息。STC89C52單片機(jī)包含中央處理器(CPU)、程序儲(chǔ)存器(Flash)、數(shù)據(jù)存儲(chǔ)器(SRAM)、定時(shí)/計(jì)數(shù)器、UART串口、看門狗等,幾乎包含了數(shù)據(jù)采集和控制中所需的所有單元模塊。 和XTAL2XTAL1(19腳):內(nèi)部時(shí)鐘電路反相放大器輸入端,接外部晶振的一個(gè)引腳。 外部晶振電路。 外部引腳RST復(fù)位 輸入/輸出端口P0、PP2和P3P0端口( P0 .0~ P0 .7 , 39~32 腳): P0 口是一個(gè)漏極開路的8 位準(zhǔn)雙向I/ O 端口。當(dāng)CPU 正在處理某件事情的時(shí)候, 外部發(fā)生的某一事件( 如一個(gè)電平的變化、一個(gè)脈沖沿的發(fā)生或定時(shí)器計(jì)數(shù)溢出等) 請(qǐng)求CPU迅速去處理, 于是, CPU 暫時(shí)中止當(dāng)前的工作, 轉(zhuǎn)去處理所發(fā)生的事件。 中斷控制STC89C52中斷系統(tǒng)有四個(gè)特殊功能寄存器:定時(shí)器