575801 五、發明說明(l) 關於一種即時時鐘(Real Tirae Ciock, 名士果,^進:·,特別是有關於利用頻率計數器所測量之 末抆準振盪器產生之即時時鐘的方法。 (Crys:=子统中之即時時鐘’大多係以晶體振盪器 I而,由〇r)配合R-c電路為主要之構成元件。 鐘也會受到連帶影響,而失去其準確性在=中:二1 i ^ !11 ^ ^cserver system) ^ ^ ^ ^ t 要廣播(br0adcast)日期資訊的時間給用戶 或巧於電腦系統而言,所執行之應 曰期資訊之精確時間,若是苴系 才式』此而要 動Γ統之整體效能將會大打; ::無法動作。因此,實在有必要針對即時 = 有效之杈準方法,以確保即時時鐘之精準度。 有鏗於此’本發明的主要目 (Rea"— ClQck,RTC)之 ;^1出:種即時時鐘 所量測的振盈器之振盪頻率來校準振頻率計數器 鐘,以確保即時時鐘之精準度技丰振盛’產生之即時時 法,種校準即時時鐘之* :=:接著,根據量測頻率計算對應:之里—振誤盪/之-量 將决差時間存到-非揮性記憶體内 =差¥間。再 間從非揮性記憶體内取出誤差時間並利用誤 第4頁 參 0685-8802TWF(n); ELLEN.ptd 575801575801 V. Description of the invention (l) Regarding a real-time clock (Real Tirae Ciock, Baishiguo, Jinjin: ·, in particular, there is a method for using a real-time clock generated by a quasi-oscillator measured by a frequency counter.) Most of the real-time clocks in the sub-system are based on the crystal oscillator I, which is mainly composed of 0r) and Rc circuits. The clock will also be affected by it and lose its accuracy. In the middle: 2 1 ^ ! 11 ^ ^ cserver system) ^ ^ ^ ^ t To broadcast (br0adcast) the time of the date information to the user or coincidentally with the computer system, the precise time of the scheduled information should be executed, if it is not a talented person. The overall effectiveness of the Γ system will be greatly affected; :: Cannot act. Therefore, it is necessary to target the real-time = effective method to ensure the accuracy of the real-time clock. For this reason, the main purpose of the present invention (Rea "-ClQck, RTC) is ^ 1: a kind of oscillator frequency measured by a real-time clock to calibrate the oscillation frequency counter clock to ensure the accuracy of the real-time clock The real-time method of the generation of "Dongji Fengzhensheng", a kind of calibrated real-time clock *: =: Then, calculate the corresponding according to the measurement frequency: 里-oscillates / /-the amount of time is stored in the non-volatile In-memory = difference ¥ between. Then take out the error time from the non-volatile memory and use the error page 4 See 0685-8802TWF (n); ELLEN.ptd 575801
時時鐘。 為了讓本發明之上 明顯易懂,下文特舉一 詳細說明如下: 實施例 述和其他目 較佳實施例 的、特徵、和優點能更 ’並配合所附圖示,作 第1圖係表示本發明的 施例之流程圖。本發明用以又於卩日、、時鐘之方法的第一貪 (Real Time Ci〇ck,RTC),^弈振盪器產生之即時時鐘 盪器之量測頻率步驟Sl01 ;利】;率量振 欲產生沒有誤差之即時時鐘時妾者,,计异該振盪器 Fnonnal以及一天的總秒數Ts d (步驟^的正常振盪頻率 32.768 kHz的振盪器來產時驟),-般:振盪頻率 ^【…^,而一天二二^所以正常振盈頻率 # X 、县此古。 的總秒數為86400秒。再根攄 該正常振盪頻率Fn_al、一天的婢 u胃 F_ure計算對應之誤差時間T (步,驟㈣以及量測頻率 $塞H士 盔—工曰士』士以步驟Sl〇3),在此實施例中 决差日守間Te為母一天即日才時鐘誤差的秒數,其中Hour clock. In order to make the present invention obvious and easy to understand, a detailed description is given below as follows: The description of the embodiments and other preferred embodiments of the present invention can be further characterized, and the features, and advantages can be further improved. A flowchart of an embodiment of the present invention. The present invention uses the real time clock (RTC) method of the next day, clock method to measure the frequency of the real-time clock oscillator generated by the game oscillator, step S01; To generate a real-time clock without error, consider the oscillator Fnonnal and the total number of seconds Ts d in a day (the normal oscillation frequency of step ^ is 32.768 kHz to produce the time),-General: Oscillation frequency ^ [… ^, And one day two two ^ so the normal vibration surplus frequency # X, the county is ancient. The total number of seconds is 86400 seconds. Then, based on the normal oscillation frequency Fn_al and the stomach stomach F_ure for one day, calculate the corresponding error time T (step, step, and measurement frequency $ plug H, helmet-worker), and take step S103. Here, In the embodiment, the difference between the day and the day Te is the number of seconds of the clock error between the mother and the day, where
Te = U-Fmeasure/F_al) X Ts_day。接著,將時 記憶體内(步驟S1 04)。最後,备陪 左才门L仔勾陝閃 出誤差時間並利用誤差時間校;Te = U-Fmeasure / F_al) X Ts_day. Next, the time is stored in the body (step S104). In the end, prepare to accompany Zuo Caimen L Tsai and Shaanxi to show the error time and use the error time to correct it;
仅+即時時鐘(步驟S1 05),裹 例而言,當測量振盪器之量測頻率F A 時,誤差時間Te為5· 2734375秒,即二· 2 5.2734375秒’但因為數位電路處:表味二母一天將快 及處理具有過高精確度的數字,所以時二限/:,無法儲# (5. 2734375)儲入快閃記憶體内,所以、叮法/也接將此值 Π 所以可在快閃記憶體内 575801 五、發明說明(3) 設定於每天減掉5秒,以改善每曰 3日多減一秒即減掉6秒,以校準 块差,並於母隔 述精確度不足的問題。 、t、’里並微調以解決上 要注意的是,在本發明 例儲存誤差時間,但本發明亦可用i ^快閃記憶體為 誤差時間。 匕非揮性記憶體儲存 第2圖係表示本發明的校準即 施例之流程圖。本發明用以校之^法的第一只 ίΏ Ί τ - ρι 仅+振盧益產生之即時時鐘 (Real Time Clock,RTC),首先,刹田相方 L ▲ 盪之量測楣產F 利用頻率計數器測量振 " 、羊measure ( ν驟以01)。接著,計算該赛湯哭 欲產生沒有誤差之即時時鐘時ϋ二,羞盗 P ^ 〇 ^ ^ _ 士 丁尸吓而要的正常振盪頻率 nonnai並且叹疋預没時間的秒數Ts (步驟S2 一 頻率32.768山的«器來產生即時時鐘,所以 頻率Fn则al為32. 76 8 kHz 〇再根據該正常振盪頻率卩又 =^間的秒以及量測頻率F—計算對應之誤^時 二\步,2〇3),在此實施例中誤差時❿為在預設時^ 内即日守日守鐘誤差的秒數,其中T = ( 1Only + real-time clock (step S1 05). For example, when measuring the measuring frequency FA of the oscillator, the error time Te is 5 · 2734375 seconds, which is 2.2 · 5.2734375 seconds'. But because the digital circuit is: The second mother will quickly process numbers with high accuracy in one day, so the time limit / :, cannot store # (5. 2734375) stored in flash memory, so, Ding method / also connect this value Π so It can be stored in flash memory 575801. 5. Description of the invention (3) Set to reduce 5 seconds every day to improve that by subtracting one second every 3 days, or 6 seconds, to calibrate the block difference, and accurately describe the difference in the mother. The problem of insufficient degree. , T, and ′ are fine-tuned to solve the problem. It should be noted that the error time is stored in the example of the present invention, but the present invention can also use the flash memory as the error time. Nonvolatile Memory Storage FIG. 2 is a flowchart showing a calibration example of the present invention. The first Ώ Ί τ-ρ only + Real Time Clock (RTC) generated by Zhenlu Yi in the method of the present invention. First of all, measure the production frequency of the production phase F ▲ The counter measures vibration, and the sheep measure (v step to 01). Next, calculate the time when the Sai Tang cries to produce an instant clock without error, the normal oscillating frequency nonnai that the shy corpse P ^ 〇 ^ ^ _ is scared and the number of seconds Ts sighed (step S2 A frequency of 32.768 is used to generate a real-time clock, so the frequency Fn is 32. 76 8 kHz. 〇 Then according to the normal oscillation frequency 卩 = seconds between ^ and the measurement frequency F-calculate the corresponding error ^ Hour 2 \ Step, 2〇3), in this embodiment, the error time ❿ is the number of seconds of the day-to-day clock error within the preset time ^, where T = (1
Ts—day。接者,將誤差時間Te存到快閃記憶體内(步驟 S204)。最後,每隔該預設時間從快閃記憶體内取出誤差 ,間並利用誤差時間校準即時時鐘(步驟S2〇5),舉例而 吕,當測量振盪器之量測頻率Fme_re為32· 77〇 kHz時,若 預設時間為四天,誤差時間Te則為21〇9375秒,即表示每 四天將快2 1 · 0 9 3 7 5秒,但因為數位電路處理時的限制,無 法儲存及處理具有過高精確度的數字,所以無法直接將&Ts_day. Then, the error time Te is stored in the flash memory (step S204). Finally, the error is taken out of the flash memory at the preset time, and the real-time clock is calibrated with the error time (step S205). For example, when the measurement frequency Fme_re of the measurement oscillator is 32.77. At kHz, if the preset time is four days, the error time Te is 21019375 seconds, which means that it will be 2 1 · 0 9 3 7 5 seconds every four days, but due to the limitation of digital circuit processing, it cannot be stored and Handling numbers with too high a precision, so you cannot directly &
〇685.8802TWF(n); ELLEN.ptd 第6頁 五、發明說明(4) 值(21. 09375)儲入快閃記憶體内 設…四天減掉21秒,以改善每四天記憶體内 以解決上,精確度不足的問題。 旱即時時鐘並微調 要注意的是,在本發明之實施例 例儲存誤差時間,但本發明亦 二:閃記憶體為 誤差時間。 八匕非揮性記憶體儲存 根本以上所述,本發明所揭露之 Clock, , 盪為之振盈頻率來校準振盪器產生之即時里遠 到本發明確保即時時鐘之精準度的目的。、,α b 了達 雖然本發明已以較佳實施例揭露如上,鈇Α f 和範圍内,當可作: = ’在不脫離本發明之精神 範圍當視後附之申2之更動與潤飾’因此本發明之保護 田錢之甲4專利範圍所界定者為準。 0685-8802TWF(η); ELLEN.ptd 第7頁 575801 圖式簡單說明 第1圖係表示本發明的校準即時時鐘之方法的第一實 施例之流程圖。 第2圖係表示本發明的校準即時時鐘之方法的第二實 施例之流程圖。 0685-8802TWF(n); ELLEN.ptd 第8頁 1111«〇685.8802TWF (n); ELLEN.ptd Page 6 V. Description of the invention (4) The value (21. 09375) is stored in the flash memory device ... 21 seconds are subtracted in four days to improve the memory in every four days To solve the problem of insufficient accuracy. It is important to note that the error time is stored in the embodiment of the present invention, but the present invention also has two: the flash memory is the error time. Eight dagger non-volatile memory storage Basically, the clock, disclosed in the present invention, oscillates to a frequency that oscillates to oscillate the instantaneous distance generated by the oscillator to the purpose of the present invention to ensure the accuracy of the real-time clock. Although the present invention has been disclosed in a preferred embodiment as described above, within the range of ΔΑ f and the range, it can be done as follows: = 'Without departing from the spirit and scope of the present invention, the changes and decorations of the attached application 2 should be regarded as 'Therefore, the scope of the patent for protecting Tian Qian's A4 patent of the present invention shall prevail. 0685-8802TWF (η); ELLEN.ptd Page 7 575801 Brief Description of Drawings Figure 1 is a flowchart showing the first embodiment of the method for calibrating a real-time clock according to the present invention. Fig. 2 is a flowchart showing a second embodiment of the method for calibrating a real-time clock according to the present invention. 0685-8802TWF (n); ELLEN.ptd page 8 1111 «