0% found this document useful (0 votes)
34 views25 pages

Updated Emb Sys & Comm Lab Manual

Uploaded by

kuzzzdmh3b
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
34 views25 pages

Updated Emb Sys & Comm Lab Manual

Uploaded by

kuzzzdmh3b
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 25

S.

NO LIST OF EXPERIMENTS

1. STUDY OF MICROCONTROLLER 8051/8031/8096 & FLASH CONTROLLER

2. ARITHMETIC OPERATIONS USING 8051

3. ANALOG TO DIGITAL CONVERTER INTERFACE TO 8051

4. DIGITAL TO ANALOG CONVERTER INTERFACE TO 8051

5. INTERFACING TO DIGITAL TO ANALOG CONVERTER FOR GENERATING

WAVEFORMS

6. SORTING OF AN ARRAY USING 8051

7. STUDY OF REAL TIME OPERATING SYSTEM

8. ASSEMBLY LANGUAGE PROGRAM FOR ARITHMETIC OPERATIONS USING KEIL

SOFTWARE

9. ASSEMBLY LANGUAGE PROGRAM FOR DATA TRANSFER USING KEIL SOFTWARE

10. ASSEMBLY LANGUAGE PROGRAM FOR SORTING OF AN ARRAY USING KEIL


SOFTWARE

AMET University Kanathur, Chennai-112


MICROCONTROLLER 8051 –INSTRUCTION FOR LOADING AND EXECUTING
PROGRAMS
Expt. No: 1
Date: STUDY OF MICROCONTROLLER 8051/8031/8096 & FLASH CONTROLLER

Aim:

To Study about microcontroller 8051/8031/8096 & Flash Controller.

Theory:

Intel MCS-51- 8031AH/8051AH

Intel introduced 8051, referred as MCS-51, in 1981, 8031AH/8051AH, 8032AH/8052AH are the devices
under Intel MCS 51 Microcontroller family. The MCS 51 microcontroller products are optimized for
control applications. Byte-processing and numerical operations on small data structures are facilitated
by a variety of fast addressing modes for accessing the internal RAM. The instruction set provides a
convenient menu of 8-bit arithmetic instructions, including multiply and divide instructions. Extensive
on-chip support is provided for one-bit variables as a separate data type, allowing direct bit
manipulation and testing in control and logic systems that require Boolean processing. The 8051 is a
subset of the 8052 and the 8031 is a ROM-less 8051.

Features of Intel MCS-51

 The 8051 is an 8-bit processor


 High Performance HMOS Process
 Internal Timers/Event Counters
 2-Level Interrupt Priority Structure
 The CPU can work on only 8 bits of data at a time
 The 8051 had 128 bytes of RAM
 4K bytes of on-chip ROM
 Two timers
 One serial port
 Four I/O ports, each 8 bits wide
 6 interrupt sources
 32 I/O Lines (Four 8-Bit Ports)
 64K Program Memory Space
 Security Feature Protects EPROM Parts
 Against Software Piracy
 Boolean Processor
 Bit-Addressable RAM
OVERVIEW OF MICROCONTROLLER

Intel MCS-96 Family -8096BH


Features

Flash Controller - ATMEL - AT89S31/AT89S51


(8-bit Microcontroller with 4K Bytes In-System Programmable Flash controller)

Description

The AT89S31/AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K bytes of


in-system programmable Flash memory. The device is manufactured using Atmel’s high-density
nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and
pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a
conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system
programmable Flash on a monolithic chip, the Atmel AT89S51 is a powerful microcontroller which
provides a highly-flexible and cost-effective solution to many embedded control applications. The
AT89S51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines,
Watchdog timer, two data pointers, two 16-bit timer/counters, a five vector two-level interrupt
architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S51 is
designed with static logic for operation down to zero frequency and supports two software selectable
power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port,
and interrupt system to continue functioning. The Power-down mode saves the RAM contents but
freezes the oscillator, disabling all other chip functions until the next external interrupt or hardware
reset.

Features
• Compatible with MCS-51® Products
• 4K Bytes of In-System Programmable (ISP) Flash Memory
• Endurance: 1000 Write/Erase Cycles
• 4.0V to 5.5V Operating Range
• Fully Static Operation: 0 Hz to 33 MHz
• Three-level Program Memory Lock
• 128 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Two 16-bit Timer/Counters
• Six Interrupt Sources
• Full Duplex UART Serial Channel
• Low-power Idle and Power-down Modes
• Interrupt Recovery from Power-down Mode
• Watchdog Timer
• Dual Data Pointer
• Power-off Flag
• Fast Programming Time
• Flexible ISP Programming

Result :

Thus, we can study and understood about microcontroller 8051/8031/8096 & Flash Controller.
Expt. No: 2
Date: ARITHMETIC OPERATIONS USING 8051

Aim:

To perform 8-bit arithmetic operations using 8051 microcontroller.

Program:
2(a)

2(b)
2(c)

2(d)

Result:
Thus, we can perform 8-bit arithmetic operations using 8051 microcontroller.
Expt. No: 3
Date:
ANALOG TO DIGITAL CONVERTER INTERFACE TO 8051

Aim:
To perform ADC programming using 8051 Microcontroller.

Procedure:

8031/51 assembly language to be practiced with VBMB-003 revision 5. The programs are written for
practicing with Micro-51.The following steps are required for execution of program

1. Place jumper J2 in B position.


2. Place jumper J5 in A position.
3. Enter and execute the program.
4. Vary the analog input and give the SOC by pressing the SOC switch.
5. See the corresponding digital value in the led display.

ADC Programming:

Fig 4.1. Block Diagram of ADC converter.


Figure 4.1 shows the block diagram of a successive approximation A/D converter. The major elements
of this converter are a D/A converter, the successive approximation register (SAR) and the comparator.
Here the output of D/A converter is compared with the measured voltage. The digital input to the DAC
is generated using successive approximation method. When the DAC output matches the analog
signal, the input to the DAC is the equivalent digital signal.

Result :
Thus, we can perform ADC programming and verify the output using 8051 microcontroller.
Expt. No: 4
Date: DIGITAL TO ANALOG CONVERTER INTERFACE TO 8051

Aim:
To perform DAC programming using 8051 Microcontroller.

DAC Programming:

The basic microprocessor board, VBMB-002, incorporates two 8-bit Digital-to-Analog converters, DAC
0800.DAC 0800 is a monolithic, high speed, current output Digital to Analog converter. Its unique
features are:

 Typical settling time of 100 Nanoseconds.


 Complementary current outputs.
 Differential output voltages of 20V peak-to-peak with simple resistor loads.

Fig 4.2. Block Diagram of DAC converter.

Result :
Thus, we can perform DAC programming and verify the output using 8051 microcontroller.
Expt. No: 5
Date:

INTERFACING TO DIGITAL TO ANALOG CONVERTER FOR GENERATING


WAVEFORMS

Aim:
To perform 8051 based DAC interface experiment for generate waveforms.

4(a). Generation of Square wave

4(b). Generation of Sawtooth wave


4(c). Generation of Triangular wave

Result:
Thus,We can generate various waveforms using 8051 based DAC interface.
Expt. No: 6
Date:
SORTING OF AN ARRAY USING 8051
Aim:
To perform Ascending and Descending order sorting of an array using 8051.

6(a) Ascending Order Sorting


MOV R4,#0AH
AGAIN: MOV R3,#0AH
MOV R0,#20H
CLR C
UP:MOV A,@R0
MOV R1,A
INC R0
MOV A,@R0
SUBB A,R1
JNC SKIP
MOV A,@R0
DEC R0
MOV @R0,A
MOV A,R1
INC R0
MOV @R0,A
SKIP:DJNZ R3,UP
DJNZ R4,AGAIN
RET

6(b) Descending Order Sorting


MOV R4,#0AH
AGAIN: MOV R3,#0AH
MOV R0,#20H
CLR C
UP:MOV A,@R0
MOV R1,A
INC R0
MOV A,@R0
SUBB A,R1
JC SKIP
MOV A,@R0
DEC R0
MOV @R0,A
MOV A,R1
INC R0
MOV @R0,A
SKIP:DJNZ R3,UP
DJNZ R4,AGAIN
RET
Result : Thus, we can perform Ascending and Descending order sorting of an array using 8051.

Expt. No: 7
Date:
STUDY OF REAL TIME OPERATING SYSTEM

Aim:

To Study about RTOS Environment and System Programming concepts in Keil /Tornado Tool.

Theory:
Tornado

An IDE to develop real-time and embedded applications with minimal intrusion on the target system.

 An integrated source-code editor.


 A project management facility.
 Integrated C and C++ compiler and linker.
 The browser, a visual monitoring tool for target system.
 CrossWind, a source-level debugger.
 WindSh, C and Tcl command shell that controls the target.
 VxWorks target simulator VxSim.
 WindView software logic analyzer for the target simulator.
Overview of Tornado IDE

Tornado comprises:

 VxWorks, a high-performance real-time operating system.


 Application-building tools (compilers and associated programs).
 IDE for managing projects, host-target communication, running, debugging, and
monitoring VxWorks applications.
Result :

Thus, we can study and understand RTOS Environment and System Programming concepts in
Keil/Tornado Tool.
PROCEDURE FOR PROGRAMS ON KEIL SOFTWARE

Click on Keil uvision3.


Click on ‘Project’, create a new project and save it in a new folder choose target option for Atmel
and AT89C51.
Go to File, click on new file, and type the program.
Go to File, click on ‘save as’, save the program with extension .asm on your particular folder where
you saved your project.
Add your program to Source Group 1 which is at Target1 (Project workspace) which is created
after selecting the target in step 2.
To do this right clicks on Source Group 1 and select ‘Add files to Source Group 1’.
Search your code with .asm extension.
Now Click on Translate current file tab present file toolbar and check for errors. If error present
then rectify.
Click on Rebuild all target files to add our program to the AT89C51 target.
Go to Debug, click on Start/Stop debug session.
For giving input data: Go to view, click on Memory window.
Enter inputs for corresponding memory addresses.
For internal memory type: i:0x20 for example
For external memory type: x:0x2000 for example
Now click on “Run”, check the results.
While in Debug don’t make any changes in the program.
After running again click Start/Stop debug session to edit mode for changes in program.
Expt. No: 8
Date:

ASSEMBLY LANGUAGE PROGRAM FOR ARITHMETIC OPERATIONS USING KEIL


SOFTWARE

Aim: To perform arithmetic operations using keil software.

8(a) Addition operation

ORG 0000H
MOV A,#05H
MOV B,A
MOV B,#03H
ADD A,B
MOV R0,A
L:SJMP L
END

8(b) Subtraction operation

ORG 0000H
MOV A,#03H
MOV B,A
MOV B,#05H
SUBB A,B
MOV R0,A
L:SJMP L
END

8(c) Multiplication operation

ORG 0000H
MOV A,#03H
MOV B,#03H
MUL AB
MOV R1,A
l:SJMP L
END

8(d) Division operation

ORG 0000H
MOV A,#03H
MOV B,#09H
DIV AB
MOV R1,A
MOV R2,B
l:SJMP L
END

Result:
Thus, we can perform arithmetic operations using keil software.
Expt. No: 9
Date:

ASSEMBLY LANGUAGE PROGRAM FOR DATA TRANSFER USING KEIL SOFTWARE

Aim: To perform data transfer operation using keil software.

PROGRAM:

MOV R0,#20H
MOV R1,#30H
MOV R3,#10H
CLR A
AGAIN:MOV A,@R0
MOV @R1,A
INC R0
INC R1
DJNZ R3,AGAIN
END

RESULT:
Inputs:
i: 0x20 -- 01h, 02h, 03h, 04h
Output:
i: 0x30 -- 01h, 02h, 03h, 04h

Result:
Thus, we can perform data transfer operation using keil software.
Expt. No: 10
Date:

ASSEMBLY LANGUAGE PROGRAM FOR SORTING OF AN ARRAY USING KEIL


SOFTWARE

Aim: Write an assembly language program for arranging in ascending/descending order using keil software

10(a) PROGRAM FOR ASCENDING ORDER:

MOV R0,#5 ; INITIALIZE COUNTER 1


AGAIN: MOV DPTR,#2000H ; initialize memory pointer
MOV R1,#4 ; initialize counter 2
BACK: MOV R2,DPL ; save lower byte of memory address
MOVX A,@DPTR ; Get the num ber
MOV B,A ; Save the number
INC DPTR ; Increment the memory pointer
MOVX A,@DPTR ; Get the next number
CJNE A,B,n ; If not equal check for greater or less
AJMP SKIP ; Otherwise go to skip
n: JNC SKIP ;If
MOV DPL,R2 ;Exchange
MOVX @DPTR,A
INC DPTR
MOV A,B
MOVX @dptr,A
SKIP: DJNZ R1,BACK ;If R1 not equal to 0 go to BACK
DJNZ R0,AGAIN ;If R0 not equal to 0 go to AGAIN

RESULT:
Inputs:
x: 0x2000 -- 05h, 02h, 01h, 04h
Output:
x: 0x2000 -- 01h, 02h, 04h, 05h
10(b) PROGRAM FOR DESCENDING ORDER:

MOV R0,#5 ; INITIALIZE COUNTER 1


AGAIN: MOV DPTR,#2000H ; initialize memory pointer
MOV R1,#4 ; initialize counter 2
BACK: MOV R2,DPL ; save lower byte of memory address
MOVX A,@DPTR ; Get the num ber
MOV B,A ; Save the number
INC DPTR ; Increment the memory pointer
MOVX A,@DPTR ; Get the next number
CJNE A,B,n ; If not equal check for greater or less
AJMP SKIP ; Otherwise go to skip
n: JC SKIP ;If
MOV DPL,R2 ;Exchange
MOVX @DPTR,A
INC DPTR
MOV A,B
MOVX @dptr,A
SKIP: DJNZ R1,BACK ;If R1 not equal to 0 go to BACK
DJNZ R0,AGAIN ;If R0 not equal to 0 go to AGAIN
RESULT:
Inputs:
x: 0x2000 -- 05h, 02h, 01h, 04h
Output:
x: 0x2000 -- 05h, 04h, 02h, 01h

Result:
Thus, we can perform ascending and descending order sorting of an array using keil software.

You might also like