Micro Lab Experiment#1
Micro Lab Experiment#1
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
KEIL μVision-3IDE:
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?