You are on page 1of 13

USER MANUAL

(Microcontroller Tools)

Robotics Core School

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.

User Vs machine (microcontroller): as the microcontroller know only


about the digital value (i.e. either logic zero or one), so we need to
convert the written code in the sets of zero and one. The KEIL
environment provides us the facility to convert the code written in
C/ALP to sets of zero n one (i.e. called hex code).

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.

Create a new project: To create a new project go to „project‟ option


then click the „new project‟ option. It will ask to save the project in
your desired folder. The entire project is saved in the „Uv2‟ format
with the extension of Uv2.

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.

The microcontroller is having 4 ports. Each port is having 8 pins.


Each port can be used either as input or output port.
By using keil integrated development environment we can check all
the input and output on computer itself.
For that when your project is ready to run then click the option
„peripheral‟ then go to „I/O ports‟ and then select the ports which all
are required.

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.

After installing the software when we click on the icon of the


software the window will open on the screen as shown in figure
above. We need to change the device and have to select the device
that we are using. Here we will select 89V51RD2 , and then we set to
‘erase all flash’ option on the flash magic window.

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.

Programming of device: after loading the file next step is dumping of


code in microcontroller. For that we first connect the computer‟s
serial port to your microcontroller board through serial cable. Then
after give the power supply to the microcontroller board.
Now its time to dump the code in controller.. Press the start
option on your flash magic window. Then your microcontroller will be
programmed in few seconds.

ROBOTICS CORE SCHOOL (A UNIT OF MATA SHAKUNTALA DEVI MANAV VIKAS SANSTHAN ) rcs.cera.co.in
Page 13

You might also like