keil user manual

26
Keil uVision 4 Software Development Kit (SDK) for 8051 based microcontrollers User Manual Ver 2.3 for EE 309L, IITB Compiled by: Vinayak G P, Deepak Malani

Upload: rohal-sahu

Post on 28-Oct-2014

158 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Keil User Manual

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

• 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

Installation

• The installation procedure is straight forward. Just follow on-screen instructions.

• Once installation is complete, open Keil uvision4.

Page 4: Keil User Manual

Start > Programs > Keil uVision4Start with creating a new project

Page 5: Keil User Manual

Name of your project;several files can be added as part of a project

Page 6: Keil User Manual

Our boards use Atmel Microcontroller

Page 7: Keil User Manual

From Atmel family, we use 89C5131A microcontroller

Page 8: Keil User Manual

Selecting “Yes” includes an automatically generated startup code to the project.

Page 9: Keil User Manual

Go to File>New to create a newsource file

Page 10: Keil User Manual

< Type your code here>

Page 11: Keil User Manual

Write the assembly code and save it as an .asm file

Page 12: Keil User Manual

To compile/build the code you have to add the .asm file to yourproject.

Page 13: Keil User Manual

“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

Build status display, Errors & Warnings

Page 15: Keil User Manual

Only after successfully building the project, run the executable file.<dir>filename.obj is theexecutable binary.

Page 16: Keil User Manual

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

Memory WindowRegister Window

machine code and opcode

Page 18: Keil User Manual

Execution can be done in different ways as canbe seen in theDebug drop-down menu.

Page 19: Keil User Manual

d: refers to data memory

c: refers to code segment of the memory

Page 20: Keil User Manual

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

The Registers window provides access to all the registersincluding the flagregister , DPTRs etc.

Page 22: Keil User Manual

If some windows are not being displayedthen use the “View” menu to get them onthe window.

Page 23: Keil User Manual

To set a breakpoint,click in the marked areaagainst thecorresponding code of line.

Page 24: Keil User Manual

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

To generate HEX file

• Click on the “Target Options…” icon showed below.

Page 26: Keil User Manual

1. Browse to “Output” tab

2. Check the “Create Hex File” option.