Microcontroller Program to generate a square wave of 10 Hz at pin P1.0 of 8051 using timer

By

#include <reg51.h> // include 8051 register file
sbit pin = P1^0; // decleare a variable type sbit
for P1.0
main()
{
P1 = 0x00; // clear port
TMOD = 0x09; // initialize timer 0 as 16 bit timer
loop:TL0 = 0xAF; // load valur 15535 = 3CAFh so after
TH0 = 0x3C; // 50000 counts timer 0 will be
overflow
pin = 1; // send high logic to P1.0
TR0 = 1; // start timer
while(TF0 == 0) {} // wait for first overflow for 50 ms
TL0 = 0xAF; // again reload count
TH0 = 0x3C;
pin = 0; // now send 0 to P1.0
while(TF0 == 0) {} // wait for 50 ms again
goto loop; // continue with the loop
}

http://thegkgarden.blogspot.com

keywords:c program to generate a square wave, matlab program to generate a square wave, program to generate square wave in 8051, program to generate square wave using 8051, program to generate square wave in 8085, program to generate square wave in 8086, program to generate square wave using 8255, program to generate square wave using 8085, program to generate square wave in keil, program to generate square wave, assembly language program to generate a square wave, write a program to generate a square wave with 75 duty cycle, write a program to generate a square wave of 50 duty cycle, write a program to generate a square wave, assembly program to generate square wave, write an 8051 assembler program to generate a square wave, write a program to generate square wave in 8051, write a program to generate square wave using 8086, program timer 0 to generate a square wave of 0.5khz, write a program to generate a square wave with 75 duty cycle on bit p1.5, 8051 c program to generate square wave, embedded c program to generate square wave, program to generate square wave using dac, program to generate square wave in c, program to generate square wave in matlab, 8085 program to generate square wave logic, program to generate square wave using matlab,

1 comment:


  1. Write a program ALP by emu8086 to generate a square wave of duration 200 µ sec on out address 55h Assuming that the frequency of the processor is 5MHz

    ReplyDelete

If you have any questions or droughts feel free to ask here.