How to make .hex file by keil
In the previous topic I had discuss about how to use keil compiler to code for 8051. In this topic I shall show you how to make a hex file to simulate or run your code in simulator like proteus.
Proteus is a strong simulator have various type of ICs and electronic gadgets. By this software you can test your code. Is your code working in hardware or not you can see by this software. If you want to test your code in simulator like this you have to make your code in hex format then you can put your hex formatted code into the specific microcontroller by this type simulator.
when your code is ready to test I mean when you see the 0 error and 0 warnings in the output message of keil, then click on Flash from menu bar. Then click on Configure Flash Tools… ,
Then a window will appear named Option From Target ‘Target1’. Now click on Target from the menu bar of that window.
Now you can see a combo box named Xtal (MHz). In this combo box the initial value is written is 33.0. Now you have to change your value. The value should be the exact value of oscillator frequency of your chosen microcontroller. I have taken Atmel AT89s52. The oscillator frequency of that microcontroller is 11.0592. So I have to write 11.0592 in the place of 33.0 .
After doing so you have to click on Output. Then you can see this..
In this window you have to tick in the Creat HEX File check box. Now you have done your settings portion. Now click ok.
Now you have to run your code by clicking Build all icon, which should be right side of Build icon.
After clicking on build all icon, in the output window you can see a extra line Creating hex file from” your project name”
Now a .hex file should be added in your project window. You can use it for simulator like Proteus.
In the next episode I will discuss about different types of interfacing in 8051 and keil, so keep viewing my blog.
Thank you for visiting my blog, if you have any question about this topic or you want say something about this topic please comment…..
No comments:
Post a Comment