I'll check out the post on code question on piclist. I'm currently playing with MPLAB. What i meant by exact time means that for example i want 5ms of delay, how would i make sure my loop will only delay exactly for 5 ms and no more or less than that. On Fri, 27 Aug 2004 20:36:39 -0400, Ken Pergola wrote: > > Wan Zulhelmi Wan Ahmad Kamar wrote: > > > I actually need the exact time rather than just looping through delay. > > Hi Wan, > > I'm not quite sure what you mean by this -- could you clarify what you mean > from your statement above? > > Since you have decided on the software-generated delay as opposed to a > hardware-generated delay, one approach you could take is to write a > subroutine that delays a fixed amount of time. You could also write a > subroutine that takes an iteration parameter that allows you to have a > "user-programmable" delay depending upon the value you set the iteration > parameter before you invoke the subroutine. > > Don't rule out using a hardware timer approach for generating delays -- your > code could then do other things instead of being tied up in the software > delay. Perhaps you could give more details of your delay requirements that > you need. It's difficult to know this from what you posted so far. There was > a very recent thread here on the PICList regarding software-generated > delays -- did you happen to catch it? It was in a thread entitled 'code > question'. > > If you have not already, I would suggest using playing with MPSIM in MPLAB > IDE to aid you with your soft delay code. The stopwatch function is very > useful. > > Best regards, > > Ken Pergola > > > > > _______________________________________________ > http://www.piclist.com > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist