2023年全國碩士研究生考試考研英語一試題真題(含答案詳解+作文范文)_第1頁
已閱讀1頁,還剩9頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、<p><b>  中文2560字</b></p><p>  DS1302 trickle charge timekeeping chip</p><p>  Abstract: Introduces the United States with DALLAS trickle charge current capacity of small low-pow

2、er real time clock DS1302 circuit structure, working principle and its application in real-time display of application time. It can be years, months, days, weekdays, hours, minutes, seconds for time, and has multiple fun

3、ctions, such as a leap year compensation. DS1302 are given in the C51 to read and write procedures and flow chart, as well as in the process of debugging note. </p><p>  Keywords: clock circuit; real-time cl

4、ock; singlechip; Application</p><p>  1 Introduction </p><p>  Now popular in many of the serial clock circuit, such as the DS1302, DS1307, PCF8485, etc.. These circuits interface is simple, in

5、expensive and easy to use, has been widely used. This paper introduces the DS1302 real time clock circuit is DALLAS's a small trickle charge current of the circuit capacity, the main feature is the use of serial data

6、 transmission, can provide programmable power-down protection functions of charge and can be shut down charging functions . 32.768kHz crystal ordinary.</p><p>  2 DS1302's structure and working principl

7、e </p><p>  DALLAS companies DS1302 is the United States launched a high-performance, low power consumption, with real-time clock circuit of the RAM, it can be years, months, days, weekdays, hours, minutes,

8、seconds for time, with leap year compensation, the working voltage to 2.5V ~ 5.5V. The use of three-wire interface for synchronous communication with the CPU, and the use of unexpected ways to send more than one byte of

9、data clock signal, or RAM. DS1302 within a 31 × 8 for the temporary storage of the RA</p><p><b>  FEATURES</b></p><p>  1 Real-Time Clock Counts Seconds, Minutes, Hours, Date of

10、 the Month, Month, Day of the Week, and Year with Leap-Year Compensation Valid Up to 2100</p><p>  2 31 x 8 Battery-Backed General-Purpose RAM</p><p>  3 Serial I/O for Minimum Pin Count</p&g

11、t;<p>  3 2.0V to 5.5V Full Operation</p><p>  4 Uses Less than 300nA at 2.0V</p><p>  5 Single-Byte or Multiple-Byte (Burst Mode) Data Transfer for Read or Write of Clock or RAM Data<

12、/p><p>  6 8-Pin DIP or Optional 8-Pin SO for Surface Mount</p><p>  7 Simple 3-Wire Interface</p><p>  8 TTL-Compatible (VCC = 5V)</p><p>  9 Optional Industrial Temperat

13、ure Range: -40°C to +85°C</p><p>  2.1 Pin function and structure </p><p>  PIN DESCRIPTION</p><p>  X1, X2 – 32.768 kHz Crystal Pins</p><p>  GND – Ground<

14、;/p><p>  RST – Reset</p><p>  I/O – Data Input/Output</p><p>  SCLK – Serial Clock</p><p>  VCC1, VCC2 – Power Supply Pins </p><p>  Figure 1 showing a pin o

15、f the DS1302, which Vcc1 for back-up power supply, VCC2-based power. In the main power off, the clock is also able to maintain continuous operation. Vcc2 by the DS1302 or whichever Vcc1 the greater power. When Vcc2 than

16、Vcc1 +0.2 V when, Vcc2 power supply to the DS1302. When Vcc1 less than Vcc2 when, DS1302 powered by Vcc1. X1 and X2 is the source of oscillation, an external 32.768kHz crystal. RST is the reset / chip select lines, throu

17、gh the RST input high drive home to </p><p>  2.2 DS1302 control byte </p><p>  DS1302 control word as shown in Figure 2. Control byte MSB (bit 7) must be logic 1, if it is 0, are not able to wr

18、ite data in the DS1302, bit 6 if 0, then the calendar clock and data access, that access to RAM to 1 data; bit 5 to bit 1 of the address unit instructions; least significant bit (bit 0) in the case of 0 to write to, read

19、 to 1, said operation, the control byte is always the beginning of the output from the lowest bit. </p><p>  2.3 Data input and output (I / O) </p><p>  Instruction word in the control input of

20、the next clock rising edge of SCLK, the data is written into the DS1302, data input from the low enthronement 0. Similarly, in the following 8-bit instruction word control after the next falling edge of SCLK pulse to rea

21、d out the DS1302 data,read the data from 0 to 7 . </p><p>  2.4 DS1302 register </p><p>  DS1302 there are 12 registers, which register with the seven calendar, clock related data stored in digi

22、tal form as a BCD code, the calendar and time registers and control words in Table 1.</p><p>  In addition, DS1302 year also register, control register, the charge register, the clock register and emergency-

23、related registers, such as RAM. Clock burst read and write registers in addition to the order of one-time charge outside the register contents of all registers. DS1302 registers associated with the RAM is divided into tw

24、o types: one is a single RAM unit, a total of 31, each module configuration for an 8-bit bytes, the command control words C0H ~ FDH, in which odd-numbered for the read </p><p>  3 DS1302 real-time display o

25、f time hardware and software </p><p>  DS1302 connection with the CPU needs three lines, namely, SCLK (7), I / O (6), RST (5). </p><p>  3.1 DS1302 connection with the CPU </p><p> 

26、 In fact, in the debugger when the capacitor can not only add to a 32.768kHz crystal. Only when the choice of crystal, different crystal, error as well. In addition, the circuit can be added to the above DS18B20, at the

27、same time show the real-time temperature. CPU as long as the occupation of a line I can. LCD can be replaced with LED, can also use the letter Wei Jie Beijing Science and Technology Development Co., Ltd. produced 10 mult

28、i-purpose 8 LCD Module LCM101, containing watchdog (WDT) / cl</p><p>  3.2 DS1302 real-time flow of time </p><p>  Single-byte read and single-byte write</p><p>  DS1302 data exchan

29、ge with the microprocessor, the first microprocessor to the circuit by sending the command byte, command byte highest MSB (D7) must be a logic 1, if D7 = 0, then the prohibition of writing DS1302, that is write-protected

30、; D6 = 0, the designated clock and data, D6 = 1, designated RAM data; D5 ~ D1 designated a specific input or output register; lowest LSB (D0) to logic 0, the specified write operation (input), D0 = 1, the designated time

31、 operations (output). </p><p>  Calendar clock in the DS1302 or RAM for data transmission, DS1302 must first send a command byte. If a single byte transmission, 8-bit command byte sent after the end of the n

32、ext two cycles of rising edge of SCLK input data byte, or 8 the next falling edge of SCLK cycle, the output data bytes. </p><p>  DS1302 registers associated with the RAM is divided into two types: one is a

33、single RAM unit, a total of 31, each module configuration for an 8-bit bytes, the command control words C0H ~ FDH, in which odd-numbered for the read operation, even for the write operation; and then a class for the sudd

34、en manner of RAM register in this manner can be a one-time reading, writing all 31 bytes of RAM. </p><p>  Special note is the back-up power supply B1, can use batteries or super capacitors (0.1F and above).

35、 Although the DS1302 in the main power after the power down very small, but if the clock to ensure the normal time, the best selection of small rechargeable batteries. Can be used on the old computer motherboard 3.6V rec

36、hargeable batteries. If a shorter time off (hours or days), the leakage can be used on a smaller electrolytic capacitors instead of the ordinary. 100 μF to 1 hour to ensure the nor</p><p>  4 Conclusion <

37、;/p><p>  The existence of DS1302 clock accuracy is not high, the vulnerability of the environmental impact of the shortcomings of the chaos emerged clock. DS1302 can be used for data recording, in particular,

38、is of special significance for some of the data points of the record data and time to which the data recorded at the same time. This record of long-term results of continuous monitoring and control system analysis and da

39、ta on the causes abnormal finding of great significance. Traditional data record</p><p>  DS1302涓流充電計時芯片</p><p>  摘要:介紹美國DALLAS公司推出的具有涓細(xì)電流充電能力的低功耗實時時鐘電路DS1302的結(jié)構(gòu)、工作原理及其在實時顯示時間中的應(yīng)用。它可以對年、月、日、周日、時

40、、分、秒進(jìn)行計時,且具有閏年補(bǔ)償?shù)榷喾N功能。給出DS1302在讀寫中的C51程序及流程圖,以及在調(diào)試過程中的注意事項。 </p><p>  關(guān)鍵詞:時鐘電路;實時時鐘;單片機(jī);應(yīng)用</p><p><b>  1 引言 </b></p><p>  現(xiàn)在流行的串行時鐘電路很多,如DS1302、 DS1307、PCF8485等。這些電路的接口簡

41、單、價格低廉、使用方便,被廣泛地采用。本文介紹的實時時鐘電路DS1302是DALLAS公司的一種具有涓細(xì)電流充電能力的電路,主要特點(diǎn)是采用串行數(shù)據(jù)傳輸,可為掉電保護(hù)電源提供可編程的充電功能,并且可以關(guān)閉充電功能。采用普通32.768kHz晶振。 </p><p>  2 DS1302的結(jié)構(gòu)及工作原理 </p><p>  DS1302 是美國DALLAS公司推出的一種高性能、低功耗、帶R

42、AM的實時時鐘電路,它可以對年、月、日、周日、時、分、秒進(jìn)行計時,具有閏年補(bǔ)償功能,工作電壓為2.5V~5.5V。采用三線接口與CPU進(jìn)行同步通信,并可采用突發(fā)方式一次傳送多個字節(jié)的時鐘信號或RAM數(shù)據(jù)。DS1302內(nèi)部有一個31×8的用于臨時性存放數(shù)據(jù)的RAM寄存器。DS1302是DS1202的升級產(chǎn)品,與DS1202兼容,但增加了主電源/后背電源雙電源引腳,同時提供了對后背電源進(jìn)行涓細(xì)電流充電的能力。</p>

43、<p><b>  特性</b></p><p>  實時時鐘具有能計算2100 年之前的秒分時日日期星期月年的能力還有閏年調(diào)整的能力</p><p>  31 8 位暫存數(shù)據(jù)存儲RAM</p><p>  串行 I/O 口方式使得管腳數(shù)量最少</p><p>  寬范圍工作電壓2.0 5.5V</p&

44、gt;<p>  工作電流 2.0V 時,小于300nA</p><p>  讀/寫時鐘或RAM 數(shù)據(jù)時有兩種傳送方式單字節(jié)傳送和多字節(jié)傳送字符組方式</p><p>  8 腳DIP 封裝或可選的8 腳SOIC 封裝根據(jù)表面裝配</p><p>  簡單 3 線接口與 TTL 兼容Vcc=5V</p><p>  可選工業(yè)級溫

45、度范圍-40 +85</p><p>  與 DS1202 兼容</p><p>  2.1 引腳功能及結(jié)構(gòu) </p><p><b>  圖一</b></p><p><b>  管腳描述</b></p><p>  X1 X2 32.768KHz 晶振管腳</p&g

46、t;<p><b>  GND 地</b></p><p><b>  RST 復(fù)位腳</b></p><p>  I/O 數(shù)據(jù)輸入/輸出引腳</p><p><b>  SCLK 串行時鐘</b></p><p>  Vcc1,Vcc2 電源供電管腳</p

47、><p>  圖1示出DS1302的引腳排列,其中Vcc1為后備電源,VCC2為主電源。在主電源關(guān)閉的情況下,也能保持時鐘的連續(xù)運(yùn)行。DS1302由Vcc1或Vcc2兩者中的較大者供電。當(dāng)Vcc2大于Vcc1+0.2V時,Vcc2給DS1302供電。當(dāng)Vcc2小于Vcc1時,DS1302由Vcc1供電。X1和X2是振蕩源,外接32.768kHz晶振。RST是復(fù)位/片選線,通過把RST輸入驅(qū)動置高電平來啟動所有的數(shù)據(jù)傳

48、送。RST輸入有兩種功能:首先,RST接通控制邏輯,允許地址/命令序列送入移位寄存器;其次,RST提供終止單字節(jié)或多字節(jié)數(shù)據(jù)的傳送手段。當(dāng)RST為高電平時,所有的數(shù)據(jù)傳送被初始化,允許對DS1302進(jìn)行操作。如果在傳送過程中RST置為低電平,則會終止此次數(shù)據(jù)傳送,I/O引腳變?yōu)楦咦钁B(tài)。上電運(yùn)行時,在Vcc≥2.5V之前,RST必須保持低電平。只有在SCLK為低電平時,才能將RST置為高電平。I/O為串行數(shù)據(jù)輸入輸出端(雙向),后面有詳細(xì)

49、說明。SCLK始終是輸入端。</p><p>  2.2 DS1302的控制字節(jié)</p><p>  DS1302 的控制字如圖所示。控制字節(jié)的最高有效位(位7)必須是邏輯1,如果它為0,則不能把數(shù)據(jù)寫入DS1302中,位6如果為0,則表示存取日歷時鐘數(shù)據(jù),為1表示存取RAM數(shù)據(jù);位5至位1指示操作單元的地址;最低有效位(位0)如為0表示要進(jìn)行寫操作,為1表示進(jìn)行讀操作,控制字節(jié)總是從最低

50、位開始輸出。 </p><p>  2.3 數(shù)據(jù)輸入輸出(I/O) </p><p>  在控制指令字輸入后的下一個SCLK時鐘的上升沿時,數(shù)據(jù)被寫入DS1302,數(shù)據(jù)輸入從低位即位0開始。同樣,在緊跟8位的控制指令字后的下一個SCLK脈沖的下降沿讀出DS1302的數(shù)據(jù),讀出數(shù)據(jù)時從低位0位到高位7。 </p><p>  2.4 DS1302的寄存器 </p

51、><p>  DS1302有12個寄存器,其中有7個寄存器與日歷、時鐘相關(guān)。 </p><p>  此外,DS1302 還有年份寄存器、控制寄存器、充電寄存器、時鐘突發(fā)寄存器及與RAM相關(guān)的寄存器等。時鐘突發(fā)寄存器可一次性順序讀寫除充電寄存器外的所有寄存器內(nèi)容。 DS1302與RAM相關(guān)的寄存器分為兩類:一類是單個RAM單元,共31個,每個單元組態(tài)為一個8位的字節(jié),其命令控制字為C0H~FDH

52、,其中奇數(shù)為讀操作,偶數(shù)為寫操作;另一類為突發(fā)方式下的RAM寄存器,此方式下可一次性讀寫所有的RAM的31個字節(jié),命令控制字為FEH(寫)、FFH(讀)。 </p><p>  3 DS1302實時顯示時間的軟硬件 </p><p>  DS1302與CPU的連接需要三條線,即SCLK(7)、I/O(6)、RST(5)。 </p><p>  3.1 DS1302

53、與CPU的連接 </p><p>  實際上,在調(diào)試程序時可以不加電容器,只加一個32.768kHz 的晶振即可。只是選擇晶振時,不同的晶振,誤差也較大。另外,還可以在上面的電路中加入DS18B20,同時顯示實時溫度。只要占用CPU一個口線即可。 LCD還可以換成LED,還可以使用北京衛(wèi)信杰科技發(fā)展有限公司生產(chǎn)的10位多功能8段液晶顯示模塊LCM101,內(nèi)含看門狗(WDT)/時鐘發(fā)生器及兩種頻率的蜂鳴器驅(qū)動電路,

54、并有內(nèi)置顯示RAM,可顯示任意字段筆劃,具有3-4線串行接口,可與任何單片機(jī)、IC接口。功耗低,顯示狀態(tài)時電流為2μA (典型值),省電模式時小于1μA,工作電壓為2.4V~3.3V,顯示清晰。 </p><p>  3.2 DS1302實時時間流程 </p><p>  單字節(jié)讀和寫的時序波形圖如下:</p><p>  DS1302 與微處理器進(jìn)行數(shù)據(jù)交換時,首

55、先由微處理器向電路發(fā)送命令字節(jié),命令字節(jié)最高位MSB(D7)必須為邏輯1,如果D7=0,則禁止寫DS1302,即寫保護(hù);D6=0,指定時鐘數(shù)據(jù),D6=1,指定RAM數(shù)據(jù);D5~D1指定輸入或輸出的特定寄存器;最低位LSB(D0)為邏輯0,指定寫操作(輸入), D0=1,指定讀操作(輸出)。 </p><p>  在DS1302的時鐘日歷或RAM進(jìn)行數(shù)據(jù)傳送時,DS1302必須首先發(fā)送命令字節(jié)。若進(jìn)行單字節(jié)傳送,8

56、位命令字節(jié)傳送結(jié)束之后,在下2個SCLK周期的上升沿輸入數(shù)據(jù)字節(jié),或在下8個SCLK周期的下降沿輸出數(shù)據(jù)字節(jié)。 </p><p>  DS1302與RAM相關(guān)的寄存器分為兩類:一類是單個RAM單元,共31個,每個單元組態(tài)為一個8位的字節(jié),其命令控制字為C0H~FDH,其中奇數(shù)為讀操作,偶數(shù)為寫操作;再一類為突發(fā)方式下的RAM寄存器,在此方式下可一次性讀、寫所有的RAM的31個字節(jié)。 </p><

57、;p>  要特別說明的是備用電源B1,可以用電池或者超級電容器(0.1F以上)。雖然DS1302在主電源掉電后的耗電很小,但是,如果要長時間保證時鐘正常,最好選用小型充電電池??梢杂美鲜诫娔X主板上的3.6V充電電池。如果斷電時間較短(幾小時或幾天)時,就可以用漏電較小的普通電解電容器代替。100 μF就可以保證1小時的正常走時。DS1302在第一次加電后,必須進(jìn)行初始化操作。初始化后就可以按正常方法調(diào)整時間。 </p>

58、<p><b>  4 結(jié)論 </b></p><p>  DS1302 存在時鐘精度不高,易受環(huán)境影響,出現(xiàn)時鐘混亂等缺點(diǎn)。DS1302可以用于數(shù)據(jù)記錄,特別是對某些具有特殊意義的數(shù)據(jù)點(diǎn)的記錄,能實現(xiàn)數(shù)據(jù)與出現(xiàn)該數(shù)據(jù)的時間同時記錄。這種記錄對長時間的連續(xù)測控系統(tǒng)結(jié)果的分析及對異常數(shù)據(jù)出現(xiàn)的原因的查找具有重要意義。傳統(tǒng)的數(shù)據(jù)記錄方式是隔時采樣或定時采樣,沒有具體的時間記錄,因此

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論