Month: October 2012

Waveforms in 8051 Microcontroller

Square Wave To create a square wave generation using Delay. let us say we want to construct a 1khz square waveform the processor instruction cycle of 8051 is 1.085microseconds so for 1khz (1milli seconds =1/1khz), is 1ms/1.085microseconds = 921.6 (this value is set to the for loop) #include <reg51.h>void delay(){int i=0;for(i=0;i<922;i++)}void main(){P0=0xff;delay();P0=0x00;delay();} Sine Wave generation …

Waveforms in 8051 MicrocontrollerRead More »