【正文】
器時(shí),地址鎖存允許的輸出電平用于鎖存地址的地位字節(jié)。在平時(shí), ALE 端以不變的頻率周期輸出正脈沖信號,此頻率為振蕩器頻率的 1/6。然而要注意的是:每當(dāng)用作外部數(shù)據(jù)存儲器時(shí),將跳過一個(gè) ALE 脈沖。此時(shí), ALE 只有在執(zhí)行 MOVX, MOVC 指令是 ALE才起作用。如果微處理器在外部執(zhí)行狀態(tài) ALE 禁止,置位無效。在由外部程序存儲器取指期間,每個(gè)機(jī)器周期兩次 /PSEN 有效。 /EA/VPP:當(dāng) /EA 保持低電平時(shí),則在此期間外部程序存儲器( 0000HFFFFH),不管是否有內(nèi)部程序存儲器。在 FLASH 編程期間,此引腳也用于施加 12V 編程電源( VPP)。 XTAL2:來自反向振蕩器的輸出。功能包括對會聚主 IC 內(nèi)部寄存器、數(shù)據(jù) RAM 及外部接口等功能部件的初始化,會聚調(diào)整控 制,會聚測試圖控制,紅外遙控信號 IR 的接收解碼及與主板 CPU 通信等。 RST/Vpd( 9 腳)為復(fù)位輸入端口,外接電阻電容組成的復(fù)位電路。 P0~P3 為可編程通用 I/O 腳,其功能用途由軟件定義,在本設(shè)計(jì)中, P0 端口( 32~39 腳)被定義為 N1 功能控制端口,分別與 N1 的相應(yīng)功能管腳相連接, 13 腳定義為 IR 輸入端, 10 腳和 11 腳定義為 I2C 總線控制端口,分別連接 N1的 SDAS( 18 腳)和 SCLS( 19 腳)端口, 12 腳、 27 腳及 28 腳定義為握手信號功能端口,連接主板 CPU 的相應(yīng)功能端,用于當(dāng)前制式的檢測及會聚調(diào)整狀態(tài)進(jìn)入的控制功能。 6 ( 2) 字符液晶顯示模塊 SMC1602A: 外形尺寸見下圖所示 接口信號說明見下表 SMC1602A 接口信號說明 編號 符號 引腳說明 編號 符號 引腳說明 1 VSS 電源地 9 D2 Data I/O 2 VDD 電源正極 10 D3 Data I/O 3 V0 LCD 偏壓輸入 11 D4 Data I/O 4 RS 數(shù)據(jù) /命令選擇端( H/L) 12 D5 Data I/O 7 5 R/W 讀寫控制信號( H/L) 13 D6 Data I/O 6 E 使能信號 14 D7 Data I/O 7 D0 Data I/O 15 BLK 背光源負(fù)極 8 D1 Data I/O 16 BLA 背光源正極 第 3章 實(shí)驗(yàn)平臺描述 keil2 軟件介紹 Keil uVision2 是德國 Keil Software 公司出品的 51 系列兼容單片機(jī) C 語言 軟件開發(fā)系統(tǒng),使用接近于傳統(tǒng) C語言的語法來開發(fā),與匯編相比, C 語言在功能上、結(jié)構(gòu)性、可讀性、可維護(hù)性上有明顯的優(yōu)勢,因而易學(xué)易用 ,而且大大的提高了工作效率和項(xiàng)目開發(fā)周期 ,他還能嵌入?yún)R編,您可以在關(guān)鍵的位置嵌入,使程序達(dá)到接近于匯編的工作效率。 C51 編譯器的功能不斷增強(qiáng), 使你可以更加貼近 CPU 本身,及其它的衍生產(chǎn)品。uVision2 IDE 可為它們提供單一而靈活的開發(fā)環(huán)境。 另外重要的一點(diǎn),只要看一下編譯后生成的匯編代碼,就能體會到 Keil C51 生成的目標(biāo)代碼效率非常之高,多數(shù)語句生成的匯編代碼很緊湊,容易理解。 8 Proteus 軟件介紹 Proteus 軟件 是英國 Labcenter electronics 公司出版的 EDA 工具軟件 (該軟件 中國 總代理為廣州風(fēng)標(biāo)電子技術(shù)有限公司)。 另外 它是目前最好的仿真單片機(jī)及外圍器件的工具。 Proteus 是世界上著名的 EDA 工具 (仿真軟件 ),從原理圖布圖、代碼調(diào)試到單片機(jī)與外圍電路協(xié)同仿真,一鍵切換到 PCB 設(shè)計(jì),真正實(shí)現(xiàn)了從概念到產(chǎn)品的完整設(shè)計(jì)。在編譯方面,它也支持 IAR、 Keil 和 MPLAB 等多種 編譯器 。 sbit rw = P3^6。 unsigned char code dis1[] = {GOOD GOOD STUDY}。//LCD 第二行顯示 void delay(unsigned char ms) { unsigned char i。 i _nop_()。 _nop_()。 rs = 0。 ep = 1。 _nop_()。 _nop_()。 0x80)。 return result。//判斷 LCD 是否忙碌 rs = 0。 ep = 0。 _nop_()。 _nop_()。 // _nop_()。 ep = 1。 _nop_()。 // _nop_()。 } void lcd_pos(unsigned char pos) { lcd_wcmd(pos | 0x80)。//判斷 LCD 是否忙碌 rs = 1。 ep = 0。 _nop_()。 // _nop_()。 ep = 1。 _nop_()。 // _nop_()。 } void lcd_init() { lcd_wcmd(0x38)。 lcd_wcmd(0x0c)。 lcd_wcmd(0x06)。 lcd_wcmd(0x01)。 } void main(void) { unsigned char i。// 初始化 LCD delay(10)。//設(shè)置顯示位置 i = 0。\039。//顯示字符 12 i++。// 設(shè)置顯示位置 i = 0。\039。// 顯示字符 i++。它不僅具有其它 EDA 工具軟件的仿真功能,還能仿真單片機(jī)及外圍器件。雖然目前國內(nèi)推廣剛起步,但已受到單片機(jī)愛好者、從事單片機(jī)教學(xué)的 教師、致力于單片機(jī)開發(fā)應(yīng)用的科技工作者的青睞。是目前世界上唯一將電路仿真軟件、 PCB 設(shè)計(jì)軟件和虛擬 模 型 仿真 軟 件三 合 一的 設(shè) 計(jì)平 臺 ,其 處 理器 模 型支 持 805 HC11 、PIC10/12/16/18/24/30/DsPIC3 AVR、 ARM、 8086和 MSP430等, 2021年又增加了 Cortex和 DSP 系列處理器,并持續(xù)增加其他系列處理器模型。 其中電路由以下結(jié)構(gòu)構(gòu)成: ( 1) 時(shí)鐘電路 通常單片機(jī)系統(tǒng)電路的實(shí)際有內(nèi)部時(shí)鐘和外部時(shí)鐘兩種形式,兩種電路都向單片機(jī)提供最基本的振蕩脈沖信號。 i. ( 2) 1602LCD 顯示電路 1602LCD 采用標(biāo)準(zhǔn)的 14 腳(無背光)或 16 腳(帶背光)接口。 VSS 和 VDD 為電源端和接地端, VEE 用于調(diào)整液晶顯示器對比度。電路連接圖如圖所示。 16 2點(diǎn)陣字符 液晶模塊 SMC1602A 分別第一行分別顯示 good good study 和dianzi1101ban,第二行分別顯示 day day up 和 shaowenjie。系統(tǒng)地復(fù)習(xí)了《模擬電子技術(shù)》、《 STC89C52RC/RD+系列單片機(jī)器件手冊》、《 Protel99SE》、《 C 語言程序設(shè)計(jì)基礎(chǔ)教程》等課程。 本課題的實(shí)現(xiàn)有以下兩部分 : 15 主要 由單片機(jī)、時(shí)鐘振蕩電路、液晶顯示模塊組成。 是利用單片機(jī) C 編語言編程來實(shí)現(xiàn)的。 本課題最大的優(yōu)點(diǎn)是 : ( 1) 設(shè)置在線下載端口; ( 2) 硬件電路設(shè)計(jì)簡單; ( 3) 軟件程序調(diào)試 /維護(hù)方便; ( 4) 采用萬用板工藝; ( 5) 實(shí)用性強(qiáng)。s Shaanxi province pass through a stop on the ancient Silk Road, Gansu39。80s. We sat on the back of pickup trucks for hours. The sky was blue, and we couldn39。t have a formal stage. The audience just sat on the grass. Usually, the performances became a big party with local people joining in. For him, the rewarding part about touring isn39。s performers of the troupe still tour the region39。s Poly Theater. Their show, titled Ulan Muqir on the Grassland, depicted the history and development of the art troupe. Being from the region allowed me to embrace the culture of Inner Mongolia and being a member of the troupe showed me where I belonged, Nasun, the art troupe39。s Liaoning province, decades ago. The solider gave the old man a handmade saddle when they bid farewell. The story inspired Nasun to write Carved Saddle, a song that later became one of his most popular numbers. Now, every year, Nasun recruits young singers and dancers for the troupe. The troupe has also designed a new repertoire, which is mostly based on the daily lives of Mongolian people, especially the lives of nomadic families, and has bined contemporary musical elements with folk songs of the region. Haimu, a 25yearold khoomei (a local variant of overtone singing) singer, joined the troupe three years ago. Along with a sixmember band, he performs fast songs and soft ones that he writes- all while playing the horsehead fiddle.Although I learned the piano since childhood and grew up listening to various kinds of music, to me, the folk music of Inner Mongolia is the root, he says. Performing in remote villages is pleasant. I feel at home on the boundless grasslands, and the warm people there make me feel fulfilled. The first round of spring auction season in Beijing ended last week, but it fail