【正文】
示。由于現(xiàn)在單片機(jī)的發(fā)展已經(jīng)達(dá)到了很高的水平,內(nèi)部的各種資源相當(dāng)?shù)呢S富,CPU的處理速度非常的快。2) 將40芯片的仿真插頭插入單片機(jī)插座進(jìn)行調(diào)試,檢查各接口是否滿足設(shè)計(jì)的要求,有正常的程序測(cè)試硬件電路的好壞。如果不能,則在相關(guān)的子程序中設(shè)計(jì)斷點(diǎn),反復(fù)調(diào)試直到能夠顯示。如果一致。使得本直流數(shù)字電壓表具體精度高,靈敏度強(qiáng),性能可靠,電路簡(jiǎn)單,設(shè)計(jì)成本低,能夠滿足一般的電壓測(cè)量。我要感謝我系的各位老師,在設(shè)計(jì)過程中,我系的老師們給了我很多種肯定的建議,使我的論文得以順利的完成。 memory. When the AT89C52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.EA/VPPExternal Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset.EA should be strapped to VCC for internal program executions. This pin also receives the 12volt programming enable voltage (VPP) during Flash programming when 12volt programming is selected.XTAL1Input to the inverting oscillator amplifier and input to the internal clock operating circuit.XTAL2Output from the inverting oscillator amplifier.Special Function RegistersA map of the onchip memory area called the Special Function Register (SFR) space is shown in Table 1.Note that not all of the addresses are occupied, and unoccupied addresses may not be implemented on the chip. Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect.User software should not write 1s to these unlisted locations, since they may be used in future products to invoke new features. In that case, the resetor inactive values of the new bits will always be 0.Timer 2 Registers Control and status bits are contained in registersT2CON (shown in Table 2) and T2MOD (shown in Table 4) for Timer 2. The register pair (RCAP2H, RCAP2L) are the Capture/Reload registers for Timer 2 in 16bit capture mode or 16bit autoreload mode. Interrupt Registers The individual interrupt enable bits are in the IE register. Two priorities can be set for each of the six interrupt sources in the IP register譯文:AT89S52芯片介紹主要性能與MCS51單片機(jī)產(chǎn)品兼容8K字節(jié)在系統(tǒng)可編程Flash存儲(chǔ)器全靜態(tài)操作:0HZ24MHZ三級(jí)加密程序存儲(chǔ)器256x8位內(nèi)部RAM32個(gè)可編程I/O口線三個(gè)16位定時(shí)器/計(jì)數(shù)器八個(gè)中斷源可編程的串行通道低功耗空閑和掉電模式介紹At89s52是一種低功耗、高性能CMOS8位微控制器,具有8K在系統(tǒng)可編程Flash存儲(chǔ)器。引腳介紹VCC電源電壓。程序校驗(yàn)時(shí),需要外部上拉電阻。作為輸入使用時(shí),被外部拉低的引腳由于內(nèi)部電阻的原因,將輸出電流(IIL)。RST復(fù)位輸入。此外,該引腳會(huì)被微弱拉高,單片機(jī)執(zhí)行外部程序時(shí),應(yīng)設(shè)置ALE禁止位無效。片上沒有定義的地址是不能用的。sbit out=P2^2。 for(i=ms。 } if(key2==0) { delay(10)。 EX0=1。 ale=0。 //地址計(jì)算 delay(1)。 }}void int0_init(){ EA=1。 //消抖延時(shí) if(key1==0) { num=1。uint ad_data。sbit e=P3^1。XTAL1振蕩器反相放大器及內(nèi)部時(shí)鐘發(fā)生器的輸入端XTAL2振蕩器反相放大器的輸出端特殊功能寄存器特殊功能寄存器(SFR)的地址空間映象如表1所示。如有必要,可通過對(duì)特殊功能寄存器(SFR)區(qū)中的8EH單元的D0位置位,可禁止ALE操作。作為輸入使用時(shí),被外部拉低的引腳由于內(nèi)部電阻的原因,將輸出電流(IIL)。P2口P2口是一個(gè)具有內(nèi)部上拉電阻的8位雙向I/O口,P2輸出緩沖器能驅(qū)動(dòng)4個(gè)TTL邏輯電平。在這種模式下,P0具有內(nèi)部上拉電阻??臻e模式下,CPU停止工作,允許RAM、定時(shí)器/計(jì)數(shù)器、串口、中斷繼續(xù)工作。 Ground.Port 0Port 0 is an 8bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as highimpedance inputs.Port 0 can also be configured to be the multiplexed loworder address/data bus during accesses to external program and data memory. In this mode, P0 has internal pullups.Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pullups are required during program verification.Port 1Port 1 is an 8bit bidirectional I/O port with internal pullups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pullups and can be used as inputs, Port 1 pins that are externally being pulled low will source current because of the internal pullups. In addition, and can be configured to be the timer/counter 2 external count input () and the timer/counter 2 trigger input (), respectively, as shown in the following table.Port 1 also receives the loworder address bytes during Flash programming and program verification.Port 2Port 2 is an 8bit bidirectional I/O port with internal pullups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pullups and can be used as inputs, Port 2 pins that are externally being pulled low will source current because of the internal pullups. Port 2 emits the highorder address byte during fetches from external program memory and during accesses to external data memory that use 16bit addresses (MOVX DPTR). In this application, Port 2 uses strong internal pullups when emitting 1s. During accesses to external data memory that use 8bit addresses (MOVX RI), Port 2emits the contents of the P2 Special Function Register. Port 2 also receives the highorder address bits and some control signals during Flash programming and verification.Port 3Port 3 is an 8bit bidirectional I/O port with internal pullups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pullups and can be used as inputs, Port 3 pins that are externally being pulled low will source current because of the pullups.Port 3 also serves the functions of various special features of the AT89C51,as shown in the following table.Port 3 also receives some control signals for Flash programming and programming verification.RST他不僅在學(xué)術(shù)上給了我指導(dǎo),在生活上也給了我無盡的關(guān)懷。如果一樣,說明設(shè)計(jì)成功完成。4) 檢查數(shù)據(jù)的轉(zhuǎn)換模塊程序。1) 檢查液晶顯示模塊程序。1) 檢查所設(shè)計(jì)的硬件電路板所有的器件和引腳是否正確,尤其是電源的連接是否正確;檢查各總線是否有短路的故障。但它依賴于計(jì)算機(jī)硬件,程序可讀性和可移植性比較差。 1602液晶與單片機(jī)連接。由于輸入電路的電壓比基準(zhǔn)電壓(5V)高很多,因此在輸入電路必須加電壓衰減器??梢酝ㄟ^調(diào)檔開關(guān)實(shí)現(xiàn)各檔位。4. 三種連接方式的綜合比較第一種和第二種連接方式允許多片ADC0809與單片機(jī)連接,第三種連接方式只能連接一片。 ADC0809與51單片機(jī)的第三種連接方式當(dāng)51單片機(jī)沒有外擴(kuò)RAM和I/O口時(shí),ADC0809就可以在概念上作為一個(gè)特殊的唯一的外擴(kuò)RAM單元。 這種連接方式有一個(gè)特點(diǎn),那就是單片機(jī)要把最低3位二進(jìn)制數(shù)據(jù)通過數(shù)據(jù)總線寫入ADC0809的地址鎖存器,然后作為通道地址使用。編程概要: MOV DPTR,7FF8H;DPTR指向0809通道0