Download - Keil User Manual
![Page 1: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/1.jpg)
Keil uVision 4Software Development Kit (SDK) for 8051 based microcontrollers
User Manual Ver 2.3 for EE 309L, IITBCompiled by: Vinayak G P, Deepak Malani
![Page 2: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/2.jpg)
• To download Keil uvision4, goto www.keil.com/download/product/ and click on C51(development tools for all 8051 devices.
• You will be asked fill in a form, after which you can download the software.
![Page 3: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/3.jpg)
Installation
• The installation procedure is straight forward. Just follow on-screen instructions.
• Once installation is complete, open Keil uvision4.
![Page 4: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/4.jpg)
Start > Programs > Keil uVision4Start with creating a new project
![Page 5: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/5.jpg)
Name of your project;several files can be added as part of a project
![Page 6: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/6.jpg)
Our boards use Atmel Microcontroller
![Page 7: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/7.jpg)
From Atmel family, we use 89C5131A microcontroller
![Page 8: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/8.jpg)
Selecting “Yes” includes an automatically generated startup code to the project.
![Page 9: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/9.jpg)
Go to File>New to create a newsource file
![Page 10: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/10.jpg)
< Type your code here>
![Page 11: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/11.jpg)
Write the assembly code and save it as an .asm file
![Page 12: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/12.jpg)
To compile/build the code you have to add the .asm file to yourproject.
![Page 13: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/13.jpg)
“Build”ing the project (all the files included in the project)
compiles the code for the chosen microcontroller as target device
![Page 14: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/14.jpg)
Build status display, Errors & Warnings
![Page 15: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/15.jpg)
Only after successfully building the project, run the executable file.<dir>filename.obj is theexecutable binary.
![Page 16: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/16.jpg)
This is a free evaluation version of the development kit.The licensed version costs about 2000 pounds.
Clicking “OK” will take you into debug mode, where your code can be executed and the contents of various memorylocations, ports and registers can be observed.
The execution can also be done in one-go or bysingle stepping.
![Page 17: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/17.jpg)
Memory WindowRegister Window
machine code and opcode
![Page 18: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/18.jpg)
Execution can be done in different ways as canbe seen in theDebug drop-down menu.
![Page 19: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/19.jpg)
d: refers to data memory
c: refers to code segment of the memory
![Page 20: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/20.jpg)
After starting the execution, user can right click on the required memory location in the memory window to modify RAM data.You also have other functionalities like selecting the number system in which the memory contents are to bedisplayed.Note: to initialize memory values on hardware, user has to add necessary instructions in the program code.
![Page 21: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/21.jpg)
The Registers window provides access to all the registersincluding the flagregister , DPTRs etc.
![Page 22: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/22.jpg)
If some windows are not being displayedthen use the “View” menu to get them onthe window.
![Page 23: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/23.jpg)
To set a breakpoint,click in the marked areaagainst thecorresponding code of line.
![Page 24: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/24.jpg)
The breakpoint set isshown as a red dot against the line.
As can be seen, the breakpoint is automaticallydisplayed at the equivalentline in the disassembly window too.
![Page 25: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/25.jpg)
To generate HEX file
• Click on the “Target Options…” icon showed below.
![Page 26: Keil User Manual](https://reader035.vdocuments.mx/reader035/viewer/2022081716/54508c89af7959fb088b4d1d/html5/thumbnails/26.jpg)
1. Browse to “Output” tab
2. Check the “Create Hex File” option.