Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

calculating time delay for 89c51 mcu

Status
Not open for further replies.

itsfanidotcom

Member level 5
Joined
Mar 9, 2007
Messages
87
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,288
Activity points
1,868
how to calculate delay in 89c51 using c

hi there i need to calculate exact time delay for microcontroller AT89C51. for serial communication i use 9600 baud rate and timer 1 in mode 2, and 11.0592 MHz crystal. i need to know that using the c language how much loop factor should i give to obtain exact 1sec delay.i mean for(x=1, x<=y),,, value of y?
is there any formula.. or some thing like this.
 

how to calculate baud rate in 89c51

it depends on your controller clock cycles.

1 instruction 2 cycles
like that
 

mcu c language delay

This topic has been discussed here for several times ..
It's just the matter of using SEARCH ..
Here is one example:


Regards,
IanP
 

89c51 embedded c book(mazid)

//led blinking after 1 sec
#include <reg51.h>
int count=0;
int val;
void msDelay(int a)
{
TMOD=0x02;
TH0=256-(255/1.085);
TR0=1;
IE=0x82;
val=((a/255)+.9)*1000;
}
void abbas() interrupt 1
{
count++;
if(count==val)
{
P2=~P2;
count=0;
}
}
void main()
{
msDelay(1000);
while(1);
}
 

89c51 timer 1 example

just go through Mazid or Ayala book for detailed timing analysis it will be of great help to you r else go for trail and error basis to get the exact timing during simulation
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top