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

Sazid Khandaker 1520347642 Assignment 6

The document is an assignment submission for a course on microprocessor interfacing and embedded systems. It includes the student's name, ID, email and the question being answered. The question asks to write embedded C code for an 8051 microcontroller to produce a timing diagram using a timer. The code provided uses timers and delays to toggle an output pin accordingly.

Uploaded by

Sazid Khandaker
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views3 pages

Sazid Khandaker 1520347642 Assignment 6

The document is an assignment submission for a course on microprocessor interfacing and embedded systems. It includes the student's name, ID, email and the question being answered. The question asks to write embedded C code for an 8051 microcontroller to produce a timing diagram using a timer. The code provided uses timers and delays to toggle an output pin accordingly.

Uploaded by

Sazid Khandaker
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment- 06

CSE 331

Microprocessor Interfacing and Embedded System

Section 01

Summer 2020

North South University

Submitted To: Dr. Dihan Md. Nuruddin Hasan (dmh)

Name : Sazid Khandaker

Student ID : 1520347642

Email Address : [email protected]


1. Write the embedded C code for 8051 to produce the following timing diagram. Use timer.
Assume a 8051 clock frequency of 11 MHz [10]

Ans: Here is the embedded C code,

#include <REG51.h>
sbit portbit = P1^0;
void delay();
void delay ()
{

TMOD =0x1;
TH0=0x2A;
TL0=0x9E;
TR0=1;
while (TF0 !=1 )
{

;
}
}
void main()
{

portbit =0;
while(1)
{
delay();
portbit =1;

delay();
delay();
portbit =0;
}
}

You might also like