Create Project File: Sandeep B
Create Project File: Sandeep B
3. Set Options for Target explains how to specify relevant parameters for your target.
4. Create Source File describes how to add new files to the project.
5. Configure a Target
Configure ARM 7 Target describes how to change the startup-code and how to use the library
retarget file for ARM 7 devices.
Configure Cortex-M Target describes how to change the startup-code and how to use the
library retarget file for Cortex-M devices. In addition, this is a brief explanation of CMSIS.
6. Create File Group explains how to structure the code files for a better overview.
7. Specify Memory Layout describes how to change file and group attributes.
µVision4 maintains the files that belong to a project in one project file. It takes only a few steps to
create a new project file with µVision4:
Sandeep B Page 1
3. Switch to the new folder and type the project name Test1. µVision4 automatically adds the
extension .uvproj.
4. Click Save & Select Device for Target ‘Target 1’ is opened, select NXP (founded by Philips)
When you create a new project, µVision4 asks you to select a microcontroller. This step
customizes the µVision4 environment with pre-configured options and sets the tool options,
peripherals, and dialogs for that particular device. The Select Device for Target dialog
shows the µVision Device Database.
Select the microcontroller you use. For this example, choose the NXP(founded by philips)
Sandeep B Page 2
Select the device LPC 2148 and click OK as shown below
Click NO
Click YES
Note
Sandeep B Page 3
Set target parameters in the dialog By Right Click on Target- Options for Target - Target.
1. Click on output tab and select the Create Hex File option
2. Click on Target tab and select the microlib option
3. Click on LINKER TAB and select the USE MEMORY LAYOUT option
As shown below
Sandeep B Page 4
Open the dialog via the toolbar icon or the menu Project - Options for Target.
Click on new document for writing the program & save the code with .c extension.
Sandeep B Page 5
Expand the Target 1 in the Project folder
Sandeep B Page 6
Right click on the source Group1 & select Add Files to Group ‘Source Group 1’. Select the file from the
folder where project is saved & click on add.
Build Project
Build the project once the coding is done and check for errors. For building the project click F7 or click
on below shown option.
Sandeep B Page 7
1. Translate and link the source files of the application with a click on one of the build-
buttons located in the Build Toolbar.
2. Errors or warnings are displayed in the Build Output Window. Double-click on a message to
jump to the line where the incident occurred.
3. Once you have generated your application successfully, you can start debugging.
Debug Application
Sandeep B Page 8
Click on Select Device Button , expand Arm option & select the device LPC 2148
Select the COM Port Name, follow these Steps for knowing the PORT Name
a. Insert one end of the USB cable to the USB Port and Other end to kit.
Sandeep B Page 9
b. Right Click on My Computer option from the desktop and select Manage Option as shown in the
below figure.
c. Click on Manage button and select the Device Manager Option as shown below
d. Expand Ports option on the right hand side to see the Serial port name of the USB Connected.
For Example : USB Serial Port(COM9)
Sandeep B Page 10
Once the PORT name is known Select from COM Port dropdown, enter the Oscillator (MHz) to
12.0 & check the Erase blocks Used by Hex file.
Sandeep B Page 11
e. Select the program from the desktop machine on click of Browse button
f.
Sandeep B Page 12