HT45R34在12KEY觸摸按鍵中的應(yīng)用(使用C語(yǔ)言) 本文中我們介紹如何利用我們Holtek C語(yǔ)言來(lái)完成HT45R34 12Key Touch Switch Demo board的軟件設(shè)計(jì)。
上傳時(shí)間: 2013-12-22
上傳用戶:han_zh
用戶程序示例教程 The Blinky project is a simple program for the LPC2138using Keil MCB2130 Microcontroller Board. It blinks the LEDs at speed according to the Potentiometer setting and prints the current seting to the Serial Port 1.In addition it generates a sine wave with an adjustable frequency on the speaker of the board.
上傳時(shí)間: 2014-12-27
上傳用戶:hongmo
Designing Boards with Atmel AT89C51, AT89C52, AT89C1051, and AT89C2051 for Writing Flash at In-Circuit Test:Recent improvements in chips andtesters have made it possible for thetester to begin taking over the role traditionallyassigned to the PROM programmer.Instead of having a PROM programmerwrite nonvolatile memoriesbefore assembling the board, the in-circuittester writes them during in-circuittesting operations. Many Teradyne Z18-series testers are now in use loadingcode into nonvolatile memories, microcontrollersand in-circuit programmable logic devices. The purpose of this note is to explain how the Z18 approaches the writing task for Atmel AT89C series IC’s,so that designers of boards using these chips can get the best results.
標(biāo)簽: Designing Boards Atmel with
上傳時(shí)間: 2013-11-20
上傳用戶:lijianyu172
PC機(jī)之間串口通信的實(shí)現(xiàn)一、實(shí)驗(yàn)?zāi)康?nbsp;1.熟悉微機(jī)接口實(shí)驗(yàn)裝置的結(jié)構(gòu)和使用方法。 2.掌握通信接口芯片8251和8250的功能和使用方法。 3.學(xué)會(huì)串行通信程序的編制方法。 二、實(shí)驗(yàn)內(nèi)容與要求 1.基本要求主機(jī)接收開(kāi)關(guān)量輸入的數(shù)據(jù)(二進(jìn)制或十六進(jìn)制),從鍵盤(pán)上按“傳輸”鍵(可自行定義),就將該數(shù)據(jù)通過(guò)8251A傳輸出去。終端接收后在顯示器上顯示數(shù)據(jù)。具體操作說(shuō)明如下:(1)出現(xiàn)提示信息“start with R in the board!”,通過(guò)調(diào)整乒乓開(kāi)關(guān)的狀態(tài),設(shè)置8位數(shù)據(jù);(2)在小鍵盤(pán)上按“R”鍵,系統(tǒng)將此時(shí)乒乓開(kāi)關(guān)的狀態(tài)讀入計(jì)算機(jī)I中,并顯示出來(lái),同時(shí)顯示經(jīng)串行通訊后,計(jì)算機(jī)II接收到的數(shù)據(jù);(3)完成后,系統(tǒng)提示“do you want to send another data? Y/N”,根據(jù)用戶需要,在鍵盤(pán)按下“Y”鍵,則重復(fù)步驟(1),進(jìn)行另一數(shù)據(jù)的通訊;在鍵盤(pán)按除“Y”鍵外的任意鍵,將退出本程序。2.提高要求 能夠進(jìn)行出錯(cuò)處理,例如采用奇偶校驗(yàn),出錯(cuò)重傳或者采用接收方回傳和發(fā)送方確認(rèn)來(lái)保證發(fā)送和接收正確。 三、設(shè)計(jì)報(bào)告要求 1.設(shè)計(jì)目的和內(nèi)容 2.總體設(shè)計(jì) 3.硬件設(shè)計(jì):原理圖(接線圖)及簡(jiǎn)要說(shuō)明 4.軟件設(shè)計(jì)框圖及程序清單5.設(shè)計(jì)結(jié)果和體會(huì)(包括遇到的問(wèn)題及解決的方法) 四、8251A通用串行輸入/輸出接口芯片由于CPU與接口之間按并行方式傳輸,接口與外設(shè)之間按串行方式傳輸,因此,在串行接口中,必須要有“接收移位寄存器”(串→并)和“發(fā)送移位寄存器”(并→串)。能夠完成上述“串←→并”轉(zhuǎn)換功能的電路,通常稱為“通用異步收發(fā)器”(UART:Universal Asynchronous Receiver and Transmitter),典型的芯片有:Intel 8250/8251。8251A異步工作方式:如果8251A編程為異步方式,在需要發(fā)送字符時(shí),必須首先設(shè)置TXEN和CTS#為有效狀態(tài),TXEN(Transmitter Enable)是允許發(fā)送信號(hào),是命令寄存器中的一位;CTS#(Clear To Send)是由外設(shè)發(fā)來(lái)的對(duì)CPU請(qǐng)求發(fā)送信號(hào)的響應(yīng)信號(hào)。然后就開(kāi)始發(fā)送過(guò)程。在發(fā)送時(shí),每當(dāng)CPU送往發(fā)送緩沖器一個(gè)字符,發(fā)送器自動(dòng)為這個(gè)字符加上1個(gè)起始位,并且按照編程要求加上奇/偶校驗(yàn)位以及1個(gè)、1.5個(gè)或者2個(gè)停止位。串行數(shù)據(jù)以起始位開(kāi)始,接著是最低有效數(shù)據(jù)位,最高有效位的后面是奇/偶校驗(yàn)位,然后是停止位。按位發(fā)送的數(shù)據(jù)是以發(fā)送時(shí)鐘TXC的下降沿同步的,也就是說(shuō)這些數(shù)據(jù)總是在發(fā)送時(shí)鐘TXC的下降沿從8251A發(fā)出。數(shù)據(jù)傳輸?shù)牟ㄌ芈嗜Q于編程時(shí)指定的波特率因子,為發(fā)送器時(shí)鐘頻率的1、1/16或1/64。當(dāng)波特率指定為16時(shí),數(shù)據(jù)傳輸?shù)牟ㄌ芈示褪前l(fā)送器時(shí)鐘頻率的1/16。CPU通過(guò)數(shù)據(jù)總線將數(shù)據(jù)送到8251A的數(shù)據(jù)輸出緩沖寄存器以后,再傳輸?shù)桨l(fā)送緩沖器,經(jīng)移位寄存器移位,將并行數(shù)據(jù)變?yōu)榇袛?shù)據(jù),從TxD端送往外部設(shè)備。在8251A接收字符時(shí),命令寄存器的接收允許位RxE(Receiver Enable)必須為1。8251A通過(guò)檢測(cè)RxD引腳上的低電平來(lái)準(zhǔn)備接收字符,在沒(méi)有字符傳送時(shí)RxD端為高電平。8251A不斷地檢測(cè)RxD引腳,從RxD端上檢測(cè)到低電平以后,便認(rèn)為是串行數(shù)據(jù)的起始位,并且啟動(dòng)接收控制電路中的一個(gè)計(jì)數(shù)器來(lái)進(jìn)行計(jì)數(shù),計(jì)數(shù)器的頻率等于接收器時(shí)鐘頻率。計(jì)數(shù)器是作為接收器采樣定時(shí),當(dāng)計(jì)數(shù)到相當(dāng)于半個(gè)數(shù)位的傳輸時(shí)間時(shí)再次對(duì)RxD端進(jìn)行采樣,如果仍為低電平,則確認(rèn)該數(shù)位是一個(gè)有效的起始位。若傳輸一個(gè)字符需要16個(gè)時(shí)鐘,那么就是要在計(jì)數(shù)8個(gè)時(shí)鐘后采樣到低電平。之后,8251A每隔一個(gè)數(shù)位的傳輸時(shí)間對(duì)RxD端采樣一次,依次確定串行數(shù)據(jù)位的值。串行數(shù)據(jù)位順序進(jìn)入接收移位寄存器,通過(guò)校驗(yàn)并除去停止位,變成并行數(shù)據(jù)以后通過(guò)內(nèi)部數(shù)據(jù)總線送入接收緩沖器,此時(shí)發(fā)出有效狀態(tài)的RxRDY信號(hào)通知CPU,通知CPU8251A已經(jīng)收到一個(gè)有效的數(shù)據(jù)。一個(gè)字符對(duì)應(yīng)的數(shù)據(jù)可以是5~8位。如果一個(gè)字符對(duì)應(yīng)的數(shù)據(jù)不到8位,8251A會(huì)在移位轉(zhuǎn)換成并行數(shù)據(jù)的時(shí)候,自動(dòng)把他們的高位補(bǔ)成0。 五、系統(tǒng)總體設(shè)計(jì)方案根據(jù)系統(tǒng)設(shè)計(jì)的要求,對(duì)系統(tǒng)設(shè)計(jì)的總體方案進(jìn)行論證分析如下:1.獲取8位開(kāi)關(guān)量可使用實(shí)驗(yàn)臺(tái)上的8255A可編程并行接口芯片,因?yàn)橹灰@取8位數(shù)據(jù)量,只需使用基本輸入和8位數(shù)據(jù)線,所以將8255A工作在方式0,PA0-PA7接實(shí)驗(yàn)臺(tái)上的8位開(kāi)關(guān)量。2.當(dāng)使用串口進(jìn)行數(shù)據(jù)傳送時(shí),雖然同步通信速度遠(yuǎn)遠(yuǎn)高于異步通信,可達(dá)500kbit/s,但由于其需要有一個(gè)時(shí)鐘來(lái)實(shí)現(xiàn)發(fā)送端和接收端之間的同步,硬件電路復(fù)雜,通常計(jì)算機(jī)之間的通信只采用異步通信。3.由于8251A本身沒(méi)有時(shí)鐘,需要外部提供,所以本設(shè)計(jì)中使用實(shí)驗(yàn)臺(tái)上的8253芯片的計(jì)數(shù)器2來(lái)實(shí)現(xiàn)。4:顯示和鍵盤(pán)輸入均使用DOS功能調(diào)用來(lái)實(shí)現(xiàn)。設(shè)計(jì)思路框圖,如下圖所示: 六、硬件設(shè)計(jì)硬件電路主要分為8位開(kāi)關(guān)量數(shù)據(jù)獲取電路,串行通信數(shù)據(jù)發(fā)送電路,串行通信數(shù)據(jù)接收電路三個(gè)部分。1.8位開(kāi)關(guān)量數(shù)據(jù)獲取電路該電路主要是利用8255并行接口讀取8位乒乓開(kāi)關(guān)的數(shù)據(jù)。此次設(shè)計(jì)在獲取8位開(kāi)關(guān)數(shù)據(jù)量時(shí)采用8255令其工作在方式0,A口輸入8位數(shù)據(jù),CS#接實(shí)驗(yàn)臺(tái)上CS1口,對(duì)應(yīng)端口為280H-283H,PA0-PA7接8個(gè)開(kāi)關(guān)。2.串行通信電路串行通信電路本設(shè)計(jì)中8253主要為8251充當(dāng)頻率發(fā)生器,接線如下圖所示。
上傳時(shí)間: 2013-12-19
上傳用戶:小火車?yán)怖怖?/p>
The solution presented in this paper and in the attached source files emulates the mostimportant SSC functions by using SW routines implemented in C. The code is focused onthe SAB C513, but will fit to all C500 derivatives.Beyond the low level software drivers a test shell is delivered. This shell allows a quicktest of the software drivers by an emulator or a starter kit demo board.
上傳時(shí)間: 2013-11-24
上傳用戶:363186
The μPSD32xx family, from ST, consists of Flash programmable system devices with a 8032 MicrocontrollerCore. Of these, the μPSD3234A and μPSD3254A are notable for having a complete implementationof the USB hardware directly on the chip, complying with the Universal Serial Bus Specification, Revision1.1.This application note describes a demonstration program that has been written for the DK3200 hardwaredemonstration kit (incorporating a μPSD3234A device). It gives the user an idea of how simple it is to workwith the device, using the HID class as a ready-made device driver for the USB connection.IN-APPLICATION-PROGRAMMING (IAP) AND IN-SYSTEM-PROGRAMMING (ISP)Since the μPSD contains two independent Flash memory arrays, the Micro Controller Unit (MCU) can executecode from one memory while erasing and programming the other. Product firmware updates in thefield can be reliably performed over any communication channel (such as CAN, Ethernet, UART, J1850)using this unique architecture. For In-Application-Programming (IAP), all code is updated through theMCU. The main advantage for the user is that the firmware can be updated remotely. The target applicationruns and takes care on its own program code and data memory.IAP is not the only method to program the firmware in μPSD devices. They can also be programmed usingIn-System-Programming (ISP). A IEEE1149.1-compliant JTAG interface is included on the μPSD. Withthis, the entire device can be rapidly programmed while soldered to the circuit board (Main Flash memory,Secondary Boot Flash memory, the PLD, and all configuration areas). This requires no MCU participation.The MCU is completely bypassed. So, the μPSD can be programmed or reprogrammed any time, anywhere, even when completely uncommitted.Both methods take place with the device in its normal hardware environment, soldered to a printed circuitboard. The IAP method cannot be used without previous use of ISP, because IAP utilizes a small amountof resident code to receive the service commands, and to perform the desired operations.
標(biāo)簽: Demonstration 3200 USB for
上傳時(shí)間: 2014-02-27
上傳用戶:zhangzhenyu
Abstract: This application note explains the hardware of different types of 1-Wire® interfaces and software examples adapted to this hardware with a focus on serial ports. Depending on the types of iButtons required for a project and the type of computer to be used, the most economical interface is easily found. The hardware examples shown are basically two different types: 5V general interface and 12V RS-232 interface. Within the 5V group a common printed circuit board could be used for all circuits described. The variations can be achieved by different populations of components. The same principal is used for the 12V RS-232 interface. The population determines if it is a Read all or a Read/Write all type of interface. There are other possible circuit implementations to create a 1-Wire interface. The circuits described in this application note cover many different configurations. For a custom application, one of the described options can be adapted to meet individual needs.
標(biāo)簽: iButtons Reading Writing and
上傳時(shí)間: 2013-10-29
上傳用戶:long14578
The 87LPC76X Microcontroller combines in a small package thebenefits of a high-performance microcontroller with on-boardhardware supporting the Inter-Integrated Circuit (I2C) bus interface.The 87LPC76X can be programmed both as an I2C bus master, aslave, or both. An overview of the I2C bus and description of the bussupport hardware in the 87LPC76X microcontrollers appears inapplication note AN464, Using the 87LPC76X Microcontroller as anI2C Bus Master. That application note includes a programmingexample, demonstrating a bus-master code. Here we show anexample of programming the microcontroller as an I2C slave.The code listing demonstrates communications routines for the87LPC76X as a slave on the I2C bus. It compliments the program inAN464 which demonstrates the 87LPC76X as an I2C bus master.One may demonstrate two 87LPC76X devices communicating witheach other on the I2C bus, using the AN464 code in one, and theprogram presented here in the other. The examples presented hereand in AN464 allow the 87LPC76X to be either a master or a slave,but not both. Switching between master and slave roles in amultimaster environment is described in application note AN435.The software for a slave on the bus is relatively simple, as theprocessor plays a relatively passive role. It does not initiate bustransfers on its own, but responds to a master initiating thecommunications. This is true whether the slave receives or transmitsdata—transmission takes place only as a response to a busmaster’s request. The slave does not have to worry about arbitrationor about devices which do not acknowledge their address. As theslave is not supposed to take control of the bus, we do not demandit to resolve bus exceptions or “hangups”. If the bus becomesinactive the processor simply withdraws, not interfering with themaster (or masters) on the bus which should (hopefully) try toresolve the situation.
標(biāo)簽: routines slave I2C 87L
上傳時(shí)間: 2013-11-19
上傳用戶:shirleyYim
I2C interface, is a very powerful tool for system designers. Theintegrated protocols allow systems to be completely software defined.Software development time of different products can be reduced byassembling a library of reusable software modules. In addition, themultimaster capability allows rapid testing and alignment ofend-products via external connections to an assembly-line computer.The mask programmable 87LPC76X and its EPROM version, the87LPC76X, can operate as a master or a slave device on the I2Csmall area network. In addition to the efficient interface to thededicated function ICs in the I2C family, the on-board interfacefacilities I/O and RAM expansion, access to EEPROM andprocessor-to-processor communications.
標(biāo)簽: microcontro Using 76X LPC
上傳時(shí)間: 2013-12-30
上傳用戶:Artemis
The 87C576 includes two separate methods of programming theEPROM array, the traditional modified Quick-Pulse method, and anew On-Board Programming technique (OBP).Quick Pulse programming is a method using a number of devicepins in parallel (see Figure 1) and is the traditional way in which87C51 family members have been programmed. The Quick-Pulsemethod supports the following programming functions:– program USER EPROM– verify USER EPROM– program KEY EPROM– program security bits– verify security bits– read signature bytesThe Quick-Pulse method is quite easily suited to standardprogramming equipment as evidenced by the numerous vendors of87C51 compatible programmers on the market today. Onedisadvantage is that this method is not well suited to programming inthe embedded application because of the large number of signallines that must be isolated from the application. In addition, parallelsignals from a programmer would need to be cabled to theapplication’s circuit board, or the application circuit board wouldneed to have logic built-in to perform the programming functions.These requirements have generally made in-circuit programmingusing the modified Quick Pulse method impractical in almost all87C51 family applications.
上傳時(shí)間: 2013-10-21
上傳用戶:xiaozhiqban
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1