time delay problem !!!

Discussion in 'Programmer's Corner' started by lesin akbar, Dec 16, 2007.

  1. lesin akbar

    Thread Starter Active Member

    Dec 16, 2007
    30
    0
    im trying to generate 1sec time delay in 89C51. Im using 12MHz xtal. so my T=1micro sec. Im using t0 in mode2. so for 1sec delay i came up with a calculation of C8h x 64h x 32h = F4240h (200x100x50 = 1000000). here c8h i loaded into th0 and rest 64 and 32 i made a loop in inturrupt routine. But the delay generated is less than one sec, it is around 2/3rd of 1sec, why so ? and if else how to make this delay. ive to get it in the mode2 only.
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    There is always the method of arbitrarily increasing the number of iterations in the loop until the period does equal one second.
     
  3. lesin akbar

    Thread Starter Active Member

    Dec 16, 2007
    30
    0
    yah , atlast i've to go with that, thanx
     
Loading...