[go: up one dir, main page]

0% found this document useful (0 votes)
10 views54 pages

8051 Lab Pgms

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views54 pages

8051 Lab Pgms

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

INTRODUCTION

Earlier to Microcontrollers, Microprocessors were greatly used for each and


every purpose. Microprocessors were containing ALU, general purpose register, stack
pointer, program counter, clock counter and so many other features which the today’s
Microcontroller also possesses. But the difference between them exists with respect to
the number of instructions, access times, size, reliability, PCB size and so on.
Microprocessor contains large instruction set called as CISC processor whereas
Microcontroller contains less number of instructions and is called as RISC processor.
The access time is less in case of microcontrollers compared to microprocessors and
the PCB size reduces in case of microcontrollers.
There are many versions of microcontrollers 8051, 80528751, AT8951 from
Atmel Corporation and many more. In this manual we will study about the 8051

architecture, its features, programming and interfacing.


MCS 8051 is an 8-bit single chip microcontroller with many built-in functions
and is the core for all MCS-51 devices.
The main features of the 8051 core are:
 Operates with single Power Supply +5V.
 8-bit CPU optimized for control applications.
 16-bit program counter (PC) and 16-bit data pointer (DPTR).
 8-bit program status word (PSW).
 8-bit stack pointer (SP).
 4K Bytes of On-Chip Program Memory (Internal ROM or EPROM).
 128 bytes of On-Chip Data Memory (Internal RAM):
 Four Register Banks, each containing 8 registers (R0 to R7) [Total 32 reg]
 16-bytes of bit addressable memory.
 80 bytes of general-purpose data memory (Scratch Pad Area).
 Special Function Registers (SFR) to configure/operate microcontroller.
 32 bit bi-directional I/O Lines (4 ports P0 to P3).
 Two 16-bit timers/counters (T0 and T1).
 Full duplex UART (Universal Asynchronous Receiver/Transmitter).
 On-Chip oscillator and clock circuitry.

1
EXTERNAL
INTERRUPTS

4K
ROM TIMER 1
INTERRUPT 128 Byte COUNTER
CONTROL RAM INPUTS
TIMER 0

CPU

OSC BUS CONTROL 4 I/O PORTS SERIAL CONTROL

 P0 P2 P1 P3 TXD RXD
X1 X2
ADDRESS /
DATA
Fig.1. General Block Diagram of 8051 Microcontroller Architecture

STEPS TO CREATE AND COMPILE Keil µVision-3/4 PROJECT:

1. Double Click on the  icon on the desktop.


2. Close any previous projects that were opened using – Project -> Close.
3. Start Project – New Project, and select the CPU from the device database
(Database-Atmel- AT89C51ED2 or AT89C51RD2 as per the board).On clicking
‘OK’, the following option is displayed. Choose ‘No’.

4. Create a source file (using File->New), type in the assembly or C program and
save this (filename.asm/filename.c) and add this source file to the project using
either one of the following two methods. (i) Project->Manage->Components,
Environment Books->addfiles-> browse to the required file -> OK
“OR” ii) right click on the Source Group in the Project Window and the Add
Files to Group option.

2
5. Set the Target options using -> Project – Options for Target opens the
µ Options for Target – Target configuration dialog. Set the Xtal
(Crystal frequency) frequency as 11.0592 MHz, and also the Options for Target
– Debug – use either Simulator / Keil Monitor- 51 driver.

6. If Keil Monitor- 51 driver is used click on Settings -> COM Port settings select
the COM Port to which the board is connected and select the baud rate as 19200
or 9600 (recommended). Enable Serial Interrupt option if the user application is
not using on-chip UART, to stop program execution.
7. Build the project; using Project -> Build Project. 
application and links. Any errors in the code are indicated by – “Target not
created” in the Build window, along with the error line. Debug the errors. After an
error free, to build go to Debug mode.

8. Now user can enter into Debug mode with Debug- Start / Stop Debug session

dialog. Or by clicking in the icon.


9. The program is run using the Debug-Run command & halted using Debug-Stop

Running. Also the (reset, run, halt) icons can be used. Additional

icons are (step, step over, and step into, run till cursor).
10. If it is an interface program the outputs can be seen on the LCD, CRO, motor, led
status, etc. If it is a part-A program, the appropriate memory window is opened
using View -> memory window (for data RAM & XRAM locations), Watch
window (for timer program), serial window, etc.

3
11. Note: To access data RAM area type address as D: 0020h. Similarly to access the
DPTR region (XRAM-present on chip in AT89C51ED2) say 9000h location type
in X: 09000H.

4
Experiment no. 1 : Data Transfer Programming
a. Write an assembly language program to transfer N = bytes of data
from location A: h to location B: h.
Aim:

Procedure:

Assembly language program:

Let N = 05h, A: 30h B: 40h


mov r0,#30h //source address
mov r1,#40h //destination address
mov r7,#05h //Number of bytes to be moved
back: mov a,@r0
mov @r1,a
inc r0
inc r1
djnz r7,back //repeat till all data
transferred end

Out put:

Before Execution:

After Execution:

5
Result:

6
b. Write an assembly language program to exchange N = h bytes of data
at location A: h and at location B: h.

Let N = 05h A: 30h B: 40h


mov r0,#30h //source address
mov r1,#40h //destination address
mov r7,#05h //count, the number of data to be
exchanged back: mov a,@r0
mov r4,a
mov a,@r1
mov @r0,a
mov a,r4
mov @r1,a
inc r0
inc r1
djnz r7,back
end
Result:
Before Execution:

After Execution:

7
c. Write an assembly language program to find the largest element in a
given array of N = h bytes at location 4000h. Store the largest element
at location 4062h.

Let N = 06h
mov r3,#6 //length of the array
mov dptr,#4000H //starting address of array
movx a,@dptr
mov r1,a

nextbyte: inc dptr


movx a,@dptr
clr c //reset borrow flag
mov r2,a //next number in the array
subb a,r1 //other Num-Prev largest no.
jc skip // JNC FOR SMALLEST ELEMENT
mov a,r2 //update larger number in r1
mov r1,a

skip: djnz r3,nextbyte


mov dptr, #4062H //location of the result-4062h
mov a,r1 //largest number
movx @dptr,a //store at #4062H
end

Result:

Before Execution:

After Execution:

8
d. Write an assembly language program to sort an array of N = h bytes
of data in ascending/descending order stored from location 9000h.
(Using bubble sort algorithm)

Let N = 06h
mov r0,#05H //count (N-1) array size =
N loop1: mov dptr, #9000h //array stored from address 9000h
mov r1,#05h //initialize exchange counter
loop2: movx a, @dptr //get number from array and store in B
register mov b, a
inc dptr
movx a, @dptr //next number in the array
clr c //reset borrow flag
mov r2, a //store in R2
subb a, b //2nd-1st No, since no compare instruction in 8051
jnc noexchg // JC - FOR DESCENDING ORDER
mov a,b //exchange the 2 nos in the array
movx @dptr,a
dec dpl //DEC DPTR - instruction not
present mov a,r2
movx @dptr,a
inc dptr

noexchg: djnz r1,loop2 //decrement compare counter


djnz r0,loop1 //decrement pass counter
end

Result:
Before Execution:

After Execution :( Ascending order)

Note:
Analyze the bubble sort algorithm for the given data. Also try with different sorting
algorithms.

9
Experiment no. 2: Arithmetic Instruction Programming

a. Write an assembly language program to perform the addition of two


16-bit numbers.

mov r0,#34h //lower nibble of No.1


mov r1,#12h //higher nibble of No.1
mov r2,#0dch //lower nibble of No.2
mov r3,#0feh //higher nibble of No.2
clr c
mov a,r0
add a,r2
mov 22h,a
mov a,r1
addc a,r3
mov 21h,a
mov 00h,c
end

Result:
Input: Output:

10
b. Write an assembly language program to perform the subtraction of
two 16-bit numbers.

mov r0,#0dch //lower nibble of No.1


mov r1,#0feh //higher nibble of No.1
mov r2,#34h //lower nibble of No.2
mov r3,#12h //higher nibble of No.2
clr c //
mov a,r0
subb a,r2
mov 22h,a
mov a,r1
subb a,r3
mov 21h,a
mov 00h,c
end

Result:

Note: Try with different data. Ex: (Smaller number) – (larger number).

11
c. Write an assembly language program to perform the multiplication of
two 16-bit numbers.

mov r0,#34h // 5678*1234


mov r1,#12h
mov r2,#78h
mov r3,#56h
mov a,r0
mov b,r2
mul ab
mov 33h,a
mov r4,b
mov a,r0
mov b,r3
mul ab
add a,r4
mov r5,a
mov a,b
addc a,#00h
mov r6,a
mov a,r1
mov b,r2
mul ab
add a,r5
mov 32h,a
mov a,b
addc a,r6
mov 00h,c
mov r7,a
mov a,r3
mov b,r1
mul ab
add a,r7
mov 31h,a
mov a,b
addc a,20h
mov 30h,a
end

Result:

Note: Write the logic of the program. Try with some other logic.

12
d. Write an assembly language program to find the square of a given
number N.

Let N = 05

mov a,#05 // a=N=05


mov b,a
mul ab
mov 30h,a // result is stored in 30h and 31h
mov 31h,b
end

Result:
Input: Output:

a. Write an assembly language program to perform logical operations AND,


OR, XOR on two eight bit numbers stored in internal RAM locations 21h,
22h.

mov a, 21h //do not use #, as data ram 21h is to be


accessed anl a, 22h //logical and operation
mov 30h, a //and operation result stored in
30h mov a, 21h
orl a,22h //logical or operation
mov 31h, a //or operation result stored in
31h mov a,21h
xrl a,22h //logical xor operation
mov 32h,a // xor operation result stored in
32h end

Result:
Before Execution: D: 21H = 22H =

After Execution: D: 030H = //AND operation


D: 031H = //OR operation
D: 032H = //XOR operation

Code Conversion Programming


a. Write an assembly language program to convert a BCD number into ASCII.
13
mov a, #09h //the BCD number to be converted to ASCII
mov r0,a
swap a
mov dptr,#9000h // output will be in 9000h and 90001h
acall ascii
mov a,r0
acall ascii
sjmp $
ascii: anl a,#0fh
add a,#30h
movx @dptr,a
inc dptr
ret
end
Result:
Input: Output:

b. i Write an assembly language program to convert a ASCII number into


Decimal.

mov dptr,#9000h //ASCII no. to be converted to decimal is stored in 9000h


movx a,@dptr
subb a,#30h
inc dptr
movx @dptr,a
end
Result:
Input: Output:

b. ii Write an assembly language program to convert a decimal number into


ASCII.

mov dptr,#9000h //Decimal number to be converted to ASCII is store


in movx a,@dptr // 9000h
add a,#30h
inc dptr // ASCII will be saved in 9001h
movx @dptr,a
end

Result:
Input: Output:

14
c. i Write an assembly language program to convert a binary (hex) number
into decimal.

mov a,#0feh //binary number to be converted to


decimal mov b,#0ah
div ab
mov r0,b
mov b,#0ah
div ab
mov 30h,a
mov a,b
swap a
orl a,r0
mov 31h,a
end

Result:
Input: Output:

c. ii Write an assembly language program to convert a decimal number


into binary(hex).

mov a,#95h //a = Decimal number to be converted to the


binary mov b,#10h
div ab
mov r1,b
mov b,#0ah
mul ab
add a,r1
mov 30h,a
end

Result:
Input: Output:

15
Experiment no. 9: LCD and keypad interfacing
Block Diagram:

HEX values of the keys:


LABEL ON THE HEX LABEL ON THE HEX
KEYTOP CODE KEYTOP CODE
0 0 - 0C
1 1 * 0D
2 2 / 0E
3 3 % 0F
4 4 AC 10
5 5 CE 11
6 6 CHK 12
7 7 = 13
8 8 MC 14
9 9 MR 15
. 0A M 16
+ 0B M+ 17

16
Program to interface LCD and KEYPAD :
#include <REG51xD2.H>
#include "lcd.h"
unsigned char getkey();
void delay(unsigned int);
main()
{
unsigned char key,tmp;
InitLcd(); //Initialise LCD
WriteString("Key Pressed="); // Display msg on LCD
while(1)
{
GotoXY(12,0); //Set Cursor Position
key = getkey(); //Call Getkey method
}
}

unsigned char getkey()


{
unsigned char i,j,k,indx,t;
P2 = 0x00; //P2 as Output port
indx = 0x00;//Index for storing the 1st value of scanline
for(i=1;i<=4;i<<=1) //for 3 scanlines
{
P2 = 0x0f & ~i; //write data to scanline
t = P0; //Read readlines connected to P0
t = ~t;
if(t>0) //If key press is true
{
delay(6000); //Delay for bouncing
for(j=0;j<=7;j++) //Check for 8 lines
{
t >>=1;
if(t==0) //if get pressed key
{
k = indx+j; //Display that by converting to Ascii
t = k>>4;
t +=0x30;
WriteChar(t); //Write upper nibble
t = k & 0x0f;
if(t > 9)
t+=0x37;
else
t+=0x30;
WriteChar(t); //write lower nibble
return(indx+j); //Return index of the key pressed
}
}
}
indx += 8; //If no key pressed increment index
}
}

void delay(unsigned int x) //Delay routine


{ for(;x>0;x--); }

17
STEPS TO CREATE AND COMPILE MSP430 PROJECT IN IAR-
EMBEDDED WORKBENCH:

12. Double Click on the IAR-embedded workbench icon .


13. Close any previous projects that were opened using – Project Close.
14. Start Project Create New Project, select ‘asm’, & then click ‘OK’.

15. Create a source file (using File->New), type in the assembly or C program and
save this (filename.asm/filename.c) and add this source file to the project using
right click on the Source Group in the Project Window and the Add Files to
Group option.

16. Compile the project; using this button. Then click make . Any errors in the
code are indicated by the window shown in figure below, along with the error line.
Debug the errors. After an error free, go to Download and Debug mode by using

this icon.

18
17. After clearing errors and clicking download & debug button below window will
appear.

18. Run the program using these icons .

19. To stop debugging click this icon.

19
13. Data Transfer and Arithmetic Instruction Programming
a. Write an assembly language program to transfer N = bytes of data from
location A: h to location B: h (without overlap).

A=0x8000, B=0x9000, N=5

#include "msp430.h" ; #define controlled include


file NAME main ; module name
PUBLIC main ; make the main label visible outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of segment
RSEG CODE ; place program in 'CODE'
segment
init: MOV #SFE(CSTACK), SP ; set up
stack main: NOP ; main
program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

MOV.W #0x8000, R5
MOV.W #0x9000,R6
MOV.B #5,R7
again: MOV.W @R5+,0(R6)
INCD.W R6
DEC R7
JNZ again
JMP $
END

Result:

Input:

Output:

20
b. Write an assembly language program to exchange N = h bytes of data at
location A : h and at location B : h.

A=0x8000, B=0x9000, N=5

#include "msp430.h" ; #define controlled include


file NAME main ; module name
PUBLIC main ; make the main label visible outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of segment
RSEG CODE ; place program in 'CODE'
segment
init: MOV #SFE(CSTACK), SP ; set up
stack main: NOP ; main
program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

MOV.W #0x8000, R5
MOV.W #0x9000,R6
MOV.B #5,R7

again: MOV.W @R5,R8


MOV.W @R6,0(R5)
MOV.W R8,0(R6)
INCD.W R6
INCD.W R5
DEC R7
JNZ again
JMP $
END

Result:
Input: Output:

21
c. Write an assembly language program to sort an array of N = h bytes of
data in ascending/descending order stored from location 9000h.(use bubble
sort algorithm)

#include "msp430.h" ; #define controlled include


file NAME main ; module name
PUBLIC main ; make the main label visible outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of
segment
RSEG CODE ; place program in 'CODE'
segment init: MOV #SFE(CSTACK), SP ; set
up stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL
; Stop watchdog timer
MOV.W #04,R4 ; count (N-1) ARRAY SIZE=N
UP: MOV.W #0x9000,R10 ;array stored from address 9000h
MOV.W #00,R11
MOV.W R4, R5 ; initialize exchange counter
REPEAT: MOV.W @R10+, R6 ; Get 1st Number from Array
MOV.W R6, R8
MOV.W @R10, R7 ; Get 2nd Number from Array
MOV.W R7, R9
SUB.W R7, R6
JNC NOEXCHG ; jc - for descending order
MOV.W R8, 0(R10) ; Exchange the 2 No’s In the Array
DEC.W R10
DEC.W R10
MOV.W R9, 0(R10)
INCD.W R10
NOEXCHG: DEC.W R5
CMP.W R11, R5
JNE REPEAT
DEC.W R4
CMP.W R11, R4
JNE UP
JMP $
END

Note: For smallest number take the first element in the ascending order sorted array
and for largest number take the first element in the descending order sorted array

22
d. Write an assembly language program to perform the addition of two 32-bit
numbers.

#include "msp430.h" ; #define controlled include


file NAME main ; module name
PUBLIC main ; make the main label visible outside this
module ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of segment
RSEG CODE ; place program in 'CODE'
segment
init: MOV #SFE(CSTACK), SP ; set up
stack main: NOP ; main
program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer
MOV.W #0X9000,R4 //NUM1:FFFF9000
MOV.W #0XFFFF,R7 //NUM2:FFFFFFFF
ADD.W R4,R7
MOV.W #0XFFFF,R5
MOV.W #0XFFFF,R6
ADDC R5,R6
JMP $
END

Result:
Input: Output:

23
e. Write an assembly language program to perform the subtraction of two
32-bit numbers.

#include "msp430.h" ; #define controlled include


file NAME main ; module name
PUBLIC main ; make the main label visible outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of segment
RSEG CODE ; place program in 'CODE'
segment
init: MOV #SFE(CSTACK), SP ; set up
stack main: NOP ; main
program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

MOV.W #0X9000,R4
MOV.W #0XFFFF,R7
SUB.W R4,R7
MOV.W #0XFFFF,R5
MOV.W #0XFFFF,R6
SUBC R5,R6
JMP $
END

Result:
Input: Output:

24
f. Write an assembly language program to perform the multiplication of two
16-bit numbers.

#include "msp430.h" ; #define controlled include


file NAME main ; module name
PUBLIC main ; make the main label visible outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of
segment
RSEG CODE ; place program in 'CODE'
segment init: MOV #SFE(CSTACK), SP ; set
up stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer
MOV.W #0XFFFF, R4 ; R4= FFFF
MOV.W R4, R8
MOV.W #0X1234, R7 ; R7= 1234, (FFFF x 1234)
MOV.W #00, R5
MOV.W #00, R10 ; PRODUCT LOWER 16 BIT
(DB98) MOV.W #00, R9 ; PRODUCT UPPER 16 BIT (1233)
CLRC
INC.W R5
UP: ADD.W R4, R8 ; SUCCESSIVE
ADDITION JNC COPY
INC.W R9
COPY: INC.W R5
CLRC
CMP.W R5, R7
JNE UP
MOV.W R8, R10
JMP $
END

Result:
Input: Output:

Note: For square of a number give both the numbers same value.

Assignment: Find the square and cube of a number.

25
14 .Boolean & Logical Instruction Programming

a. Write an assembly language program to count number of ones and zeros in


an 8 bit number.
#include "msp430.h" ; #define controlled include file
NAME main ; module name
PUBLIC main ; make the main label visible outside this
module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of segment
RSEG CODE ; place program in 'CODE'
segment
init: MOV #SFE(CSTACK), SP ; set up
stack main: NOP ; main
program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog
timer MOV.W #0000h,R4
MOV.W #0000h,R5
MOV.W #0008h,R6
MOV.W #0097h,R7
AGAIN:RRC R7
JC NEXT
INC R4
JMP
HERE
NEXT:INC R5
HERE:DEC R6
JNZ
AGAIN
JMP $
END

Results:

26
b. Write an assembly language program to find weather the given 8 bit
number is even or odd.

#include "msp430.h" ; #define controlled include file


NAME main ; module name
PUBLIC main ; make the main label visible outside this
module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of segment
RSEG CODE ; place program in 'CODE'
segment
init: MOV #SFE(CSTACK), SP ; set up
stack main: NOP ; main
program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

Results:

C .Write an assembly language program to perform logical operations AND,


OR, XOR on two 16 bit numbers.

#include "msp430.h" ; #define controlled include


file NAME main ; module name
PUBLIC main ; make the main label visible outside this
module ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of
segment
RSEG CODE ; place program in 'CODE'
segment init: MOV #SFE(CSTACK), SP ; set up stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

MOV.W #0X1234, R5
MOV.W #0XABCD,R6
MOV.W R6,R7
MOV.W R6,R8
AND.W R5,R6 //R6=R5 AND R6
XOR.W R5,R7 //R7=R5 XOR R7
INV.W R8 //R8=NOT R8
INV.W R5
AND.W R8,R5
INV.W R5 //R5=R8 OR R5
JMP $
27
Results:

28
15.Counter and Code Conversion Programming
a. Write an assembly language program to implement (display) an 16 bit
UP/DOWN binary (hex).

#include "msp430.h" ; #define controlled include


file NAME main ; module name
PUBLIC main ; make the main label visible outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of
segment
RSEG CODE ; place program in 'CODE'
segment init: MOV #SFE(CSTACK), SP ; set up
stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

AGAIN: MOV.W #0X0000,R5 //For DOWN Counter, MOV.W #0XFFFF, R5


REP: CALL #DELAY
ADD.W #0X0001,R5 //For DOWN counter, ADD.W
#0XFFFF,R5 JNZ REP
JMP AGAIN
JMP $

DELAY:
MOV.W #0X50,R6
LOOP1: MOV.W #0X50,R7
LOOP: DEC R7
JNZ LOOP
DEC R6
JNZ LOOP1
RET
END

RESULT: R5 is incremented in binary from 0000, 0001,0002…0009,000A,


000B,…,000F,0010,0011,…FFFF,0000,0001, …….

29
b. Write an assembly language program to implement (display) an 16 bit
UP/DOWN Decimal counter.
#include "msp430.h" ; #define controlled include
file NAME main ; module name
PUBLIC main ; make the main label visible outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of
segment
RSEG CODE ; place program in 'CODE'
segment init: MOV #SFE(CSTACK), SP ; set
up stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

AGAIN: MOV.W #0X9999,R5 //For UP Counter, MOV.W #0X00, R5


REP: CALL #DELAY
CLRC
DADD.W #0X9999,R5 //For UP counter, DADD.W #0X0001,R5
JNZ REP
JMP AGAIN
JMP $

DELAY:
MOV.W #0X50,R6
LOOP1: MOV.W
#0X50,R7 LOOP: DEC R7
JNZ LOOP
DEC R6
JNZ LOOP1
RET
END

RESULT:
R5 is decremented in BCD from 9999, 9998, ……, 0000, 9999, 9998……

30
c. Write an assembly language program to convert a 8-bit BCD number into
ASCII.

#include "msp430.h" ; #define controlled include


file NAME main ; module
name
PUBLIC main ; make the main label visible outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of
segment
RSEG CODE ; place program in 'CODE'
segment init: MOV #SFE(CSTACK), SP ; set
up stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

MOV.B #0X12, R5
MOV.B R5,R6
AND.B #0X0F,R6
ADD.B #0X30,R6
AND.B #0XF0,R5
RRA.B R5
RRA.B R5
RRA.B R5
RRA.B R5
ADD.B
#0X30,R5
MOV.B R5,R7
JMP $
END

Result:
Input: Output:

31
d. Write an assembly language program to convert a ASCII number into
Decimal.

#include "msp430.h" ; #define controlled include


file NAME main ; module name
PUBLIC main ; make the main label visible outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of
segment
RSEG CODE ; place program in 'CODE'
segment init: MOV #SFE(CSTACK), SP ; set
up stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

MOV.B #0X35, R5
SUB.B #0X30,R5
MOV.B R5,R6
JMP $
END

Result:
Input: Output:

e. Write an assembly language program to convert a Decimal number


into ASCII.

#include "msp430.h" ; #define controlled include


file NAME main ; module name
PUBLIC main ; make the main label visible outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of
segment
RSEG CODE ; place program in 'CODE'
segment init: MOV #SFE(CSTACK), SP ; set
up stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

MOV.B #0X05, R5
ADD.B #0X30,R5
MOV.B R5,R6
JMP $
END

Result:

32
Input: Output:

33
f. Write an assembly language program to convert a binary (hex) number
into decimal.
#include "msp430.h" ; #define controlled include
file NAME main ; module name
PUBLIC main ; make the main label visible outside this
module ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of
segment
RSEG CODE ; place program in 'CODE'
segment init: MOV #SFE(CSTACK), SP ; set
up stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

MOV.B #0XFE,R5
MOV.B #0X0A,R6
CALL #AA
MOV.B R5,R9
MOV.B R7,R5
CALL #AA
AND.W #0X00FF,R7
SWPB R7
RLA.B R5
RLA.B R5
RLA.B R5
RLA.B R5
ADD.W R5,R7
ADD.W R9,R7
JMP $

AA:
MOV.B #0XFF,R7
LOOP: INC R7
SUB.B R6,R5
JC LOOP
ADD.W #0x0A,R5
RET

END

Result:
Input: Output:

34
g. Write an assembly language program to convert a decimal number
into binary(hex).
#include "msp430.h" ; #define controlled include
file NAME main ; module name
PUBLIC main ; make the main label visible outside this
module ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of
segment
RSEG CODE ; place program in 'CODE'
segment init: MOV #SFE(CSTACK), SP ; set up
stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer

MOV.B #0X99,R5
MOV.B #0X10,R6
MOV.B #0XFF,R7
LOOP: INC R7
SUB.B R6,R5
JC LOOP
ADD.B #0x10,R5
AND.W #0X00FF,R7
MOV.B #0X00,R8
AGAIN:ADD.B #0X0A,R8
DEC R7
JNZ AGAIN
ADD.B R5,R8
JMP $
END

Result:
Input: Output:

35
Additional Programs
1. Program to generate arithmetic progression. //Tn=a+(n-

1)d clr c
mov r1,#03h //d
mov r2,#01h //a
mov r3,#08h
mov r0,#30h
mov 30h,r2
mov r4,#01h
next: mov a,r1
mov b,r4
mul ab
addc a,r2
inc r0
mov @r0,a
inc r4
djnz r3,next
end

2. Program to find the 2 out of 5 code.

mov r0,#30h ; r0 as pointer


mov a,@r0 ; no. to the Acc.
ANL a,#0e0h
jnz notvalid ; checks the 1st 3bits
mov a,@r0
mov r2,#5 ; r2 as counter
mov r1,#00h ; r0 stores no. of ones
clr c
check: rrc a
jnc skip
inc r1 ; if carry increment r1
skip: djnz r2,check
mov A,r1
clr c
subb A,#02h
jnz notvalid ; (a)!= 0 ===> (r2)!= 2 no. is not valid.
inc r0
mov @r0,#0ffh ; valid 2 out of 5 code
sjmp exit
notvalid: inc r0
mov @r0,#11h ; in valid 2 out of 5 code
exit: sjmp exit
end

36
3. Program to generate first ten Fibonacci numbers.

Mov dptr, #9000h


Mov r3, #08h
Movx a, @dptr
Mov r0,a
Inc dptr
Movx a, @dptr
Back: xch a, r0
Add a,r0
Inc dptr
Movx @dptr,a
Djnz r3,back
Lcall 0003h

4. Program to add multibyte numbers.

Mov dptr,#9000h
Mov r1,#04h
Mov r2,#90h
Mov r3,#91h
Mov r4,#92h
Clr c
Mov dph,r2
Back: movx a, @dptr
Mov r5,a
Mov dph,r3
Movx a,@dptr
Addc a,r5 //Note:For multibyte subtraction put subb
a,r5 Mov dph,r4
Movx @dptr,a
Inc dptr
Djnz r1,back
Jnc end1
Mov a,#01h
Movx @dptr, a
End1:lcall 0003h
End

37
REFERENCES

1. “The 8051 Microcontroller and Embedded Systems – using assembly and C ”-,
by Muhammad Ali, Mazidi and Janice Gillespie Mazidi and Rollin D. McKinlay;
PHI, 2006 / Pearson, 2006

2. “MSP430 Microcontroller Basics”, John Davies, Elsevier, 2010

3. “The 8051 Microcontroller Architecture, Programming & Applications”, 2e


Kenneth J. Ayala ;Penram International, 1996 / Thomson Learning 2005.

4. “The 8051 Microcontroller”, V.Udayashankar and MalikarjunaSwamy, TMH,


2009

5. “Microcontrollers: Architecture, Programming, Interfacing and System


Design”,Raj Kamal, “Pearson Education, 2005

38
Viva Questions
1. What do you mean by Embedded System? Give examples.
2. Why are embedded Systems useful?
3. What are the segments of Embedded System?
4. What is Embedded Controller?
5. What is Microcontroller?
6. List out the differences between Microcontroller and Microprocessor.
7. How are Microcontrollers more suitable than Microprocessor for Real
Time Applications?
8. What are the General Features of Microcontroller?
9. Explain briefly the classification of Microcontroller.
10. Explain briefly the Embedded Tools.
11. Explain the general features of 8051 Microcontroller.
12. How many pin the 8051 has?
13. Differentiate between Program Memory and Data Memory.
14. What is the size of the Program and Data memory?
15. Write a note on internal RAM. What is the necessity of register banks? Explain.
16. How many address lines are required to address 4K of memory? Show the
necessary calculations.
17. What is the function of accumulator?
18. What are SFR’s? Explain briefly.
19. What is the program counter? What is its use?
20. What is the size of the PC?
21. What is a stack pointer (SP)?
22. What is the size of SP?
23. What is the PSW? And briefly describe the function of its fields.
24. What is the difference between PC and DPTR?
25. What is the difference between PC and SP?
26. What is ALE? Explain the functions of the ALE in 8051.
27. Describe the 8051 oscillator and clock.
28. What are the disadvantages of the ceramic resonator?
29. What is the function of the capacitors in the oscillator circuit?
30. Show with an example, how the time taken to execute an instruction can be
calculated.
31. What is the Data Pointer register? What is its use in the 8051?
32. Explain how the 8051 implement the Harvard Architecture?
33. Explain briefly the difference between the Von Neumann and the Harvard
Architecture.
34. Describe in detail how the register banks are organized.
35. What are the bit addressable registers and what is the need?
36. What is the need for the general purpose RAM area?
37. Write a note on the Stack and the Stack Pointer.
38. Why should the stack be placed high in internal RAM?
39. Explain briefly how internal and external ROM gets accessed.
40. What are the different addressing modes supported by 8051 Microcontroller ?
41. Explain the Immediate Addressing Mode.
42. Explain the Register Addressing Mode.
43. Explain the Direct Addressing Mode.

39
44. Explain the Indirect Addressing Mode.
45. Explain the Code Addressing Mode.
46. Explain in detail the Functional Classification of 8051 Instruction set
47. What are the instructions used to operate stack?
48. What are Accumulator specific transfer instructions?
49. What is the difference between INC and ADD instructions?
50. What is the difference between DEC and SUBB instructions?
51. What is the use of OV flag in MUL and DIV instructions?
52. What are single and two operand instructions?
53. Explain Unconditional and Conditional JMP and CALL instructions.
54. Explain the different types of RETURN instructions.
55. What is a software delay?
56. What are the factors to be considered while deciding a software delay?
57. What is a Machine cycle?
58. What is a State?
59. Explain the need for Hardware Timers and Counters?
60. Give a brief introduction on Timers/Counter.
61. What is the difference between Timer and Counter operation?
62. How many Timers are there in 8051?
63. What are the three functions of Timers?
64. What are the different modes of operation of timer/counter?
65. Give a brief introduction on the various Modes.
66. What is the count rate of timer operation?
67. What is the difference between mode 0 and mode 1?
68. What is the difference Modes 0,1,2 and 3?
69. How do you differentiate between Timers and Counters?
70. Explain the function of the TMOD register and its various fields?
71. How do you control the timer/counter operation?
72. What is the function of TF0/TF1 bit
73. Explain the function of the TCON register and its various fields?
74. Explain how the Timer/Counter Interrupts work.
75. Explain how the 8051 counts using Timers and Counters.
76. Explain Counting operation in detail in the 8051.
77. Explain why there is limit to the maximum external frequency that can be
counted.
78. What’s the benefit of the auto-reload mode?
79. Write a short note on Serial and Parallel communication and highlight their
advantages and disadvantages.
80. Explain Synchronous Serial Data Communication.
81. Explain Asynchronous Serial Data Communication.
82. Explain Simplex data transmission with examples.
83. Explain Half Duplex data transmission with examples.
84. Explain Full Duplex data transmission with examples.
85. What is Baud rate?
86. What is a Modem?
87. What are the various registers and pins in the 8051 required for Serial
communication? Explain briefly.
88. Explain SCON register and the various fields.
89. Explain serial communication in general (synchronous and asynchronous). Also
explain the use of the parity bit.

40
90. Explain the function of the PCON register during serial data communication.
91. How the Serial data interrupts are generated?
92. How is data transmitted serially in the 8051? Explain briefly.
93. How is data received serially in the 8051? Explain briefly.
94. What are the various modes of Serial Data Transmission? Explain each mode
briefly.
95. Explain with a timing diagram the shift register mode in the 8051.
96. What is the use of the serial communication mode 0 in the 8051?
97. Explain in detail the Serial Data Mode 1 in the 8051.
98. Explain how the Baud rate is calculated for the Serial Data Mode 1.
99. How is the Baud rate for the Multiprocessor communication Mode calculated?
100. Explain in detail the Multiprocessor communication Mode in the 8051.
101. Explain the significance of the 9th bit in the Multiprocessor
communication Mode.
102. Explain the Serial data mode 3 in the 8051.
103. What are interrupts and how are they useful in Real Time Programming?
104. Briefly describe the Interrupt structure in the 8051.
105. Explain about vectored and non-vectored interrupts in general.
106. What are the five interrupts provided in the 8051?
107. What are the three registers that control and operate the interrupts in 8051?
108. Describe the Interrupt Enable (IE) special function register and its
various bits.
109. Describe the Interrupt Priority (IP) special function register and its need.
110. Explain in detail how the Timer Flag interrupts are generated.
111. Explain in detail how the Serial Flag interrupt is generated.
112. Explain in detail how the External Flag interrupts are generated.
113. What happens when a high logic is applied on the Reset pin?
114. Why the Reset interrupt is called a non-maskable interrupt?
115. Why do we require a reset pin?
116. How can you enable/disable some or all the interrupts?
117. Explain how interrupt priorities are set? And how interrupts that
occur simultaneously are handled.
118. What Events can trigger interrupts, and where do they go after
getting triggered?
119. What are the actions taken when an Interrupt Occurs?
110. What are Software generated interrupts and how are they generated?
111. What is RS232 and MAX232?
112. What is the function of RS and E pins in an LCD?
113. What is the use of R/W pin in an LCD?
114. What is the significance of DA instruction?
115. What is packed and unpacked BCD?
116. What is the difference between CY and OV flag?
117. When will the OV flag be set?
118. What is an ASCII code?

41
MICROCONTROLLER - LAB QUESTION BANK

1. a) Write an ALP to move a Block of N-data starting at location X to location Y


using 8051/MSP430
b) Write a C program to interface stepper motor to 8051.

2. a) Write an ALP to find cube of given 8-bit data using 8051 /MSP430.
b) Write a C program to interface stepper motor to 8051.

3. a) Write an ALP to implement a binary/decimal up/down counter using 8051


/MSP430.
b) Write a C program to interface stepper motor to 8051.

4. a) Write an ALP to find the largest / smallest element in an array using 8051.
b) Write a C program to interface stepper motor to 8051.

5. a) Write an ALP to exchange two blocks of data present at location X and Y


respectively using 8051/MSP430
b) Write a C program to generate Sine waveform using DAC. Display the
waveform on CRO.

6. a) Write an ALP to arrange a set of N 8-bit numbers starting at location X in


ascending/descending order using 8051 /MSP430.
b) Write a C program to generate triangular wave of amp = (1V-5V) using
DAC. Display the waveform on CRO.

7. a) Write an ALP to perform 16-bit multiplication using 8051 /MSP430.


b) Write a C program to generate Ramp wave of amp = (1V-5V) using DAC.
Display the waveform on CRO.

8. a) Write an ALP to convert two digit BCD number to its equivalent ASCII value
using 8051 /MSP430.
b) Write a C program to generate square wave of amp = (1V-5V) using
DAC. Display the waveform on CRO.

9. a) Write an ALP to find whether the given number is palindrome or not using
8051.
b) Write a C program to generate Sine waveform using DAC. Display the
waveform on CRO.

42
10. a) Write an ALP to convert given Hexadecimal number to its equivalent Decimal
number using 8051 /MSP430.
b) Write a C program to interface DC motor to 8051.

11. a) Write an ALP to convert given Decimal number to its equivalent Hexadecimal
using 8051 /MSP430.
b) Write a C program to interface DC motor to 8051.

12. a) Write an ALP to perform 16-bit addition/subtraction using 8051/ MSP430.


b) Write a C program to interface DC motor to 8051.

13. a) Write an ALP to count number of 1’s and 0’s in the given 8-bit data using 8051
/MSP430.
b) Write a C program to interface Elevator to 8051.

14. a) Write an ALP to convert given ASCII number to its equivalent Decimal
number.
b) Write a C program to interface Elevator to 8051

15. a) Write an ALP to find whether given number is even or odd using 8051
/MSP430.
b) Write a C program to interface LCD panel and Hex keypad to 8051.

16. a) Write an ALP to convert given Decimal number to its equivalent ASCII using
8051 /MSP430.
b) Write a C program to interface LCD panel and Hex keypad to 8051.

43
Annexure-A
MCS-51 Instruction
set
Instruction Set

44
45
46
Annexure -B
8051 Special Function Registers:
1. Timer Mode Control Register (TMOD):
TMOD can be considered to be two duplicate 4-bit registers, each of which
controls the action of one of the timers. The “Timer” or “Counter” function is selected
by control bits C/T, and in different operating modes, which are selected by bit-pairs
(M1, M0) in TMOD.
MSB LSB
GATE C/T M1 M0 GATE C/T M1 M0

Timer 1 Timer 0
Gating control when set. Counter “x” is enabled only while “INTx” pin is
GATE high and “TRx” control pin is set. When cleared Timer “x” is enabled
whenever “TRx” control bit is set.
Timer or Counter Selector cleared for Timer operation (input from internal
C/T system clock.) Set for Counter operation (input from “Tx” input pin).
M1 M0 OPERATI0N
0 0 13-bit Timer/Counter 5-bits of “TLx” and 8-bits of “THx” are used.
0 1 16-bit Timer/Counter 8-bits of “TLx” and 8-bits of “THx” are cascaded.
8-bit auto-reload Timer/Counter “THx” holds a value which is to be
1 0
reloaded into “TLx” each time it overflows.
(Timer 0) TL0 is an 8-bit Timer/Counter controlled by the standard Timer
1 1 0 control bits. TH0 is an 8-bit timer only controlled by Timer 1 control bits.
Timer/Counter 1 stopped.

2. Interrupt Enable (IE) Register :

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0


EA x x ES ET1 EX1 ET0 EX0

Symbol Name and Function


Enable All. If 0, Disables all interrupts and no interrupt is acknowledged. If
EA 1, each interrupt can be individually enabled or disabled by programming
appropriate bit.
x Reserved
x -
ES Enable Serial Interrupt. If 1, enables TI or RI to generate interrupt.

ET1 Enable Timer 1 interrupt. If 1, Enables the TF1 to generate the interrupt.
EX1 Enable External interrupt 1. If 1, Enables the INT1 to generate the interrupt.
ET0 Enable Timer 0 interrupt. If 1, Enables the TF0 to generate the interrupt.
EX0 Enable External interrupt 0. If 1, Enables the INT0 to generate the interrupt.

47
3. Timer Control Register (TCON):
TCON has control bits and flags for the timers in the upper nibble, and control
bits and flags for the external interrupts in lower nibble.
MSB LSB
TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0

Bit Symbol Function


Timer 1 overflow flag. Set by hardware on Timer/Counter
TCON.7 TF1 overflow. Cleared by hardware when processor vectors to
interrupt routine, or clearing the bit in software.
Timer 1 Run control bit. Set/cleared by software to turn
TCON.6 TR1
Timer/Counter on/off.
Timer 0 overflow flag. Set by hardware on Timer/Counter
TCON.5 TF0 overflow. Cleared by hardware when processor vectors to
interrupt routine, or by clearing the bit in software.
Timer 0 Run control bit. Set/cleared by software to turn
TCON.4 TR0
Timer/Counter on/off.
Interrupt 1 Edge flag. Set by hardware when external interrupts
TCON.3 IE1
edge detected. Cleared when interrupt processed.
Interrupt 1 type control bit. Set/cleared by software to specify
TCON.2 IT1
falling edge/low level triggered external interrupts.
Interrupt 0 Edge flag. Set by hardware when external interrupts
TCON.1 IE0
edge detected. Cleared when interrupt processed.
Interrupt 0 Type control bit. Set/cleared by software to specify
TCON.0 IT0
falling edge/low Level triggered external interrupts.

4. Interrupt Priority (IP) Register:


Each source of the interrupt can be individually programmed to be in either of
the two priority levels. The priorities can be assigned to each interrupt by
programming appropriate bits in the SFR Interrupt Priority Register.
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
x x x PS PT1 PX1 PT0 PX0

Symbol Name and Function


x Reserved
PS Priority of Serial Interrupt. If 1, Priority of Serial Interrupt is higher
PT1 Priority of Timer 1 interrupt. If 1, Priority of Timer 1 interrupt is higher
PX1 Priority of External interrupt 1. If 1, Priority of the INT1 is higher
PT0 Priority of Timer 0 interrupt. If 1, Priority of Timer 0 Interrupt is higher
PX0 Priority of External interrupt 0. If 1, Priority of the INT0 is higher

48
5. Serial Port Control Register (SCON):
The serial port control and status register is the Special Function Register
SCON. This register contains not only the mode selection bits, but also the 9th data
bit for transmit and receive (TB8 and RB8) and the serial port interrupt bits (TI and
RI).
MSB LSB
SM0 SM1 SM2 REN TB8 RB8 TI RI

Where SM0, SM1 specify the serial port mode, as follows:


SM0 SM1 Mode Description Baud Rate
0 0 0 Shift register f osc / 12
0 1 1 8-bit UART Variable
1 0 2 9-bit UART f osc / 64 or fosc /32
1 1 3 9-bit UART variable

Enables the multiprocessor communication feature in Modes 2 and 3. In Mode 2 or


3, if SM2 is set to 1, then Rl will not be activated if the received 9th data bit (RB8)
SM2
is 0. In Mode 1, if SM2=1 then RI will not be activated if a valid stop bit was not
received. In Mode 0, SM2 should be 0.
Enables serial reception. Set by software to enable reception. Clear by software to
REN disable reception.
The 9th data bit that will be transmitted in Modes 2 and 3. Set or clear by software
TB8 as desired.
In Modes 2 and 3, is the 9th data bit that was received. In Mode 1, it SM2=0, RB8 is
RB8 the stop bit that was received. In Mode 0, RB8 is not used.
Transmit interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or
TI at the beginning of the stop bit in the other modes, in any serial transmission. Must
be cleared by software only.
Receive interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or
RI halfway through the stop bit time in the other modes, in any serial reception (except
see SM2). Must be cleared by software only.

Practice does not make perfect.


Only perfect practice makes
perfect.

49
Annexure C
Architecture of MSP430 microcontroller

Figure : Internal Architecture of MSP 430


Addressing mode

All the addressing modes for the source operand and all four addressing modes for the
destination operand can address the complete address space. The bit number show the
content of the As resp. Ad mode bits.

Table 1: Addressing modes in MSP 430

50
Instruction Set of MSP430

51
Microcontrollers Lab- 2015-
10ESL47 16

APPENDIX D
MCU 8051IDE
MCU 8051 IDE is a new modern graphical integrated development environment for
microcontrollers based on 8051. For those who believe 8051 is a great piece of
technology this IDE is a new way how to see and feel these still famous
microcontrollers. MCU 8051 IDE is noncommercial open-source software
primarily for Microsoft Windows and GNU/Linux Supported programming languages
are C language and assembly. It has its own assembler and support for 2 external
assemblers. For C language it uses SDCC compiler. There are packages for various
Linux distributions (.rpm and .deb), and installer for Microsoft Windows. This IDE
contains simulator, source code editor, assembler, HW programmer and much other
tools. Simulator supports over 79 MCU primarily from Atmel. There is also support
for simple hardware simulation (like LEDs, keys, etc.).

Dept. of EEE, C.I.T., 52


Gubbi
Microcontrollers Lab- 2015-
10ESL47 16
List of major Features

 Advanced simulator with support for more than 79 MCUs.


 Built-in optimizing macro assembler
 Support for C language
 Simple external hardware simulation
 Interactive help for assembly language
 Interrupt monitor & editor
 Advanced source code editor
 Syntax highlight
 Syntax validation
 Pop-up based auto-completion
 Editor command line Interactive map of SFR
 Tools for converting between various data files related to MCUs
 Editor of bit addressable area in the simulated MCU
 Stopwatch timer
 Special calculator optimized for use with 8051
 Assembler symbol viewer
 Base converter
 8 segment display editor
 Hexadecimal editor
 Interactive ASCII chart
 Simple graphical notepad
 Various information windows, tool tips, legends
 IO Ports monitor
Virtual Hardware Simulator

MCU 8051 IDE simulator is also equipped with a few simulated simple
hardware devices, which can be connected to the simulated MCU. These
virtual hardware components are intended primarily to offer a better insight
into programs interacting with things like LEDs or keys.

Dept. of EEE, C.I.T., 53


Gubbi
Microcontrollers Lab- 2015-
10ESL47 16

Fig: Virtual Hardware Examples

Dept. of EEE, C.I.T., 54


Gubbi

You might also like