Getting Started:Creating Applications with uVision 11 Last-Minute Changes As with any high-tech product,last minute changes might not be included into the printed manuals.These last-minute changes and enhancements to the software and manuals are listed in the Release Notes shipped with the product. Licensing Each Keil product requires activation through a license code.This code is obtained via e-mail during the registration process.There are two types of product licenses: Single-User License is available for all Keil products.A Single-User License grants the right to use a product on a maximum of two computers to one user.Each installation requires a license code that is personalized for the computer on which the product is installed.A Single-User license may be uninstalled and moved to another computer. Floating-User License is available for many Keil products.The Floating- User license grants the right to use that product on several computers by several different developers at the same time.Each installation of the product requires an individual license code for each computer on which the product is installed. Installation Please check the minimum hardware and software requirements that must be satisfied to ensure that your Keil development tools are installed and will function properly.Before attempting installation,verify that you have: A standard PC running Microsoft Windows XP,or Windows Vista 1GB RAM and 500 MB of available hard-disk space is recommended 1024x768 or higher screen resolution;a mouse or other pointing device ■ACD-ROM drive Keil products are available on CD-ROM and via download from www.keil.com Updates to the related products are regularly available at www.keil.com/update
Getting Started: Creating Applications with µVision 11 Last-Minute Changes As with any high-tech product, last minute changes might not be included into the printed manuals. These last-minute changes and enhancements to the software and manuals are listed in the Release Notes shipped with the product. Licensing Each Keil product requires activation through a license code. This code is obtained via e-mail during the registration process. There are two types of product licenses: Single-User License is available for all Keil products. A Single-User License grants the right to use a product on a maximum of two computers to one user. Each installation requires a license code that is personalized for the computer on which the product is installed. A Single-User license may be uninstalled and moved to another computer. Floating-User License is available for many Keil products. The FloatingUser license grants the right to use that product on several computers by several different developers at the same time. Each installation of the product requires an individual license code for each computer on which the product is installed. Installation Please check the minimum hardware and software requirements that must be satisfied to ensure that your Keil development tools are installed and will function properly. Before attempting installation, verify that you have: A standard PC running Microsoft Windows XP, or Windows Vista 1GB RAM and 500 MB of available hard-disk space is recommended 1024x768 or higher screen resolution; a mouse or other pointing device A CD-ROM drive Keil products are available on CD-ROM and via download from www.keil.com. Updates to the related products are regularly available at www.keil.com/update
12 Chapter 1.Introduction Installation using the web download 1.Download the product from www.keil.com/demo 2.Run the downloaded executable 3.Follow the instructions displayed by the sETUP program Installation from CD-ROM 1.Insert the CD-ROM into your CD-ROM drive.The CD-ROM browser should start automatically.If it does not,you can run sETUP.EXE from the CD-ROM. 2.Select Install Products Updates from the CD Browser menu 3.Follow the instructions displayed by the sETUP program Product Folder Structure The SETUP program copies the development tools into subfolders.The base folder defaults to C:KEILA.The following table lists the default folders for each microcontroller architecture installation.Adjust the examples used in this manual to your preferred installation directory accordingly. Microcontroller Architecture Folder MDK-ARM Toolset C:IKEILIARMI C166/XE166/XC2000 Toolset C:IKEILIC1661 8051 Toolset C:IKEILIC511 C251 Toolset C:IKEILIC2511 μVision Common Files C:\KEILIUV4 Each toolset contains several subfolders: Contents Subfolder Executable Program Files IBINI C Include/Header Files MNCI On-line Help Files and Release Notes IHLPI Common/Generic Example Programs IEXAMPLESI Example Programs for Evaluation Boards ABOARDSI
12 Chapter 1. Introduction Installation using the web download 1. Download the product from www.keil.com/demo 2. Run the downloaded executable 3. Follow the instructions displayed by the SETUP program Installation from CD-ROM 1. Insert the CD-ROM into your CD-ROM drive. The CD-ROM browser should start automatically. If it does not, you can run SETUP.EXE from the CD-ROM. 2. Select Install Products & Updates from the CD Browser menu 3. Follow the instructions displayed by the SETUP program Product Folder Structure The SETUP program copies the development tools into subfolders. The base folder defaults to C:\KEIL\. The following table lists the default folders for each microcontroller architecture installation. Adjust the examples used in this manual to your preferred installation directory accordingly. Microcontroller Architecture Folder MDK-ARM Toolset C:\KEIL\ARM\ C166/XE166/XC2000 Toolset C:\KEIL\C166\ 8051 Toolset C:\KEIL\C51\ C251 Toolset C:\KEIL\C251\ µVision Common Files C:\KEIL\UV4\ Each toolset contains several subfolders: Contents Subfolder Executable Program Files \BIN\ C Include/Header Files \INC\ On-line Help Files and Release Notes \HLP\ Common/Generic Example Programs \EXAMPLES\ Example Programs for Evaluation Boards \BOARDS\
Getting Started:Creating Applications with uVision 13 Requesting Assistance At Keil,we are committed to providing you with the best embedded development tools,documentation,and support.If you have suggestions and comments regarding any of our products,or you have discovered a problem with the software,please report them to us,and where applicable make sure to: 1.Read the section in this manual that pertains to the task you are attempting 2.Check the update section of the Keil web site to make sure you have the latest software and utility version 3.Isolate software problems by reducing your code to as few lines as possible If you are still having difficulties,please report them to our technical support group.Make sure to include your license code and product version number.See the Help-About Menu.In addition,we offer the following support and information channels,all accessible at www.keil.com/support' 1.The Support Knowledgebase is updated daily and includes the latest questions and answers from the support department 2.The Application Notes can help you in mastering complex issues,like interrupts and memory utilization 3.Check the on-line Discussion Forum 4.Request assistance through Contact Technical Support(web-based E-Mail) 5.Finally,you can reach the support department directly via support.intl@keil.com or support.us @keil.com You ca alays get technical support.product updates.application notes.and sample programs at www.keil.com/support
Getting Started: Creating Applications with µVision 13 Requesting Assistance At Keil, we are committed to providing you with the best embedded development tools, documentation, and support. If you have suggestions and comments regarding any of our products, or you have discovered a problem with the software, please report them to us, and where applicable make sure to: 1. Read the section in this manual that pertains to the task you are attempting 2. Check the update section of the Keil web site to make sure you have the latest software and utility version 3. Isolate software problems by reducing your code to as few lines as possible If you are still having difficulties, please report them to our technical support group. Make sure to include your license code and product version number. See the Help – About Menu. In addition, we offer the following support and information channels, all accessible at www.keil.com/support1 . 1. The Support Knowledgebase is updated daily and includes the latest questions and answers from the support department 2. The Application Notes can help you in mastering complex issues, like interrupts and memory utilization 3. Check the on-line Discussion Forum 4. Request assistance through Contact Technical Support (web-based E-Mail) 5. Finally, you can reach the support department directly via support.intl@keil.com or support.us@keil.com 1 You can always get technical support, product updates, application notes, and sample programs at www.keil.com/support
14 Chapter 2.Microcontroller Architectures Chapter 2.Microcontroller Architectures The Keil u Vision Integrated Development Environment(u Vision IDE)supports three major microcontroller architectures and sustains the development of a wide range of applications. 8-bit(classic and extended 8051)devices include an efficient interrupt system designed for real-time performance and are found in more than 65% of all 8-bit applications.Over 1000 variants are available,with peripherals that include analog I/O,timer/counters,PWM,serial interfaces like UART, IC,LIN,SPI,USB,CAN,and on-chip RF transmitter supporting low-power wireless applications.Some architecture extensions provide up to 16MB memory with an enriched 16/32-bit instruction set. The u Vision IDE supports the latest trends,like custom chip designs based on IP cores,which integrate application-specific peripherals on a single chip. 16-bit (Infineon C166,XE166,XC2000)devices are tuned for optimum real-time and interrupt performance and provide a rich set of on-chip peripherals closely coupled with the microcontroller core.They include a Peripheral Event Controller(similar to memory-to-memory DMA)for high- speed data collection with little or no microcontroller overhead. These devices are the best choice for applications requiring extremely fast responses to external events. ■ 32-bit (ARM7 and ARM9 based)devices support complex applications, which require greater processing power.These cores provide high-speed 32- bit arithmetic within a 4GB address space.The RISC instruction set has been extended with a Thumb mode for high code density. ARM7 and ARM9 devices provide separate stack spaces for high-speed context switching enabling efficient multi-tasking operating systems.Bit- addressing and dedicated peripheral address spaces are not supported.Only two interrupt priority levels,-Interrupt Request (IRQ)and Fast Interrupt Request(FIQ),are available
14 Chapter 2. Microcontroller Architectures Chapter 2. Microcontroller Architectures The Keil µVision Integrated Development Environment (µVision IDE) supports three major microcontroller architectures and sustains the development of a wide range of applications. 8-bit (classic and extended 8051) devices include an efficient interrupt system designed for real-time performance and are found in more than 65% of all 8-bit applications. Over 1000 variants are available, with peripherals that include analog I/O, timer/counters, PWM, serial interfaces like UART, I 2C, LIN, SPI, USB, CAN, and on-chip RF transmitter supporting low-power wireless applications. Some architecture extensions provide up to 16MB memory with an enriched 16/32-bit instruction set. The µVision IDE supports the latest trends, like custom chip designs based on IP cores, which integrate application-specific peripherals on a single chip. 16-bit (Infineon C166, XE166, XC2000) devices are tuned for optimum real-time and interrupt performance and provide a rich set of on-chip peripherals closely coupled with the microcontroller core. They include a Peripheral Event Controller (similar to memory-to-memory DMA) for highspeed data collection with little or no microcontroller overhead. These devices are the best choice for applications requiring extremely fast responses to external events. 32-bit (ARM7 and ARM9 based) devices support complex applications, which require greater processing power. These cores provide high-speed 32- bit arithmetic within a 4GB address space. The RISC instruction set has been extended with a Thumb mode for high code density. ARM7 and ARM9 devices provide separate stack spaces for high-speed context switching enabling efficient multi-tasking operating systems. Bitaddressing and dedicated peripheral address spaces are not supported. Only two interrupt priority levels, - Interrupt Request (IRQ) and Fast Interrupt Request (FIQ), are available
Getting Started:Creating Applications with uVision 15 32-bit (Cortex-Mx based)devices combine the cost benefits of 8-bit and 16-bit devices with the flexibility and performance of 32-bit devices at extremely low power consumption.The architecture delivers state of the art implementations for FPGAs and SoCs.With the improved Thumb2 instruction set,Cortex-Mx'based microcontrollers support a 4GB address space,provide bit-addressing (bit-banding),and several interrupts with at least 8 interrupt priority levels. Selecting an Architecture Choosing the optimal device for an embedded application is a complex task.The Keil Device Database (www.keil.com/dd)supports you in selecting the appropriate architecture and provides three different methods for searching.You can find your device by architecture,by specifying certain characteristics of the microcontroller,or by vendor. The following sections explain the advantages of the different architectures and provide guidelines for finding the microcontroller that best fits your embedded application. 8051 Architecture Advantages Fast I/O operations and fast access to on-chip RAM in data space Efficient and flexible interrupt system Low-power operation 8051-based devices are typically used in small and medium sized applications that require high I/O throughput.Many devices with flexible peripherals are available,even in the smallest chip packages. Cortex-M0 devices implement the Thumb instruction set
Getting Started: Creating Applications with µVision 15 32-bit (Cortex-Mx based) devices combine the cost benefits of 8-bit and 16-bit devices with the flexibility and performance of 32-bit devices at extremely low power consumption. The architecture delivers state of the art implementations for FPGAs and SoCs. With the improved Thumb2 instruction set, Cortex-Mx1 based microcontrollers support a 4GB address space, provide bit-addressing (bit-banding), and several interrupts with at least 8 interrupt priority levels. Selecting an Architecture Choosing the optimal device for an embedded application is a complex task. The Keil Device Database (www.keil.com/dd) supports you in selecting the appropriate architecture and provides three different methods for searching. You can find your device by architecture, by specifying certain characteristics of the microcontroller, or by vendor. The following sections explain the advantages of the different architectures and provide guidelines for finding the microcontroller that best fits your embedded application. 8051 Architecture Advantages Fast I/O operations and fast access to on-chip RAM in data space Efficient and flexible interrupt system Low-power operation 8051-based devices are typically used in small and medium sized applications that require high I/O throughput. Many devices with flexible peripherals are available, even in the smallest chip packages. 1 Cortex-M0 devices implement the Thumb instruction set