You are on page 1of 3

Configuring uVision2 to Use Any Drive

uVision2 places all files in the drive:/folder specified by the user when a New Project is defined. The drive used must be one that can be written to. Identify or create a new folder on the desired drive and start uVision2. Open the Projects menu and select New Project. A Create New Project Window will appear with a Save in box where the project files are to be stored. Browse until the desired disk and folder are found and type in a project name (this book uses "8051 Microcontroller Projects"). Click the Save button. A uVision2 project (.UV2) file has now been created in the folder, along with a project log (.PLG) file. The Files window will show a "Target 1" folder, and a "Select Device for Target 'Target 1' " window will appear. Browse to the Intel folder, open it, and select 8051AH (unless some other microcontroller is to be used). Expanding the Target 1 folder in the Files window shows that it contains a sub-folder named "Source Group 1." Both the Target 1 and Source Group 1 folders may be renamed to suit the user as follows: Open the Project menu and click on Targets, Groups, Files. Type a new target name into the Add box and Add it. Click on the new target name in the Available Targets box and Set as Current Target. Click on the Target 1 name and Remove Target. Select the Group/Add Files tab. Type a new group Name in the Group to Add box and Add it. Click on the Source Group 1 name in the Available Groups box and Remove Group. Click on the new group name and click Add Files to Group button. Type in the name of the new source file in the File name box, using name.a51 format. Select Asm Source files from the Files of type box. Click the Add button. Close all windows and note that all names have changed to the new ones selected. Unless an assembly code source program with the same name as the one typed into the File name box exists, it must be created. (A red "X" next to the source file name indicated uVision2 can not find it). To create a source file, go to the File drop down menu and select New. An empty Text file window appears in the file space. Type in an assembly code source program and Save As the file using the same name as the new source file used in the sequence above. Close the project and then Open it again. The red X should be gone and the new source file is ready to be assembled and debugged.

Generating Source Program Listing Files (To use the next two steps, click on the Target name to get Target Options)
uVision2 will not unconditionally generate a listing file that contains assembler results unless conditional listing for the project is disabled. To enable listing, go to the Project menu and select Options for Target 'name'. From the Options window. Select the Listing tab and clear the check from the Conditional box found in the Assembler Listing area.

EPROM Programming Using uVision2 HEX Output Files


If EPROMs are to be programmed, a project.HEX file must be created by uVision2. Go to the Project menu and select Options for Target 'name'. From the Options window, select the Output tab and check the Create HEX File box before closing the window.

uVision2 Disk Files


uVision2 creates seven project-named files (eight if a HEX file is made) in the drive/folder specified when a project is assembled and debugged. Two source program-named files (name.a51) are also produced. All project files created by uVision2 have the root name given to the project. For example, the book project is named "8051 Microcontroller Projects." uVision2 makes the following project-specific files: 8051 Microcontroller Projects.UV2 - Used to load the project on start-up 8051 Microcontroller Projects.OPT - Options chosen for the project 8051 Microcontroller Projects_Uv2.BAK - Project file backup 8051 Microcontroller Projects_Uv2_Opt.BAK - Options file backup 8051 Microcontroller Projects.HEX - An Intel hex file for burning EPROMS 8051 Microcontroller Projects.PLG - Project activity log file 8051 Microcontroller Projects.M51 - Linker map file
2

8051 Microcontroller Projects uVision2 information file The two files generated from the source assembly code file are used in debugging. For example, the source file used in the book is Student.a51. Files generated from this source file are: Student.OBJ - A binary file used by the debugger to test the program Student.LST Summary of assembler operation; very useful in finding errors

You might also like