【正文】
CU of some of the basic as the 51 singlechip interface functions, interrupt, timer and so on. Countdown system needs to use latch, matrix keyboard, LED digital display and other major modules, through interaction between different modules to plete the Countdown to the initial hardware. The countdown device in the LED digital display, In order to simplify the circuit, reduce costs, we adopt a softwarebased interface method, namely using Keil uVision3 software program for decoding. C language programming was used in the design , we pleted the initial value can be set at any time based on 51 singlechip control of the 9999 seconds countdown system by making use of the countdown subroutine modules, matrix keyboard scanning module, interrupt, and also the correct subroutine calls. 【 Key words】 Counterdown SCM Matrix keyboard Keil uVision3 LED digital display 重慶郵電大學(xué)本科畢業(yè)設(shè)計(論文) III 目 錄 前 言 ............................................................................................................................................... 1 第一章 倒計時系統(tǒng)簡介 ................................................................................................................... 2 第一節(jié) 功能說明 ......................................................................................................................... 2 一、 設(shè)計要求 ...................................................................................................................... 2 二、 方案說明 ...................................................................................................................... 2 三、 系統(tǒng)功能 ...................................................................................................................... 3 第二節(jié) 開發(fā)作用和意義 ........................................................................................................... 3 第三節(jié) 本章小結(jié) ....................................................................................................................... 4 第二章 MCS51 單片機基本原理 .................................................................................................... 5 第一節(jié) 單片機概述 ................................................................................................................... 5 一、 單片機基礎(chǔ) .................................................................................................................. 5 二、 單片機應(yīng)用領(lǐng)域 .......................................................................................................... 7 三、 單片機的生產(chǎn)廠家和機型 .......................................................................................... 8 第二節(jié) MCS51 單片機的組成原理 ........................................................................................ 8 一、 80C51 芯片介紹 .......................................................................................................... 8 二、 8051 與 80C51 ............................................................................................................. 10 第三節(jié) MCS51 單片機的引腳功能 ...................................................................................... 10 一、 主電源引腳 Vss 和 Vcc ............................................................................................ 11 二、 外接晶體引腳 XTAL1 和 XTAL2 ............................................................................ 11 三、 控制引腳 RST/VPD、 ALE/PROG、 PSEN、 EA/Vpp ............................................ 11 四、 輸出輸入引腳 ............................................................................................................ 12 第四節(jié) 中斷 ............................................................................................................................. 14 一、 中斷的概念 ................................................................................................................ 14 二、 8051 中斷系統(tǒng)結(jié)構(gòu) ................................................................................................... 15 三、 中斷響應(yīng)條件 ............................................................................................................ 18 第五節(jié) 定時器與計數(shù)器 ......................................................................................................... 18 一、 定時器概述 ................................................................................................................ 18 重慶郵電大學(xué)本科畢業(yè)設(shè)計(論文) IV 二、定時器控制字 .............................................................................................................. 18 第六節(jié) 本章小結(jié) ..................................................................................................................... 20 第三章 倒計時器系統(tǒng)設(shè)計與調(diào)試 .................................................................................................. 21 第一節(jié) 硬件電路設(shè)計 ............................................................................................................. 21 一、 中央處理器模塊 ........................................................................................................ 21 二、 鎖存器 ........................................................................................................................ 23 三、 矩陣鍵盤 .................................................................................................................... 25 四、 LED 數(shù)碼顯示模塊 ................................................................................................... 26 第二節(jié) 軟件設(shè)計 ....................................................................................................................... 28 一、 程序準備 .................................................................................................................... 29 二、 鍵盤掃描程序設(shè)計 .................................................................................................... 30 三、 倒計時初值設(shè)置 ........................................................................................................ 31 四、 倒計時模塊子程序設(shè)計 ..............................................................