【正文】
hardware reset. AT89C52 Timer 2 Timer 2 is a 16bit Timer/Counter that can operate as either a timer or an event counter. The type of operation is selected by bit C/T2 in the SFR T2CON (shown in Table 2). Timer 2 has three operating modes: capture, autoreload (up or down counting), and baud rate generator. The modes are selected by bits in T2CON, as shown in Table 3. Timer 2 consists of two 8bit registers, TH2 and TL2. In the Timer function, the TL2 register is incremented every machine cycle. Since a 6 machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency. 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 ensure that a given level is sampled at least once before it changes, the level should be held for at least one full machine cycle. Capture Mode In the capture mode, two options are selected by bit EXEN2 in T2CON. If EXEN2 = 0, Timer 2 is a 16bit timer or counter which upon overflow sets bit TF2 in T2CON. This bit can then be used to generate an interrupt. If EXEN2 = 1, Timer 2 performs the same operation, but a 1 to0 transition at external input T2EX also causes the current value in TH2 and TL2 to be captured into RCAP2H and RCAP2L, respectively. In addition, the transition at T2EX causes bit EXF2 in T2CON to be set. The EXF2 bit, like TF2, can generate an interrupt. The capture mode is illustrated in Figure Autoreload (Up or Down Counter) Timer 2 can be programmed to count up or down when configured in its 16bit autoreload mode. This feature is invoked by the DCEN (Down Counter Enable) bit located in the SFR T2MOD. Upon reset, the DCEN bit is set to 0 so that timer 2 will default to count up. When DCEN is set, Timer 2 can count up or down, depending on the value of the T2EX pin. Baud Rate Generator Timer 2 is selected as the baud rate generator by setting TCLK and/or RCLK in T2CON. Note that the baud rates for transmit and receive can be different if Timer 2 is used for the receiver or transmitter and Timer 1 is used for the other function. Setting RCLK and/or TCLK puts Timer 2 into its baud rate generator mode. The baud rate generator mode is similar to the autoreload mode, in that a rollover in TH2 causes the Timer 2 registers to be reloaded with the 16bit value in registers RCAP2H and RCAP2L, which are preset by software. The baud rates in Modes 1 and 3 are determined by Timer 2’s overflow rate according to the following equation. The Timer can be configured for either timer or counter operation. In most applications, it is configured for timer operation (CP/T2 = 0). The timer operation is different for Timer 2 when it is used as a baud rate generator. Normally, as a timer, it increments every machine cycle (at 1/12 the oscillator frequency). As a baud rate generator, however, it increments every state time (at 1/2 the oscillator frequency). The baud rate formula is given below. where (RCAP2H, RCAP2L) is the content of RCAP2H and RCAP2L taken as a 16bit unsigned integer. Timer 2 as a baud rate generator is shown in Figure 4. This figure is valid only if RCLK or TCLK = 1 in T2CON. Note that a rollover in TH2 does not set TF2 and will not 7 generate an interrupt. Note too, that if EXEN2 is set, a 1to0 transition in T2EX will set EXF2 but will not cause a reload from (RCAP2H, RCAP2L) to (TH2, TL2). Thus when Timer 2 is in use as a baud rate generator, T2EX can be used as an extra external interrupt. Note that when Timer 2 is running (TR2 = 1) as a timer in the baud rate generator mode, TH2 or TL2 should not be read from or written to. Under these conditions, the Timer is incremented every state time, and the results of a read or write may not be accurate. The RCAP2 registers may be read but should not be written to, because a write might overlap a reload and cause write and/or reload errors. The timer should be turned off (clear TR2) before accessing the Timer 2 or RCAP2 registers. 中 文 隨著電視技術(shù)的發(fā)展和閉路電視監(jiān)控系統(tǒng)要求的提高,閉路電視監(jiān)控系統(tǒng)迅速成長起來。閉路電視監(jiān)控系統(tǒng)已經(jīng)成為現(xiàn)代建筑不可缺少的一部分。閉路電視監(jiān)控系統(tǒng)(又稱 CCTV)是安防領(lǐng)域中的重要組成部分,是所有安全系統(tǒng)中最關(guān)鍵的子系統(tǒng)。系統(tǒng)通過遙控?cái)z像機(jī)及其輔助設(shè)備(鏡頭、云臺(tái)等),直接觀察被監(jiān)視場所的情況,同時(shí)可以把被監(jiān)視場所的情況進(jìn)行同步錄象。另外,電視監(jiān)控系統(tǒng)還可以,與防盜報(bào)警系統(tǒng)等其它安全技術(shù)防范體系聯(lián)動(dòng)運(yùn)行,使用戶安全防范能力得到整體的提高。 閉路監(jiān)控系統(tǒng)能在人無法直接觀察的場合,適時(shí)、圖象、真實(shí)地 反映被監(jiān)視控制對(duì)象的畫面。閉路監(jiān)控系統(tǒng)已成為廣大用戶,在現(xiàn)代化管理中監(jiān)控的最為有效的觀察工具和管理工具。在控制中心,只要一個(gè)工作人員的操作,就能夠觀察多個(gè)被控區(qū)域,以及遠(yuǎn)距離區(qū)域的監(jiān)控功能,這就是監(jiān)控系統(tǒng)在現(xiàn)代建筑中起獨(dú)特作用和被廣泛應(yīng)用的重要原因。 目前,國內(nèi)廣泛使用的閉路監(jiān)控系統(tǒng)大多為模擬監(jiān)控系統(tǒng),其主要特點(diǎn)是:采用矩陣主機(jī)控制,通過電視墻監(jiān)視前端目標(biāo),采用長延時(shí)模擬錄像機(jī)進(jìn)行錄像和回放;其主要缺點(diǎn)是:當(dāng)錄像資料需要長時(shí)間備份時(shí),需要大量的錄像帶,消耗大量的人力和物力,并且在錄像回放、檢索時(shí)操作不方 便。 經(jīng)過幾年的發(fā)展,基于數(shù)字存儲(chǔ)技術(shù)的硬盤錄像系統(tǒng)至今技術(shù)已經(jīng)完全成熟,很好地解決了傳統(tǒng)圖像存儲(chǔ)及回放等技術(shù)難題。數(shù)字硬盤錄像系統(tǒng)不僅存儲(chǔ)費(fèi)用低、效率高,而且還具有網(wǎng)絡(luò)傳輸、遠(yuǎn)程傳輸和循環(huán)存儲(chǔ)等優(yōu)點(diǎn)。與此同時(shí),硬盤錄像系統(tǒng)的數(shù)字化和傳輸網(wǎng)絡(luò)化等先進(jìn)技術(shù)可以實(shí)現(xiàn)與防盜報(bào)警等系統(tǒng)聯(lián)網(wǎng)聯(lián)動(dòng),及時(shí)準(zhǔn)確地反饋現(xiàn)場信息,為報(bào)警事件提供充分可靠