O.K let me get this right: 1. create a delay routine of 0.1s i.e delsy_0.1s call delay_0.1s call delay_0.1s .. .. .. repeat this 74 times I am sorry for my ignorant but that's my understanding of calling 0.1s delay 74 times. Am I right or made a fool of myself. > > Mauricio wrote: > > > > >You call Delay1 > > > Delay1 calls delay2 ---> You need different registers for > > > delay1 and delay2 > > and > > >You call Delay1 > > >You call Delay2 ---> You can use the same registers for both delays. > > > > I went with the second option.It works perfect apart from the very last > >I would have gone (and generally do) with the first. Make a 0.2s delay >and call it X times to get a longer one. eg call delay_0.2s 74 times to get >14.8s. You still need only 3 RAM registers. d1/d2 for the 0.2s routine >and d3 to count calls. Makes it much easier to change or add a delay >without having to work out instruction cycles > >Your Delay_14.8s routine runs for 14.80000s at 4MHz BTW (according >to an MPLAB simulation) > >Also, it's good practise to put at least one NOP between those bcfs and >bsfs on the port pins > >http://www.piclist.com/techref/readmodwrite.htm > >Driving LEDs, probably not a problem but it pays to eliminate any >possibility > >-- >http://www.piclist.com#nomail Going offline? Don't AutoReply us! >email listserv@mitvma.mit.edu with SET PICList DIGEST in the body _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body