Exp 6 MPMC
Exp 6 MPMC
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:
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 :
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 :
HERE:
MOV R0, #20d
TON:
SETB P1.0
TOFF:
CLR P1.0
SJMP START
;SHIVKANYA 22BEE1063
END
RESULTS:
(i)
The experiment demonstrates the generation of a square wave for the specified duty cycle and other
specifications using Kiel software.