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.

Problem in Delay caalculation for P89v51RD2

Status
Not open for further replies.

piyush manavar

Member level 4
Member level 4
Joined
Jul 23, 2009
Messages
78
Helped
10
Reputation
20
Reaction score
8
Trophy points
1,288
Location
india
Activity points
1,827
hi

i am working with 8051 core uc p89v51rx2 from NXP.

for this i developed a code for delay in ms is

void delay_ms(unsigned int ms)
{
unsigned int i,j;
for(i=0;i<ms;i++)
for(j=0;j<53;j++);
}

in which unsigned int ms is the no. that much ms delay generated by this loop.

but problem is that is not gives proper delay.
it is approx half of my actual calculated value.

i don't know where is the problem.

i am using 11.0592 MHz crystal and 12 clock cycle/Machine cycle mode.

as per my calculation the second for loop int is 53 but i think it is wrong.

please help me to figure out it...


thanks.

-Piyush
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top