Hello, PicBasic considers an enabled WDT. Such way I suggest to replace one of NOPs with CLRWDT instruction. Regards, Imre +-----------------------------------------------------------------------+ | The information transmitted is intended only for the person or entity | | to which it is addressed and may contain confidential and/or | | privileged material. Any review, retransmission, dissemination or | | other use of, or taking of any action in reliance upon, this | | information by persons or entities other than the intended recipient | | is prohibited. If you received this in error, please contact the | | sender and delete the material from any computer. | +-----------------------------------------------------------------------+ On Tue, 4 Sep 2001, Dave Vanee wrote: > Hello, > I'm trying to make a simple timing loop which will run more than 255 > times. I need 0.1us precision, so I'm using inline asm in a PICbasic > program. The number of times the loop will run will vary from 0 to 9999. > I'm using a 20MHz clock speed. > > How can I access the individual bytes of a defined word variable? > > This is my 'AccuratePause' routine right now. It seems to give a ~4 > second pause regardless of the Pause length input. > > temp var word > temp2 var byte > > AccuratePause: > Asm > APmpl: movlw 99 > movwf _temp2 > APlp: decfsz _temp2,1 > goto APlp > nop > nop > APdn: decfsz _temp+1,1 > goto APmlp > decfsz _temp,1 > goto APmlp > Endasm > Return > > The _temp+1 and _temp are guesses as to how I should access the bytes. I > tried flipping them as well with the same results. > > Thanks in advance for any help you can give. This being my first post; I > hope I haven't done anything wrong. > > Dave > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics