Microcontroller
Microcontroller
DIGITAL ASSIGNMENT 03
CALCULATION:
Given,
Time period,
Therefore,
Delay =
( ) ( )
SIMULATION:
OBSERVATION:
The following program generated a square waveform nearing to 500Hz on pin P1.0
NAME : ashish KUMAR
REGISTRATION NO. : 21BEC2017
CALCULATION:
Given,
Time period,
Therefore,
Delay =
( ) ( )
SIMULATION:
OBSERVATION:
The following program generated a square waveform of 2KHz on pin P2.0.
NAME : ashish KUMAR
REGISTRATION NO. : 21BEC2017
CALCULATION:
Given, Delay
( ) ( )
SIMULATION:
OBSERVATION:
Required Square wave was generated.
NAME : ashish KUMAR
REGISTRATION NO. : 21BEC2017
CALCULATION:
Given, Delay
( ) ( )
SIMULATION:
Before Reaching 10 :-
After Reaching 10 :-
NAME : ashish KUMAR
REGISTRATION NO. : 21BEC2017
OBSERVATIONS:
This code initializes Timer 1 in mode 2 and Timer 0 in mode 1, and sets up Port 1.2 as the
output for the delay. The program enters a loop that increments a counter and displays its
value on Port 2. Once the counter reaches 10, the program sets up Timer 0 to generate a 10ms
delay, clears Port 1.2 to begin the delay, and waits for the delay to complete before looping
back to the start of the counting loop.