0% found this document useful (0 votes)
6 views3 pages

Exp 6 MPMC

Uploaded by

shivkanya
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)
6 views3 pages

Exp 6 MPMC

Uploaded by

shivkanya
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
You are on page 1/ 3

2nd SEPTEMBER 2024 SHIVKANYA B

22BEE1063

EXPERIMENT 6
Generating a Square Wave using MC8051
(HARDWARE)

AIM:

To implement a square wave generator using the 8051 microcontroller, program it with Keil software, and
observe the generated wave on a digital oscilloscope.

THEORY:

To generate a square wave on an 8051 microcontroller, the process involves:

Configuring the Output Pin: One of the GPIO (General Purpose Input Output) pins of the 8051 will be
configured as an output pin.

Toggle the Pin State: The output pin will be alternated between a high (logic 1) and a low (logic 0) state
using a delay function to control the time between the transitions.

Delay Function: The frequency of the square wave depends on the delay between toggling the pin. A
smaller delay results in a higher frequency, and a larger delay results in a lower frequency.

PROCEDURE :

1. Open Keil software.

2. Create a new project and select the 8051 microcontroller.

3. Write the code in editor and compile it.

4. Load the Program to 8051

5. Connect Oscilloscope:

6. Connect an output pin (P1.0) of the 8051 microcontroller to the input channel of the digital
oscilloscope.

7. Adjust the time and voltage scale to visualize the square wave generated by the 8051.

CODE :

(i) ORG 000H

HERE:
MOV R0, #20d

MOV R1, #20d

TON:

SETB P1.0

DJNZ R0, TON

TOFF:

CLR P1.0

DJNZ R1, TOFF

SJMP START

;SHIVKANYA 22BEE1063

END

RESULTS:

(i)

(ii) Oscilloscope Output


CONCLUSION:

The experiment demonstrates the generation of a square wave for the specified duty cycle and other
specifications using Kiel software.

You might also like