0% found this document useful (0 votes)
52 views

Keil Software For Arm Program

The document provides details about installing and using Keil μVision4 and Flash Magic software. It explains how to create a new project in Keil μVision4, write and build code, simulate programs, and generate hex files. It also gives instructions for installing and using Flash Magic to program and erase flash memory on LPC2148 microcontrollers.

Uploaded by

dhyaviii
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Keil Software For Arm Program

The document provides details about installing and using Keil μVision4 and Flash Magic software. It explains how to create a new project in Keil μVision4, write and build code, simulate programs, and generate hex files. It also gives instructions for installing and using Flash Magic to program and erase flash memory on LPC2148 microcontrollers.

Uploaded by

dhyaviii
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

INTRODUCTION TO KEIL µ VISION 4 SOFTWARE

The µ Visio n4 IDE is a Windows-based software development platform that


combines a robust editor, project manager, and makes facility. µVisi on4 integrates all tools including the
C compiler, macro assembler, linker/locator, and HEX file generator. µVisio n4 helps expedite the
development process of your embedded applications by providing the following:

 Full- featured source code editor



 Device database for configuring the development tool setting

 Project manager for creating and maintaining your projects

 Integrated make facility for assembling, compiling, and linking your embedded applications 

 Dialogs for all development tool settings

 True integrated source- level Debugger with high-speed CPU and peripheral simulator

 Advanced GDI interface for software debugging in the target hardware and for connection
to Keil ULINK

 Flash programming utility for downloading the application program into Flash ROM

 Links to development tools manuals, device datasheets & user‟s guides

The µ Vision4 IDE offers numerous features and advantages that help you quickly and
successfully develop embedded applications. They are easy to use and are guaranteed to help you
achieve your design goals.

The installation steps for keil software are given below:

1. Double click on Keil µvisio n4.exe file.


2. Then click on Next.
3. Tick the check box towards to license agreements and click Next.
4. Select Destination folder and click Next.
5. Fill the necessary text boxes and click Next.
6. Finally click on Finish.

Software Flow

First open the icon keil µvis ion4 and the follow the steps are given below. The menu
bar provides you with menus for editor operations, project maintenance, development tool option
settings, program debugging, external tool control, window selection and manipulation, and on- line help.
The toolbar buttons allow you to rapidly execute µ Vision4 commands. A Status Bar provides editor and
debugger information. The various toolbars and the status bar can be enabled or disabled from the View
Menu commands.

29
Creating a New Project

Below mentioned procedures will explains the steps required to setup a simple application and to generate
HEX output.
STEP 1: Go to “Project” and close the current project “Close Project”.

STEP 2: Go to the “Project” and click on “Ne w µ vision Project”

30
STEP 3: A small window will pop up with name “Create New Project” and can be create and select
destination path.

STEP 4: Create a folder and give a proper name that can be related to the Project.

31
STEP 5: A small window will pop up with name “Select Device for Target „Target 1‟”, and select the
data base NXP founded by Philips.

STEP 6: Within the NXP founded by Philips select LPC2148.

32
STEP 7 : Add Startup file to the project by clicking “Yes”.

STEP 8: Next go to “File” and click “Ne w”.

33
STEP 9: There are the main three windows are available in the keil IDE. First one is Project Workspace,
second one is Editor Window and third one is Output Window.

STEP 10: Can be start to write *.asm/c code on the editor window.

34
STEP 11 : Can be save the file, if the program is in “C” save as “filename.C” or else save as “filename.ASM”.

STEP 12: Add this source file to Group1, Go to the “Project Workspace ” drag the +mark “Target 1” in
that right click on “Source Group1” and click on “Add Files to Group “Source Group1””.

35
STEP 13: A small window will pop up with name “Add Files to Group Source Group1”, by default, the
Files of type will be in C source Files (*.C). If the program is in C, have to select C source Files (*.C) or
select ASM Source file (*.s,*.src,*.a*).

STEP 14: Then go to “Project” click on “Build Target” or F7. Output window will display related error and
warning messages.

36
Simulation
Part:

STEP 15: Go to “Project” menu, click on “Rebuild all target Files” and start Debug. From View menu can
get Memory Window and from Pe ripherals can get I/O ports, Serial etc. For access internal memory type
i:0x_me mory location example: i:0x30 and for external and program memory x:0x_me mory location,
c:0x_memory location respectively. From Register window we can edit and access the values also.

37
HEX file creation:

STEP 16: Follow the STEP up to 14, then go to “Project” and click on “Option for Group „Source
Group1‟”. There a small window will open with name “Option for Target „Target1‟”. In that window, go to
first menu “Device”, can be select LPC2148.

STEP 17: Next go to Target menu, set clock frequency as 12.0 MHz and select Thumb mode in the code
generation selection box.

38
STEP 18: Then go to Output menu and click on create HEX file.

STEP 19: Then go to Listing menu and select C preprocessor Listing.

39
STEP 20: Finally in the Linker menu, click on use memory layout from target dialog and click ok.

STEP 21: For creating Hex file go to “Project” menu and click on “Rebuild all target Files”

40
FLASH MAGIC
Introduction :

NXP Semiconductors produce a range of Microcontrollers that feature both on-chip Flash
memory and the ability to be reprogrammed using In-System Programming technology. Flash Magic is
Windows software from the Embedded Systems Academy that allows easy access to all the ISP features
provided by the devices.
These features include:

 Erasing the Flash memory (individual blocks or the whole device)



 Programming the Flash memory

 Modifying the Boot Vector and Status Byte

 Reading Flash memory

 Performing a blank check on a section of Flash memory

 Reading the signature bytes

 Reading and writing the security bits

 Direct load of a new baud rate (high speed communications)

 Sending commands to place device in Bootloader mode

Flash Magic provides a clear and simple user interface to these features and more as described in
the following sections. Under Windows, only one application may have access the COM Port at any one time,
preventing other applications from using the COM Port. Flash Magic only obtains access to the selected COM
Port when ISP operations are being performed. This means that other applications that need to use the COM
Port, such as debugging tools, may be used while Flash Magic is loaded. Note that in this manual third party
Compilers are listed alphabetically. No preferences are indicated or implied.

41
Installation Procedure for Flash Magic software:

Installation steps are given below:

1. Double click on Flash Magic.exe.


2. Then click on Next.
3. Next accept the agreement and click on Next.
4. Select the destination folders and click on Next then Install.
5. Finally click on Finish.

Programming with communication port


(COM1):

STEP 22: For programming with communication port, first select the device LPC2148 in ARM 7 category,
COM port will be COM 1, baud rate 9600, interface None [ISP], Osc illator frequency 12.0 MHz and click on
erase of flash code Rd plot.

42
STEP 23: Under the menu Options, go to Advanced options.

STEP 24: Under the menu Advanced options, go to Hardware configuration, click on the Use DTR and RTS
to control RST and ISP pin.

43
STEP 25: Next browse the path of hex file and select the file.

STEP 26: After selecting ISP mode on the Hardware Kit and click on start.

44
STEP 27: After the above steps device will start to program.

STEP 28: Finally can be see the finished indication and Reset the device into running mode.

45
Programming through USB:

Installation Procedure for USB Cable Driver:

The installation steps are given below:

STEP 1: Connect the USB cable between ARM-7 LPC2148 Trainer Kit and PC. Connect the power supply to
the trainer kit and power up. After can see a popup window with name “Found New Hardware CP2102 USB
to UART Bride Controller“.

STEP 2: Select on Install from a list or specific location (Advanced) and click “Next”.

46
STEP 3: Browse for the driver file location and select the folder, click next.

47
STEP 4: After that can see New Hardware wizard, and then click on finish.

STEP 5: Then right click on My Computer and select manage.

48
STEP 6: Then go to device manager, in that we have to select ports (COM and LPT) . There
we have to find the COM port which has been selected for USB cable. The same COM has to
be select for Flash Magic.

STEP 7: Repeat the STEP from 22 to 28

49

You might also like