Professional Documents
Culture Documents
(Microcontroller Tools)
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 1
KEIL: This software is used to write the microcontroller code and
to simulate it on the computer itself. It is also used to generate the
hex code for the code written in ALP/C.
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 2
How to use keil:
After installing the software when you open the „keil‟ , one window
will appear as shown in figure below.
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 3
Selecting the device: After saving the project the window will
appear which will ask for selecting the device, then 1st select the
company “philips” or “ nxp” and then select the device number
„P89V51RD2‟ (image below).
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 4
After selection of device, one more window will appear to copy the
start up code .after clicking it „ok‟ the project format is ready to
simulate the code.
Then after click the „new file‟ in the FILE menu. Then a new file will
appear in which we write our code in any programming language like C
or ALP. The window will appear as shown below.
after writing the code we need to save it. For the code written in „C‟
we need to save the file with the extension „.c‟ (i.e. the file is stored
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 5
as filename.c) .the code written in ALP(assembly language
programming) has to save with the extension of „.a‟
after saving the file we need to add the written code in our project.
For that right click of mouse on „source group 1‟ ,the option „Add
files to group „source group1‟ will appear.
After completing all these stuff now its time to simulate your code n
check its output with the given input.
For that click the „debug‟ option and click „start/stop debug session‟
then the following window will appear.
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 6
the keil we use having limitation to simulate the maximum code size
2KB.this window is just for a warning msg, so, just press „ok‟ for that
option(image above). After that the project is ready to run.
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 7
Testing of code : code can be tested on computer itself. After
selecting the port, just press „run‟ on the window. and give the input
to the port and the corresponding output will automatically appear
on other port..
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 8
After adding the file we need to compile it. The compilation can be done by
first click „translate current file‟ and then
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 9
Click „built target‟ it will generate the hex code (image above) . But
before that we need to change the settings. For that go to „project‟
option and then click „Options for Target ‟target 1‟‟.A new window will
appear as shown below.
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 10
Here we need to change the „Xtal(MHz): Here fill the frequency of
crystal which we are going to use. For the microcontroller which we
are using the crystal that we are using is having crystal frequency
12MHz.and click the option for „Use On-chip ROM(0x0-
0xFFFF)‟.then click the „Output‟ tab where we have to select the
option „Create HEX File‟. After that we can translate the current
file and built target will gene
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 11
Flash Magic : Flash Magic is Windows software, through which
microcontroller is easily programmed using „In-System Programming‟
technology to all the ISP feature empowered devices.
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 12
If we need to verify the proper dumping of the program in the
microcontroller then we need to set the „verify after program‟
option (not mandatory).
Loading of hex file: after selecting device we load the hex file in
the given block by using the „browse‟ option on the „FLASH MAGIC‟
window.
ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 13