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

Micro Lab Experiment#1

Uploaded by

Umair Hameed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views

Micro Lab Experiment#1

Uploaded by

Umair Hameed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

EXPERIMENT-1

KEIL µVISION-3 IDE & TRAINER BOARD

OBJECTIVE:
 To learn to compile and debug a program in Keil μVision3 IDE.
 To be able to serially download the program to the Flash memory of 89C52
microcontroller using the RIMS ® Trainer Board and the PC serial port.
 To run a simple code using the trainer board.

EQUIPMENT:
 ATMEL ® 89C52 Microcontroller
 Microprocessor Trainer Board

INTRODUCTION TO THE TRAINER RIMS TRAINER:

DEV-2763E Intel Architecture Based μ-Controller Trainer


This section would give you a brief introduction of the DEV-2763E
The DEV-2763E has two main panels: the front panel and back Panel. Each panel hasbeen
explained in detail below:
1. LCD Display: HD44780 Based Text LCD Display for 16x2 characters.
2. Variable Reference: Positive and negative reference voltage is available for application
such as A/D Converters etc.
3. Potentiometers: 1k and 80k For applications where variable resistor is required for low
(1K) or high (80K) resistance range
4. Offset: Knob for adding DC offset to the function generator waveform
5. Amplitude: Knob for varying the amplitude of the function generator output waveform
6. Fine: Knob for fine-tuning the selected frequency of the function generator output waveform
7. Range: Knob for selecting the frequency range of the function generator waveform out of
100Hz, 1KHz, 10KHz and 100KHz
8. Function: Knob used to select one of the three output waveform types: sine, square and
triangular
9. Power LED: Indicates that the trainer is powered-up
10. Probe LED’s: Two LED’s for indicating TTL High or Low levels picked up by the logic
probes.
11.
a. FM-IN Socket for input of any frequency-modulating signal
b. Waveform Socket for function generator output waveform.
c. Clock Socket for clock generator output
d. AM-IN Socket for input of any amplitude-modulating signal
12. Status LED's: Eight LED’s for indicating presence of TTL high logic level available at the
corresponding input point on the sockets.
13. Logic Switches: Eight logic switches for providing TTL logic levels high (5V) and low (0V)
at the corresponding output point of the sockets.
14. Digital Input/output: Eight sockets for output of the logic switches and providing logic
input.
15. Buzzer: For testing audio signals.
16. Serial EEPROM Jumper: To write and protect the programmable IC 24C08 in the trainer.
17. Relay Block One electronic relay that operate with 5V DC control voltage.
18. +12VDC Socket for +12VDC fixed.
19. +5VDC Socket for +5VDC fixed.
20. GND Socket for ground.
21. -5VDC Socket for -5VDC fixed.
22. VDC: Socket for -12VDC fixed.
23. RS-232: Port for serial interface to a PC serial port (RS-232 based).
24. Programmer: For Programming ATMEL ® 89CXX series Micro-controllers.
25. Clock Jumper: For clock generator to enable and disable output.
26. Extension Connector: Socket for extending pin connections 1-20 of Micro-controller to
other connections on the Trainer
27. Micro-controller: Socket to house the ATMEL ® 89C5x series Micro-controller.
28. RS-232 Interface Selector: A two-position switch to select between Micro-controller IC and
the Programmer. Only one device can have access to the serial interface.
29. Reset: Push-button for resetting the micro-controller output to the LCD display.
30. Soft keys: Three push buttons for soft menu selection from the LCD display.
31. HD-44780 LCD Interface: Interface to the LCD pins.
32. LCD Power Switch: Used to On and Off the LCD.

It consists of following features/connections:


1. Fuse
2. ON/OFF Switch
3. AC input point
4. Speaker: A standard speaker. Its input can be connected at the socket mentioned in
description of the Front Panel.

KEIL μVision-3IDE:

Steps for Creating the First Project


 Keil μVision3 is a standard Windows application and started by clicking on the program
icon. To create a new project file select from the μVision3 menu Project – New
Project… Create a new folder and enter the file name for the new project, e.g. Project1.
μVision3 creates a new project file with the name PROJECT1.UV2 that contains a
default target and file group name. You can see these names in the Project Window –
Files.
 Now use from the menu Project – Select Device for Target and select a CPU for your
project. The Select Device dialog box shows the μVision3 device database. Just select the
microcontroller you use. We are using for our examples the AT89C52/ AT89S52. This
selection sets necessary tool options for the 89C52 device and simplifies in this way the
tool configuration.
 You may create a new source file with the menu option File – New. This opens an empty
editor window where you can enter your source code. Create a new file called
Project1.asm.
 Once you have created your source file you can add this file to your project. μVision3
offers several ways to add source files to a project. For example, you can select the file
group in the Project Window – Files page and click with the right mouse key to open a
local menu. The option Add Files opens the standard files dialog. Select the file
Project1.asm that you have just created.
 Typically, the tool settings under Options – Target are all you need to start a new
application. When you build an application with syntax errors, μVision3 will display
errors and warning messages in the Output Window – Build page. A double click on a
message line opens the source file on the correct location in a μVision3 editor window.
 Once you have successfully generated your application you can start debugging.
 After you have tested your application, it is required to create an Intel HEX file to
download the software into an EPROM programmer or simulator. μVision3 creates HEX
files with each build process when Create HEX file under Options for Target – Output
is enabled.

Steps to download the project to the Micro-Controller memory


 Connect the serial cable between the PC serial port and the Trainer Board.
 Enable the serial programming by setting the “RS232 Interface switch” on the trainer to
“PRG” mode.
 Insert the microcontroller in the Programmer jack.
 Run the program “EZ Download” from the PC.
 Follow the onscreen instructions to download the HEX file of the project to the
microcontroller.

PROCEDURE:

Type the following code in a.asm file and follow the above procedure to compile your first
project, and then program the 89C52 microcontroller.
ORG 0H HARDWARE SETUP
STARTLOOP: CPL P1.0  Connect the Pin of P1.0 to an LED socket on the board.
CALL DELAY  Insert the microcontroller into the proper socket (28 in
JMP STARTLOOP Figure-1).
DELAY:  Power up the board.
MOV R0, #7  The LED should blink once a second.
LOOP1: MOV R1, #255  You can test the output on the oscilloscope as well.
LOOP2: MOV R2, #255
DJNZ R2, $
DJNZ R1, LOOP2
POST LAB QUESTIONS:
DJNZ R0, LOOP1
RET Answer the following questions:
END 1. What is the difference between microprocessor and
microcontroller?
2. What is an instruction?
3. What is an instruction set?
4. Define machine cycle and explain in the context of 8051
5. What are the different groups of instructions supported by 8051?

You might also like