【正文】
具體電路圖如下 20 參考文獻: 蔣立平,數(shù)字邏輯電路與系統(tǒng)設(shè)計,電子工業(yè)出版社, 。因此,在星期計數(shù)模塊不應(yīng)采用清零,而應(yīng)該采用置數(shù)方法,使得星期日之后為星期一。 K6 作為鬧鐘的開關(guān),決定鬧鐘是否工作。 六、實驗感想 本設(shè)計中,對于鬧鐘的時間設(shè)定是通過撥動開關(guān) K5 和 K6 來實現(xiàn)的,雖然設(shè)計比較簡單,但是對于設(shè)定較大的時間來說,撥動的次數(shù)很多,不方便 ,因此可以考慮對本身用于校分和校時的開關(guān)進行復(fù)用。 五、結(jié)論 最終設(shè)計的數(shù)字鐘的功能包括: 可從 00:00:00 到 23:59:59 計時,并在控制電路的作用下具有保持、清零、快速校時、快速校分、整點報時的功能。然后試驗了開關(guān)的功能,功能都對,但是在撥動開關(guān)的過程中,顯示數(shù)字突變,于是加入了消顫,如下圖: 19 加入消顫后,開關(guān)再撥動,示數(shù)均正常,而且之前的分鐘計數(shù)不穩(wěn)定也解決了。 四、下載調(diào)試 將設(shè)計好的電路下載,發(fā)現(xiàn)分計數(shù)不穩(wěn)定每當(dāng)達到 39 就清零,但檢查邏輯電路沒有錯誤。星期部分也可清零、保持,但不能校日。 在蜂鳴器響處放大為 可見在 1 小時 3分時鳴叫。 仿真: 如上圖,設(shè)定 1小時 3 分時鬧鐘響。 K7作為鬧鐘的開關(guān),只有當(dāng) 7=1K 時,鬧鐘才起作用。當(dāng)這一個開關(guān)上下一次,對應(yīng)設(shè)定的小時或分鐘增加 1。而當(dāng) 44 1K ? 時,以 1HZ 作為小時的時鐘進行計數(shù)。而當(dāng) 33 1K ? 時,分不在是以每 60 秒計一次數(shù),而是以 1HZ 作為分鐘的時鐘進行計數(shù)。分和時清零同理。又 1HZ 是作為數(shù)字鐘的時鐘信號,所以當(dāng)恒為高電平時不再計數(shù),即時間保持不變。由圖可以看出, 時鐘計到59’ 53” 時開始報時,在 59’ 53” , 59’ 55” ,59’ 57” 時報時頻率為 512Hz, 59’ 59” 時報時頻率為 1KHz。最后 11 再看秒個位 ,9 直接用 SQ[0]*SQ[3]表示,而 3,5 和 7用 SQ[0]*(SQ[1]+SQ[2])* [3]SQ 表示。注: 2K 為 1KHZ。 (K22 作為清零開關(guān)和 K44 作為校時開關(guān)暫不考慮,作 0處理 ) 仿真如下圖: 9 可見每到 23清零。 (3)小時計時 8 以上為模 24計數(shù)器,即 [2]HQ 和 [5]HQ 作為小時計數(shù)器的清零信號。但這里的第一個 74160 的時鐘不是1HZ,而是由 [0]SQ 、 [3]SQ 、 [4]SQ 和 [6]SQ 組合作為時鐘信號,使得分鐘個位每60秒計一次數(shù)。 (K22 作為清零開關(guān)暫不考慮,作 0處理 ) 仿真如下圖: 時鐘周期 10ns,可見為模 60。秒的十位由 [5]SQ 和 [6]SQ 作為判別條件異步清零,即遇 6清零。 (K11 作為保持開關(guān)暫不考慮,作 0 處理 ) 仿真波形如下 (兩個千分頻原理一樣,因此僅仿真一個 ): 取一個周期,顯示: 因為時鐘周期為 10ns,因此可以看出為千分頻。 (2)1MHZ→ 1HZ 5 因為 74160 是模 10 計數(shù)器,因此三個 74160 形成千分頻。由此,兩個 74161 形成 48分頻,產(chǎn)生 1MHZ 信號。 4 三、 各子模塊設(shè)計原理 (1)48MHZ→ 1MHZ 如圖,因為 74161 為異步清零,所以 [0]OUT 表示 48清零。 9. 星期功能。 K7 作為鬧鐘的開關(guān),只有當(dāng) 7=1K 時,鬧鐘才起作用。當(dāng)這一個開關(guān)上下一次,對應(yīng)設(shè)定的小時或分鐘增加 1。 8. 鬧鐘功能。 7. 整點報時電路。 6. 校分、校時電路設(shè)計。 5. 清零電路。 4. 保持電路。動態(tài)譯碼顯示電路是由數(shù)據(jù)選擇器、譯碼器、顯示譯碼器和數(shù)碼管組成的。 3. 顯示譯碼電路。分頻順序為: 48MHz→ 1MHz→ 1kHz→ 1Hz,主要使用 74160 和 74161。 開關(guān)的功能匯總?cè)缦拢? 表 1 開關(guān)標(biāo)號 功能 K1( K11) 系統(tǒng) 保持 開關(guān) K2( K22) 系統(tǒng)清零開關(guān) K3( K33) 系統(tǒng)校分開關(guān) K4( K44) 系統(tǒng)校時開關(guān) K5( K5) 鬧鐘模塊定時小時位 K6( K6) 鬧鐘模塊定時分 鐘 位 K7( K7) 鬧鐘使用開關(guān) K8( K8) 鬧鐘時間設(shè)置清零開關(guān) 注:()內(nèi)為電路中的開關(guān)表示符號 3 二、 方案論證 1. 脈沖發(fā)生電路,產(chǎn)生所需要的所有頻率。 關(guān)鍵字: 分頻、計數(shù)器、 D 觸發(fā)器 Abstract Design a digital timer, which has the timing function counting from 00:00:00 to 23:59:59, and can also maintain time 、 clear time、 rapidly adjust the minutes 、 rapidly adjust the hours and timekeeping. The realizing specific methods are as follows .First, use a mold 48 and two mode 1000 counters to turn the original 48 MHz into a digital timer required 1HZ. Second , take the 1HZ as the clock to the basic digital clock formation of two mold 60 and a modulo 24 counters . Use the appropriate AND and OR gates added to the appropriate timing module can realize rapidly adjusting the minutes . As for timekeeping , using the corresponding discriminant conditions, connecting them with the corresponding frequency, and sending to the buzzer port can plete the function. Additional features include alarm clock and counting days of the week. The alarm clock can set the time, can be first cleared and then reseted, can sound for 10 seconds, and in the period can turn off the alarm. The specific method is: take K5 as the switch setting hour and take K6 as the switch setting minute, both as counters’ clock. Once these two switches up and down, hour and minute are both increase 1. Then pare the alarm time with the time of the digital clock . When they are the same, the buzzer start sounding . Setting the week is relatively simple, just adding a modulo 8 counter behind digital clock hour module and adding the corresponding output to the display module. For the debug experiments , use the D flipflop to eliminate chatter and the frequency added can not be too much. Keywords: frequency converteion、 counter、 D flipflop 1 目錄