Professional Documents
Culture Documents
RESOURCES: PC loaded with ESA software and connected to 8051 microcontroller hardware kit,
Regulated power supply.
THEORY:
MEMORY ARCHITECTURE:
The 8051 microcontroller has four distinct types of memory-internal RAM, special function registers,
program memory, and external data memory.
The 8051 is designed as a strict Harvard architecture; it can only execute code fetched from program
memory, and has no instructions to write to program memory.
INTERNAL RAM:
It has an 8-bit address space, allowed addresses 0 through 0Xff.IRAM from 0x00 to 0x7F can be accessed
directly. The address is loaded into R0 or R1, and memory is accessed using the @ R0 or @R1; indirect
address to those addresses will access the second half of the IRAM.
PROCEDURE:
Switch on the PC, check for ESA term and enter into esa xt51.
In the kit, we need to check serial in display.
Open xt51.
Reset your kit.
Then we will get into prompt mode.
Give the program starting address with the syntax: A 800 and give enter.
Enter the program.
For termination from the program mode press ESC.
For given input use MD data address.
For execution press SR Program starting address.
Do this operation till completion of program.
Note down the results of each and every step.
For getting the opcodes use Z command.
Syntax: Z starting address ending address.
ALGORITHM:
1. Initialize the accumulator and Point DPTR to an address location.
2. Read external memory location content to accumulator.
3. Copy the data from accumulator to port P1 address (Reading).
4. Copy the data from port3 to accumulator (Writing).
5. Increment DPTR and Copy the data in accumulator to external memory location.
OBSERVATIONS:
A B SP PSW DPH DPL TH0 TL0 TH1 TL1 P1 P3 PCH PCL
(E0) (F0) (81) (D0) (83) (82) (8C) (8A) (8D) (8B) (90) (B0)
00 00 07 01 9D 00 00 00 00 00 FF FB 90 03
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
D7 79 7F BF 51 63 F4 4C 00000001
8003 E0 MOVX A, @DPTR
A B SP PSW DPH DPL TH0 TL0 TH1 TL1 P1 P3 PCH PCL
(E0) (F0) (81) (D0) (83) (82) (8C) (8A) (8D) (8B) (90) (B0)
00 00 07 01 9D 00 00 00 00 8E FF FB 90 04
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
D7 79 7F BF 51 63 F4 4C 00000001
8004 F5 90 MOV 90H, A
A B SP PSW DPH DPL TH0 TL0 TH1 TL1 P1 P3 PCH PCL
(E0) (F0) (81) (D0) (83) (82) (8C) (8A) (8D) (8B) (90) (B0)
00 00 07 01 9D 00 00 00 00 8E FF FB 90 06
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
D7 79 7F BF 51 63 F4 4C 00000001
8006 E5 B0 MOV A, 0B0H
A B SP PSW DPH DPL TH0 TL0 TH1 TL1 P1 P3 PCH PCL
(E0) (F0) (81) (D0) (83) (82) (8C) (8A) (8D) (8B) (90) (B0)
00 00 07 01 9D 00 00 00 00 8E FF FB 90 08
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
D7 79 7F BF 51 63 F4 4C 00000001
8008 A3 INC DPTR
A B SP PSW DPH DPL TH0 TL0 TH1 TL1 P1 P3 PCH PCL
(E0) (F0) (81) (D0) (83) (82) (8C) (8A) (8D) (8B) (90) (B0)
00 00 07 01 9D 00 00 00 00 8F FF FB 90 09
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
D7 79 7F BF 51 63 F4 4C 00000001
8009 F0 B0 MOVX@DPTR, A
A B SP PSW DPH DPL TH0 TL0 TH1 TL1 P1 P3 PCH PCL
(E0) (F0) (81) (D0) (83) (82) (8C) (8A) (8D) (8B) (90) (B0)
00 00 07 01 9D 00 00 00 00 8F FF FB 90 0A
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
D7 79 7F BF 51 63 F4 4C 00000001
PVP SIDDHARTHA INSTITUTE OF TECHNOLOGY
DATE: SHEET NO:
RESULT: Reading and writing on a parallel port in 8051 microcontroller has been performed.
RESOURCES: PC loaded with ESA software and connected to 8086 microprocessor hardware kit, ADC/DAC
interface, Regulated power supply.
THEORY:
The Intel 82C55A is a general purpose programmable I/O device which may be used with many different
microprocessors. There are 24 I/O pins which may be individually programmed in 2 groups of 12 and used in 3 major
modes of operation. The high performance and industry standard configuration of the 82C55A make it compatible
with the 8086.
PROCEDURE:
ALGORITHM:
1. Initialize control word register.
2. Send the data to the port A in different steps from 00 to FF and from FF to 00 i.e. during on cycle
duration and off cycle duration.
3. Repeat step2 for repeated cycles for getting continuous sine wave.
CODE:
MOVB AL, #80
MOVW DX, #0FFE7
OUTB DX
L7: MOVB AL, #00
L1: MOVWDX, #0FFE1
OUTB DX
INCB AL
CMPB AL, #0F
JB L1
L2: MOVWDX, #0FFE1
OUTB DX
INCB AL
INCB AL
INCB AL
CMPB AL, #0EF
JB L2
L3: MOVWDX, #0FFE1
OUTB DX
INCB AL
CMPB AL, #0FF
JB L3
L4: MOVW DX, #0FFE1
OUTB DX
DECB AL
CMPB AL, #0EF
JA L4
L5: MOVWDX, #0FFE1
OUTB DX
DECB AL
DECB AL
DECB AL
CMPB AL, #0F
JA L5
L6: MOVWDX, #0FFE1
OUTB DX
DECB AL
CMPB AL, #00
JA L6
JMP L7
INT 03
MACHINE CODE:
ADDRESS OPCODE MNEMONIC OPERAND COMMENTS
3000 B080 MOVB AL,#80 Copy the data 80 into control word
3002 BAE7FF MOVW DX,#FFE7 register of 8255A
3005 EE OUTB DX
3006 B000 MOVB AL,#00 Initialize accumulator with 00
3008 BAE1FF MOVW DX,#FFE1 In steps of 1 Send the data from 00
300B EE OUTB DX to 0F in port A of 8255
300C FEC0 INCB AL
300E 3D0F CMPB AL,#0F
3010 72F6 JB 3008
3012 BAE1FF MOVW DX,#FFE1 In steps of 3 send the data from 0F
3015 EE OUTB DX to EF in port A of 8255
3016 FEC0 INCB AL
3018 FEC0 INCB AL
301A FEC0 INCB AL
301C 3CEF CMPB AL,#EF
301E 72F2 JB 3012
3020 BAE1FF MOVW DX,#FFE1 In steps of 1 send the data from EF
3023 EE OUTB DX to FF in port A of 8255
3024 FEC0 INCB AL
3026 3CFF CMPB AL,#FF
3028 72F6 JB 3020
302A BAEHF MOVW DX,#FFE1 In steps of 1 send the data from FF
302D EE OUTB DX to EF in port A of 8255
302E FEC8 DECB AL
3030 3CEF CMPB AL,#EF
3032 77F6 JNBE 302A
3034 BAE1FF MOVW DX,#FFE1 In steps of 3 send the data from EF
3037 EE OUTB DX to 0F in port A of 8255
3038 FEC8 DECB AL
303A FEC8 DECB AL
303C FEC8 DECB AL
303E 3C0F CMPB AL,#0F
3042 77F0 JNBE 3034 Insteps of 3 send the data from 0F
3044 BAE1FF MOVW DX,#FFE1 to 0 0 in port A of 8255
3047 FE OUTB DX
3048 FEC8 DECB AL
304A 3C00 CMPB AL,#00
304C 77F6 JNBE 3044
304E EBB6 JMP 3006 Repeat the loop for getting next
cycle
3050 CC INT 3 Halt the program
RESULT: Sine wave is generated using 8086 microprocessor, its amplitude and time period are noted and
waveform is plotted.
PROCEDURE:
ALGORITHM:
1. Initialize control word register.
2. Send the data to the port A in different steps from on state to off state and vice versa.
3. Repeat step2 for repeated cycles for getting continuous square wave.
CODE:
MOVB AL, #80
MOVWDX, #0FFE7
OUTB DX
L3: MOVB AL, #00
MOVB CL, #00
L1: MOVWDX, #0FFE1
OUTB DX
INCB CL
CMPB CL, #0FF
JB L1
MOVB AL, #0FF
L2: MOVWDX, #0FFE1
OUTB DX
DECB CL
CMPB CL, #00
JA L2
JMP L3
INT 03
MACHINE CODE:
RESULT: Sine wave is generated using 8086 microprocessor, its amplitude and time period are noted and
waveform is plotted.
RESOURCES: PC loaded with ESA software and connected to 8051 microcontroller hardware kit,
Regulated power supply.
THEORY:
MEMORY ARCHITECTURE:
The 8051 microcontroller has four distinct types of memory-internal RAM, special function registers,
program memory, and external data memory.
The 8051 is designed as a strict Harvard architecture; it can only execute code fetched from program
memory, and has no instructions to write to program memory.
INTERNAL RAM:
It has an 8-bit address space, allowed addresses 0 through 0Xff.IRAM from 0x00 to 0x7F can be accessed
directly. The address is loaded into R0 or R1, and memory is accessed using the @ R0 or @R1; indirect
address to those addresses will access the second half of the IRAM.
PROCEDURE:
Switch on the PC, check for ESA term and enter into esa xt51.
In the kit, we need to check serial in display.
Open xt51.
Reset your kit.
Then we will get into prompt mode.
Give the program starting address with the syntax: A 800 and give enter.
Enter the program.
For termination from the program mode press ESC.
For given input use MD data address.
For execution press SR Program starting address.
Do this operation till completion of program.
Note down the results of each and every step.
For getting the opcodes use Z command.
Syntax: Z starting address ending address.
ALGORITHM:
1. Initialize the accumulator
2. Read the values into accumulator and register B.
3. Perform addition operation.
4. Store the result.
ADDITON:
OBSREVATIONS:
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000001
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000001
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000001
ADDITION:
MOV A, #97
MOV 0F0, #67
ADD A, 0F0
SJMP 8007
MACHINE CODE:
ADDRESS OBJECT MNEMONIC COMMENTS
8000 74 97 MOV A, #97H Copy 97 into accumulator
8002 75 F0 67 MOV 0F0H, #67H Copy 67 into register B
8005 25 F0 ADD A, 0F0H Add the values in accumulator and register B
8007 80 FE SJMP 8007H Short jump
ALGORITHM:
1. Initialize the accumulator
2. Read the values into accumulator and register B.
3. Perform subtraction operation.
4. Store the result.
SUBTRACTION:
OBSREVATIONS:
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000001
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000001
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000101
SUBTRACTION:
MOV A, #97
MOV 0F0, #67
SUBB A, 0F0
SJMP 8007
MACHINE CODE:
ADDRESS OBJECT MNEMONIC COMMENTS
8000 74 97 MOV A, #97H Copy 97 into accumulator
8002 75 F0 67 MOV 0F0H, #67H Copy 67 into register B
8005 95 F0 SUBB A, 0F0H subtract the values in accumulator and register B
8007 80 FE SJMP 8007H Short jump
ALGORITHM:
1. Initialize the accumulator
2. Read the values into accumulator and register B.
3. Perform multiplication operation.
4. Store the result.
MULTIPLICATION:
OBSREVATIONS:
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000001
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000001
8005 A4 MUL AB
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000101
MULTIPLICATION:
MOV A, #97
MOV 0F0, #67
MUL AB
SJMP 8006
MACHINE CODE:
ADDRESS OBJECT MNEMONIC COMMENTS
8000 74 97 MOV A, #97H Copy 97 into accumulator
8002 75 F0 67 MOV 0F0H, #67H Copy 67 into register B
8005 A4 MUL AB Multiply the values in accumulator and register B
8006 80 FE SJMP 8006H Short jump
ALGORITHM:
1. Initialize the accumulator
2. Read the values into accumulator and register B.
3. Perform division operation.
4. Store the result.
DIVISION:
OBSREVATIONS:
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000101
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000101
8005 84 DIV AB
R0 R1 R2 R3 R4 R5 R6 R7 PSW
(00) (01) (02) (03) (04) (05) (06) (07) CAFBB0GP
00 00 00 00 00 00 00 00 00000001
DIVISION:
MOV A, #97
MOV 0F0, #67
DIV AB
SJMP 8006
MACHINE CODE:
ADDRESS OBJECT MNEMONIC COMMENTS
8000 74 97 MOV A, #97H Copy 97 into accumulator
8002 75 F0 67 MOV 0F0H, #67H Copy 67 into register B
8005 84 DIV AB Divide the value in accumulator by register B
8006 80 FE SJMP 8006H Short jump