Tuesday, April 15, 2003, 1:40:36 PM - Olin wrote: >> RTC_DELAY >> MOVLW D'254' >> MOVWF DELAY_COUNT ;set counter value >> RTC_DELAY_LOOP >> DECFSZ DELAY_COUNT,F ;dec delay_count, is zero? if yes, skip >> GOTO RTC_DELAY_LOOP ;no, else loop >> RETURN ;yes, return > Unless DELAY_COUNT is in the global ram from 70h - 7Fh, you need to pay > attention to the bank setting. In general, you should have a consitant > strategy for dealing with banking. The method I use is the DBANKIF and > related macros in STD.INS.ASPIC at http://www.embedinc.com/pic. Thankyou, that will come in useful. However the problem itself turned out to be a caused by a hardware flaw in my circuit layout - the actual error was occurring much earlier, but I didn't see it until I worked out each input until that point on paper, again :/ I wish I had seen those macros a few months ago :) I'm sure to run into something related to banking errors soon, as I've maintained DELAY_COUNT in 0x22h. Due to limited variables, I only have to switch between bank 0 and 1, which has helped consistency, but can't be guaranteed. Thanks again. -- All the best, Glenn Davidson -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body