虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

xx-Example-Software-Package-<b>fo</b>-ke

  • Keil C51使用详解

    Keil C51使用详解Keil C51 是美国Keil Software 公司出品的51 系列兼容单片机C 语言软件开发系统,与汇编相比,C 语言在功能上、结构性、可读性、可维护性上有明显的优势,因而易学易用。用过汇编语言后再使用C 来开发,体会更加深刻。Keil C51 软件提供丰富的库函数和功能强大的集成开发调试工具,全Windows界面。另外重要的一点,只要看一下编译后生成的汇编代码,就能体会到Keil C51生成的目标代码效率非常之高,多数语句生成的汇编代码很紧凑,容易理解。在开发大型软件时更能体现高级语言的优势。下面详细介绍 Keil C51 开发系统各部分功能和使用。第二节 Keil C51 单片机软件开发系统的整体结构C51 工具包的整体结构,如图(1)所示,其中uVision 与Ishell 分别是C51 forWindows 和for Dos 的集成开发环境(IDE),可以完成编辑、编译、连接、调试、仿真等整个开发流程。开发人员可用IDE 本身或其它编辑器编辑C 或汇编源文件。然后分别由C51 及A51 编译器编译生成目标文件(.OBJ)。目标文件可由LIB51 创建生成库文件,也可以与库文件一起经L51 连接定位生成绝对目标文件(.ABS)。ABS 文件由OH51 转换成标准的Hex 文件,以供调试器dScope51 或tScope51 使用进行源代码级调试,也可由仿真器使用直接对目标板进行调试,也可以直接写入程序存贮器如EPROM 中。图(1) C51 工具包整体结构图第三节 Keil C51 工具包的安装81. C51 for Dos在 Windows 下直接运行软件包中DOS\C51DOS.exe 然后选择安装目录即可。完毕后欲使系统正常工作须进行以下操作(设C:\C51 为安装目录):修改 Autoexec.bat,加入path=C:\C51\BinSet C51LIB=C:\C51\LIBSet C51INC=C:\C51\INC然后运行Autoexec.bat2. C51 for Windows 的安装及注意事项:在 Windows 下运行软件包中WIN\Setup.exe,最好选择安装目录与C51 for Dos相同,这样设置最简单(设安装于C:\C51 目录下)。然后将软件包中crack 目录中的文件拷入C:\C51\Bin 目录下。第四节 Keil C51 工具包各部分功能及使用简介1. C51 与A51(1) C51C51 是C 语言编译器,其使用方法为:C51 sourcefile[编译控制指令]或者 C51 @ commandfile其中 sourcefile 为C 源文件(.C)。大量的编译控制指令完成C51 编译器的全部功能。包控C51 输出文件C.LST,.OBJ,.I 和.SRC 文件的控制。源文件(.C)的控制等,详见第五部分的具体介绍。而 Commandfile 为一个连接控制文件其内容包括:.C 源文件及各编译控制指令,它没有固定的名字,开发人员可根据自己的习惯指定,它适于用控制指令较多的场合。(2) A51A51 是汇编语言编译器,使用方法为:9A51 sourcefile[编译控制指令]或 A51 @ commandfile其中sourcefile 为汇编源文件(.asm或.a51),而编译控制指令的使用与其它汇编如ASM语言类似,可参考其他汇编语言材料。Commandfile 同C51 中的Commandfile 类似,它使A51 使用和修改方便。2. L51 和BL51(1) L51L51 是Keil C51 软件包提供的连接/定位器,其功能是将编译生成的OBJ 文件与库文件连接定位生成绝对目标文件(.ABS),其使用方法为:L51 目标文件列表[库文件列表] [to outputfile] [连接控制指令]或 L51 @Commandfile源程序的多个模块分别经 C51 与A51 编译后生成多个OBJ 文件,连接时,这些文件全列于目标文件列表中,作为输入文件,如果还需与库文件(.LiB)相连接,则库文件也必须列在其后。outputfile 为输文件名,缺少时为第一模块名,后缀为.ABS。连接控制指令提供了连接定位时的所有控制功能。Commandfile 为连接控制文件,其具体内容是包括了目标文件列表,库文件列表及输出文件、连接控制命令,以取代第一种繁琐的格式,由于目标模块库文件大多不止1 个,因而第2 种方法较多见,这个文件名字也可由使用者随意指定。(2) Bl51BL51 也是C51 软件包的连接/定位器,其具有L51 的所有功能,此外它还具有以下3 点特别之处:a. 可以连接定位大于64kBytes 的程序。b. 具有代码域及域切换功能(CodeBanking & Bank Switching)c. 可用于RTX51 操作系统RTX51 是一个实时多任务操作系统,它改变了传统的编程模式,甚至不必用main( )函数,单片机系统软件向RTOS 发展是一种趋势,这种趋势对于186 和38610及68K 系列CPU 更为明显和必须,对8051 因CPU 较为简单,程序结构等都不太复杂,RTX51 作用显得不太突出,其专业版软件PK51 软件包甚至不包括RTX51Full,而只有一个RTX51TINY 版本的RTOS。RTX51 TINY 适用于无外部RAM 的单片机系统,因而可用面很窄,在本文中不作介绍。Bank switching 技术因使用很少也不作介绍。3. DScope51,Tscope51 及Monitor51(1) dScope51dScope51 是一个源级调试器和模拟器,它可以调试由C51 编译器、A51 汇编器、PL/M-51 编译器及ASM-51 汇编器产生的程序。它不需目标板(for windows 也可通过mon51 接目标板),只能进行软件模拟,但其功能强大,可模拟CPU 及其外围器件,如内部串口,外部I/O 及定时器等,能对嵌入式软件功能进行有效测试。

    标签: Keil C51 使用详解

    上传时间: 2013-11-01

    上传用户:zhouxuepeng1

  • Input Signal Rise and Fall Tim

    All inputs of the C16x family have Schmitt-Trigger input characteristics. These Schmitt-Triggers are intended to always provide proper internal low and high levels, even if anundefined voltage level (between TTL-VIL and TTL-VIH) is externally applied to the pin.The hysteresis of these inputs, however, is very small, and can not be properly used in anapplication to suppress signal noise, and to shape slow rising/falling input transitions.Thus, it must be taken care that rising/falling input signals pass the undefined area of theTTL-specification between VIL and VIH with a sufficient rise/fall time, as generally usualand specified for TTL components (e.g. 74LS series: gates 1V/us, clock inputs 20V/us).The effect of the implemented Schmitt-Trigger is that even if the input signal remains inthe undefined area, well defined low/high levels are generated internally. Note that allinput signals are evaluated at specific sample points (depending on the input and theperipheral function connected to it), at that signal transitions are detected if twoconsecutive samples show different levels. Thus, only the current level of an input signalat these sample points is relevant, that means, the necessary rise/fall times of the inputsignal is only dependant on the sample rate, that is the distance in time between twoconsecutive evaluation time points. If an input signal, for instance, is sampled throughsoftware every 10us, it is irrelevant, which input level would be seen between thesamples. Thus, it would be allowable for the signal to take 10us to pass through theundefined area. Due to the sample rate of 10us, it is assured that only one sample canoccur while the signal is within the undefined area, and no incorrect transition will bedetected. For inputs which are connected to a peripheral function, e.g. capture inputs, thesample rate is determined by the clock cycle of the peripheral unit. In the case of theCAPCOM unit this means a sample rate of 400ns @ 20MHz CPU clock. This requiresinput signals to pass through the undefined area within these 400ns in order to avoidmultiple capture events.For input signals, which do not provide the required rise/fall times, external circuitry mustbe used to shape the signal transitions.In the attached diagram, the effect of the sample rate is shown. The numbers 1 to 5 in thediagram represent possible sample points. Waveform a) shows the result if the inputsignal transition time through the undefined TTL-level area is less than the time distancebetween the sample points (sampling at 1, 2, 3, and 4). Waveform b) can be the result ifthe sampling is performed more than once within the undefined area (sampling at 1, 2, 5,3, and 4).Sample points:1. Evaluation of the signal clearly results in a low level2. Either a low or a high level can be sampled here. If low is sampled, no transition willbe detected. If the sample results in a high level, a transition is detected, and anappropriate action (e.g. capture) might take place.3. Evaluation here clearly results in a high level. If the previous sample 2) had alreadydetected a high, there is no change. If the previous sample 2) showed a low, atransition from low to high is detected now.

    标签: Signal Input Fall Rise

    上传时间: 2013-10-23

    上传用户:copu

  • XA-S3 I2C driver software

    This application note demonstrates how to write an Inter Integrated Circuit bus driver (I2C) for the XA-S3 16-bitMicrocontroller from Philips Semiconductors.Not only the driver software is given. This note also contains a set of (example) interface routines and a smalldemo application program. All together it offers the user a quick start in writing a complete I2C system applicationwith the PXAS3x.The driver routines support interrupt driven single master transfers. Furthermore, the routines are suitable foruse in conjunction with real time operating systems.

    标签: software driver XA-S I2C

    上传时间: 2013-11-02

    上传用户:zw380105939

  • I2C slave routines for the 87L

    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.

    标签: routines slave I2C 87L

    上传时间: 2013-11-19

    上传用户:shirleyYim

  • 51单片机读写u盘(含源程序和原理图)

    附件有51单片机加上sl811读写U盘的源程序和原理图 /*--------------------------------------------------------------------------AT89X52.H Header file for the low voltage Flash Atmel AT89C52 and AT89LV52.Copyright (c) 1995-1996 Keil Software, Inc.  All rights reserved.--------------------------------------------------------------------------*/ #ifndef AT89X52_HEADER_FILE#define AT89X52_HEADER_FILE 1 /*------------------------------------------------Byte Registers------------------------------------------------*/sfr P0      = 0x80;sfr SP      = 0x81;sfr DPL     = 0x82;sfr DPH     = 0x83;sfr PCON    = 0x87;sfr TCON    = 0x88;sfr TMOD    = 0x89;sfr TL0     = 0x8A;sfr TL1     = 0x8B;sfr TH0     = 0x8C;sfr TH1     = 0x8D;sfr P1      = 0x90;sfr SCON    = 0x98;sfr SBUF    = 0x99;sfr P2      = 0xA0;sfr IE      = 0xA8;sfr P3      = 0xB0;sfr IP      = 0xB8;sfr T2CON   = 0xC8;sfr T2MOD   = 0xC9;sfr RCAP2L  = 0xCA;sfr RCAP2H  = 0xCB;sfr TL2     = 0xCC;sfr TH2     = 0xCD;sfr PSW     = 0xD0;sfr ACC     = 0xE0;sfr B       = 0xF0;

    标签: 51单片机 读写 源程序 原理图

    上传时间: 2014-01-05

    上传用户:lnnn30

  • ADI在线工具简化工程师的设计

      创新、效能、卓越是ADI公司的文化支柱。作为业界公认的全球领先数据转换和信号调理技术领先者,我们除了提供成千上万种产品以外,还开发了全面的设计工具,以便客户在整个设计阶段都能轻松快捷地评估电路。

    标签: ADI 在线工具 工程师

    上传时间: 2013-11-25

    上传用户:kachleen

  • ADI在线工具简化工程师的设计

      创新、效能、卓越是ADI公司的文化支柱。作为业界公认的全球领先数据转换和信号调理技术领先者,我们除了提供成千上万种产品以外,还开发了全面的设计工具,以便客户在整个设计阶段都能轻松快捷地评估电路。

    标签: ADI 在线工具 工程师

    上传时间: 2013-10-18

    上传用户:cxl274287265

  • 系统可用编辑器1. Overview 2. System Requirements 3. Contents of the Distribution Package 4. List of Availab

    系统可用编辑器1. Overview 2. System Requirements 3. Contents of the Distribution Package 4. List of Available Command Line Flag Options 5. Contents of the Extracted Files 6. Installing the Software in Interactive Mode 7. Installing the Software in Silent Mode 8. Installing the INF Files Prior to OS Installation 8A. Installing the Windows* XP INF Files Prior to OS Installation

    标签: Distribution Requirements Overview Contents

    上传时间: 2015-02-23

    上传用户:wab1981

  • WHAT MIME64 IS: MIME64 is an encoding described in RFC1341 as MIME base64.Its purpose is to encode b

    WHAT MIME64 IS: MIME64 is an encoding described in RFC1341 as MIME base64.Its purpose is to encode binary files into ASCII so that they may be passedthrough e-mail gates. In this regard, MIME64 is similar to UUENCODE.Although most binaries these days are transmitted using UUENCODE, Ihave seen a few using MIME64, and I have had requests from friends thatI decode MIME64 files that have fallen into their hands. As long assome MIME64 continues to exist, a package such as this one is usefulto have.

    标签: MIME described 64 encoding

    上传时间: 2013-12-17

    上传用户:maizezhen

  • 数字运算

    数字运算,判断一个数是否接近素数 A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no

    标签: 数字 运算

    上传时间: 2015-05-21

    上传用户:daguda