【正文】
往低排列, 寫成二進制為 01111110, 把 它 轉(zhuǎn)化為 16 進制則為 A2H。 動態(tài)接口采用各數(shù)碼管循環(huán)輪流顯示的方法,當循環(huán)顯示的頻率較高時,利用人眼的暫留特性,看不出閃爍顯示現(xiàn)象,這種顯示需要一個接口完成字形碼的輸出,另一接口完成各數(shù)碼管的輪流點亮。這種 接法占用接口多,僅能接少量數(shù)碼管。由于 P0 沒有內(nèi)置電阻,因此在使用時需外接一個上拉電阻。 軟件設計 籃球比賽計分器其實就是一個計數(shù)器,本次課程設計就是利用單片機中的定時 /計數(shù)器來實現(xiàn)其計分的功能。它們用于存放定時或計數(shù)的初始值。用于選擇和控制定時 /計數(shù)器的工作。作為可編程器件,單片機中的定時 /計數(shù)器初始化編程步驟如下: 根據(jù)定時時間要求或計數(shù)要求計算計數(shù)器初值; 將工作方式控制字寫入 TMOD 寄存器; 將計數(shù)初值寫入 THX 和 TLX 寄存器; 啟動定時器 /計數(shù)器,即將 TRX 置位。 本次課程設計程序是用 C 語言編寫的,因為設計的功能較為簡單,所以程序中只用到一個主程序就實現(xiàn)了其功能。 控制源程序 include define uchar unsigned char define uint unsigned int 初始化 sbit P10=P1^0。 按鍵 k2 sbit P12=P1^2。 按鍵 k4 uchar code tab[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09}。 while(1) { if(P10 == 0) { k1 += 1。 } if(P11 == 0) { k1 += 2。 } if(P12 == 0) { k1 += 3。 } if(P13 == 0) { k1 = 1。 } if(k1 1000) 分數(shù)大于 999,歸 0 k1 = 0。 百位 P3 = tab[S1%100/10]。 個位 第 14 頁 共 19 頁 } } 第 15 頁 共 19 頁 圖 5 系統(tǒng)程序流程圖 第 16 頁 共 19 頁 5 系統(tǒng)仿真與實驗測試 系統(tǒng)仿真 本次課程設計用到的仿真軟件有 Protues 和 Keil uvision。具體方法是先新建一項目,之后輸入編寫的程序,輸入完成后保存然后執(zhí)行項目、編譯,在目標文件夾內(nèi)生成編譯好的程序文件,其中 *.HEX 文件就是我們所需要的目的文件,在之后電路設計好后用于導入 AT89C52 中執(zhí)行其功能。我們可直接在其中構建電路圖,點擊板面左側按鍵 P,在彈出的Pick devices 對話框中進行元器件的選擇,元器件都找到后,先進行排版再按照電路圖連接,連接好后,雙擊 AT89C52 在彈出對話框中選擇單片機中要輸入的程序,在輸入程序后,即可開始進行仿真了,選擇執(zhí)行后點擊開關可觀察到數(shù)碼管亮,并能實現(xiàn)加 加 加 減 1 功能。點擊運行,觀察現(xiàn)象 , 3 個數(shù)碼管均顯示為 0。 然后進行了如下操作:當按下 k1 鍵,從左往右(后同)的第 3 個數(shù)碼管顯示 1,再按下k2 鍵,第 3 個數(shù)碼管顯示 3,按下 k3 鍵,第 3 個數(shù)碼管顯示 6,再按下 k4 鍵,第 3 個數(shù)碼管顯示 5,與設計的要求相符。 圖 8 值為 5的仿真圖 第 19 頁 共 19 頁 6 心得與體會 這次課程設計歷時二個星期多左右,通過這兩個星期的學習,發(fā)現(xiàn)了自己的很多不足,自己知識的很多漏洞,看到了自己的實踐經(jīng)驗還是 比較缺乏,理論聯(lián)系實際的能力還急需提高。但是最終通過自己的努力,查閱資料,詢問同學,完成了這次的單片機的設計,在以后的學習中我也會更多的重視自己理論和實踐的結合能力,提高自身綜合能力。單片機編程既可以用 C 語言也可用匯編語言,其中最重要的環(huán)節(jié)就是我們要敢于去寫,敢于挑戰(zhàn),不怕犯錯,然后就是多調(diào)試。 最后,我還要感謝在此次課程設計中幫助過我的老師和同學。 第 20 頁 共 19 頁 參考文獻 [1]肖洪兵 . 《跟我學用單片機》 [M]. 北京: 北京航空航天大學出版社 , [2]何立民 . 《單片機高級教程》 [M].北京:北京航空航天大學出版社, 2021 [3]吳秀清 . 《 微型計算機原理與接口技術 》 [M]. 北京:中國科學技術 出版社, [4]李廣第.《 微機原理與接口技術 》 [M]. 湖南:湖南湖南 大學出版社, 2021 [5]唐穎 . 《 單片機原理與應用 》 [M]. 北京: 北京大學出版社, 2021 g an employment tribunal clai Employment tribunals sort out disagreements between employers and employees. You may need to make a claim to an employment tribunal if: ? you don39。t appealed against the disciplinary action your employer has taken against you. However, if you win your case, the tribunal may reduce any pensation awarded to you as a result of your failure to appeal. Remember that in most cases you must make an application to an employment tribunal within three months of the date when the event you are plaining about happened. If your application is received after this time limit, the tribunal will not usually accept i. If you are worried about how the time limits apply to you, take advice from one of the anisations listed under Further help. Employment tribunals are less formal than some other courts, but it is still a legal process and you will need to give evidence under an oath or affirmation. Most people find making a claim to an employment tribunal challenging. If you are thinking about making a claim to an employment tribunal, you should get help straight away from one of the anisations listed under Further help. If you are being represented by a solicitor at the tribunal, they may ask you to sign an agreement where you pay their fee