【正文】
口包括寄存器組,它由通訊寄存器、設置寄存器、時鐘寄存器、數(shù)據(jù)輸出寄存器、零點校正寄存器和滿程校正寄存器等組成。選定的輸入信號被送到一個基于模擬調制器的增益可編程專用前端。增益值、信號極性以及更新速率的選擇可 緩沖器 電荷平衡型A/D 轉換器 數(shù)字濾波器 ∑ △調制器 PGA MUX 時鐘發(fā)生器 Vcc REF IN() REF IN(+) AIN1(+) AIN1() AIN2(+) AIN2() MCLK IN MCLK OUT GND DRDY RESET SCLK CS DIN DOUT A=1128 串行接口 寄存器組 5 用串行輸入口由軟件來配置。20mV ~ 177。 MCLK OUT:時鐘信號輸出端。 CS :片選端 ,低電平有效。 AIN2(+),AIN2():分別為第 2 個差分模擬輸入通道的正端與負端。根據(jù)通訊寄存器中的寄存器選擇位,輸入移位寄存器中的數(shù)據(jù) 被傳送到設置寄存器、時鐘寄存器或通訊寄存器 。 DRDY :A/D 轉換結束 標志。 ( 3) 定時中斷 T0 用于 A/D 轉換中斷延時 電子秤作為一種稱重儀器,對所稱精確度要求頗高,所以必須通過數(shù)值濾波求的有效采樣值,通過定時來完成這一系列的操作。若有,則執(zhí)行鍵識別程序。 圖 26 4 4矩陣鍵盤 (1) 稱重前, 若顯示的值不 為 , 則按“ 去皮” 鍵清除為 ; 若被稱物品需用盛器裝載, 先將盛器放在 秤盤 板上, 按“ 去皮” 鍵, 屏幕顯示為 , 然后裝入被稱物品進行稱量。 當重量顯示超過最大秤量值 10kg 時,報警器響,表示儀器處于超載狀態(tài)。單價清除按“ 清除” 鍵。 (4) 金額累計。 ( 5)校正。 因顯示位數(shù)比較多,所以要用到 4 線 16 線譯碼器 74LS154, SL0~ SL3 又由 74LS154 譯碼輸出,經 7407 驅動后到顯示器 LED 的各個位的公共陰極。在連接 32 鍵以內的簡單鍵盤時, CNTL、 SHIFT 輸入端可接地。 圖 28過量程報警模塊 10 3. 數(shù)字電子秤軟件設計 系統(tǒng)軟件設計 軟件主程序包括顯示程序、鍵盤處理程序、 A/D 轉換程序、數(shù)據(jù)轉換處理程序。 主程序流程圖如圖 31 所示 圖 31 主程序流程 鍵盤軟件設計 我們知道鍵盤和顯示是人與微機系統(tǒng)打交道的主要設備。當 RL0~ RL3 四位全為 0時,便可判斷無鍵按下, 2. 當判斷有鍵按下后,就轉向取鍵值子程序。 3. 顯示子程序。若是數(shù)字鍵,則把按鍵讀數(shù)存入存儲器,并顯示;若是命令鍵,則根據(jù)按鍵讀數(shù)查閱轉移表;以獲得處理子程序的入口,子程序執(zhí)行完后繼 續(xù)掃描鍵盤。在反饋環(huán)節(jié)中,最重要的就是對數(shù)據(jù)的采集。如下:為使技術方便我們將=15/100,即化為 定點數(shù)來算。 電子秤不僅要向高精度、高可靠方向發(fā)展 , 而且更需向多種功能的方向發(fā)展。 在整個畢業(yè)設計過程中,我對大學四年所學的知識有了一個系統(tǒng)的認識和理解,尤其是對本課題所用到的單片機及其相關知識有了進一步的掌握,對利用單片機進行控制系統(tǒng)的設計與開發(fā)又及對系統(tǒng)的分析和問題的解決有了切身的認識和體會,正所謂學以致用,在此實踐過程中增長了知識、豐富了經驗,提高了解決問題的能力。 15 參考文獻 [1] 關德新,馮文全 . 單片機外圍器件實用手冊 [M].京:北京航空航天大學出版社, 1998,~98 [2] 郁有文,常健,程繼紅 . 傳感器原理及工程應用 [M].西安:西安電子科技大學出版社, ~200 [3] 范立南,李雪飛,尹授 遠 . 單片微型計算機控制系統(tǒng)設計 [M].北京:人民郵電出版社 ,~100 [4] 高吉祥 . 電子技術基礎試驗與課程設計 [M].北京:電子工業(yè)出版社, ~99 [5] 唐俊杰 ,高秦生 . 微型計算機原理及應用 [M].北京:高等教育出版社, ~150 [6] 康華光 ,陳大欽 . 模擬電子技術基礎 [M].北京 :高等教育出版社 ,, 10~200 [7] 張毅剛主編 . 單片機原理及應用 [M].北京:高等教育出版社 ,~250 [8] 厲志飛 . 電子衡器的發(fā) 展趨勢 [J].現(xiàn)代計量儀器與技術, 2021,( 04) [9] 王艷春 . 智能電子稱重系統(tǒng)的設計 [J].微計算機信息, 2021,( 04) [10] 張景元 . 一種基于單片機的多功能電子稱 [J].微計算機信息, 2021,( 04) [11] 孫鵬,徐發(fā)明 . 模擬稱重傳感器信號發(fā)生器的設計 [J].牡丹江師范學院學報 , 2021,( 03): 23 [12] 南光群 . 基于 HT49R30A1 單片機控制的電子秤設計 [J].電工技術 , 2021,( 04): 8~9 [13] 明尚志 . 電子秤稱重傳感器 V/F 轉換電路的設計 [J].電子測量技術 , 2021, 30( 03): 175~177 [14] 周清華,馬善農 . 高性能低成本電子秤的參考設計 [J].世界電子元器件 , 2021,( 5) : 59~64 [15] 張海霞 . 新型便攜式電子秤設計 [J].計量技術 , 2021,( 9) : 6~9 16 附錄一: A/D 轉換程序 include sbit ad_cs=P1^1。 //AD 輸入輸出 I/O sbit ad_reset=P1^2。 i=0。 ad_cs=0。0x80。 } ad_din=1。 } //設置 A/D轉換模式 .然后可以連續(xù)讀出結果 . Void ad_set (unsigned char ch,unsigned char gain) // //ch=1,2。 i=i|j。 data unsigned char kk。 //讀取結果 ad_cs=0。 j=ad_dout。 } ad_cs=1。 ad_reset=1。 ad_reset=0。 //寫通訊寄存器 ,選擇通道 1,并建立下一個操作為寫時鐘寄存器 ad_write(0x04)。 ad_set(1,0)。 while(ad_drdy==1)。 lsb=ad_pro()。 他對學生認真負責的態(tài)度讓我由衷地敬佩。s how our shipboard naturalist John Fonseca describes the slushy ice that the Silver Explorer is plowing through as we enter Greenland39。re looking at rocks that are 2 billion years old. Some of the harsh striations have been dated to the tectonic plate shifts of 65 million years ago that broke up the Earth39。t do that on the QEII. That flexibility is essential to the expedition ships and cruises offered by Silversea. Whilethe line offers the more traditional cruises focused on shipboard entertainment and portcalls for shopping and nightlife, the expedition variety is targeted at more adventuroussouls.We started these as outings to more outofthe way places, specifically the Arctic and theAntarctic, for active travelers who wanted to learn about and explore wilder places upclose,says parking your butt in a deck chair is your idea of a deluxe cruise, you39。ll e to seeing this fearsome creature on this voyage around southern Greenland. Tomorrow we39。m slightly surprised to find that quite a few passengers have not only cruised with Silversea before, but rather often. At one reception, a Japanese lady gets applauded as the passenger aboard having the most cruise days with the line: 860! That39。s not have any talk of mutiny on this ship, he jokes. Always remember: You are outnumbered.They are safe, easy and family friendly, no wonder growing numbers of people are spending their vacations on a cruise ship. Zhou Wenting goes aboard. Imagine spending a holiday in a place where your every whim is catered for, where the sun and the ocean are on your doorstep and delicious food is served around the clock. You can go shopping in stores that have rock bottom prices, and if yo u grow tired of all the pampering, your bed is available anytime. You can travel with the whole family too, because the re are activities tailored to suit all age groups. 21 A vacation on an elegant cruise liner will meet the desire for an exotic experience, but will also be an enjoyable travel experience when acpanied by young children or elderly parents. Familyfriendly, safe and secure, cruise vacations have bee very popular in China. During the uping National Day Golden Week holiday, from Oct 1 to Oct 7, many families will board a ship to enjoy an exciting holiday at sea. The development of the cruise industry in recent years has been impressive. Statistics from the China Cruise and Yacht Industry Association show Chinese residents made million trips on cruise liners last year, pared with nearly 10,000 in 2021. The association pre dicts the market will continue to boom in the next two years. Residents of Shanghai, the city th at boasts the largest cruise ports of the four on the Chinese mainland, are more likely to book cruises than people in other parts of the country, according to a report published by Baidu Inc39