Digital Code Lock

Will be uploaded very soon...

DTMF based device switching

Will be uploaded very soon..

DTMF based robot controll

Will be uploaded soon..

Showing posts with label Software. Show all posts
Showing posts with label Software. Show all posts

Monday, January 21, 2013

Generating Hex file using Keil

Earlier i posted about Intel hex file and different components in it. And now here i am posting about how to generate hex file using Keil software. Keil is the all in one simulator which is most popular in embedded lovers as well as in industry. By using keil you can develop your source code in both the languages that is assembly language and C language but the hex file is common for both.

So first make sure that there is no error in your source code and if there is any then make it solve. Now just follow the below steps use screenshot if you find any difficulty.

Step-1: In menu bar navigate to Project >> Options to target and click on it or in project workspace window right click on Target1 >> Options for target and new window appears on your desktop.



Steps-2: In Options for Target window go to Target tab and enter the value of your crustal frequency in Xtal field. Make sure that you enter this in MHz.



Steps-3: Now go to Output tab and just tick mark the Create HEX file check box and hit ok.


Now just rebuild your target and you are done. your hex file is generated in the same folder in which your project file is located.

Important Note: Keil does not provide any path selection option for storing generated hex file. it is automatically store it in the same folder which contains your project file.

Now you can burn this hex file into ROM of micro-controller..

Please share this with your friend...

Introduction to Flash Magic

Before few days i posted about Intel hex file and how to generate hex file using keil simulator. If you dont know about this things then you can go through following links...


Flash Magic is a tool which used to program hex code in EEPROM of micro-controller. it is a freeware tool. It only supports the micro-controller of Philips and NXP. You can burn a hex code into those controller which supports ISP (in system programming) feature. To check whether your micro-controller supports ISP or not take look at its datasheet. So if your device supports ISP then you can easily burn a hex code into EEPROM of your device.

Flash magic supports several chips like ARM Cortex M0, M3, M4, ARM7 and 8051. You can found list of supported devices from HERE

The procedure to program code memory is very easy and needs only five steps to configure Flash magic for better operation. Flash magic use Serial or Ethernet protocol to program the flash of device. Below is the screenshot of flash magic.


Now here i am going to show you how to use this tool and configure it. First of all go to options and then go to advanced options.


then keep following setting in all different tabs of Advanced setting.









After configuring above settings then just go to following 5 steps..

Step-1 Communication:


1) Select your target device
2) Select your com port and if you are using USB to serial converter make sure that you will select proper com port other wise you can not communicate
3) Now select baud rate ideally it should be 9600 (recommended). Avoid higher than 9600 for proper communication
4) Now select your interface if you are using DB-9 then it will be None (ISP)

Step-2 Erase:


Now here tick mark the Erase all Flash option. This is the most crucial thing because wrong selection in this step can be result into lost of boot loader in your chip. Nothing to worry if you lost your boot loader because you can again load it but to load boot loader you must program you chip through universal programmer or any other programmer which is not depend upon boot loader for loading hex code. After loading boot loader you can again able to program your chip using flash magic.

Step-3 Hex file:


This is very simple and you need to set up a path of your Hex file which is to be loaded on chip.

Step-4 Options:



In this always keep Verify after programming option enable by tick mark. You can use another features as well according to your need.

Step-5 Start:


Now you are all set to burn your code memory just click on start but and it will start to load hex code in your chip. You can see the process at the bottom.


Do comment if you found any trouble or problem to understand.

Download

Share this with your friend...