I think you need a number of 256 value tables and then "call table1", "call table2" and so on depending on the actual number in "overflow". Each table taking care of one 256 byte sequence each. Another thing, do use the pre-defined symbols for the flags in the SFRs, like "bcf intcon, t0ie" instead of "bcf intcon, 2". The code is much easier to read that way. Another different solution to this problem would be to store the full "table" in some external memory like a serial EEPROM. The value in "overflow" would then just be the address bits 8 and 9. Address bits 0 to 7 would of course be the final tmr0 value. That way it would also be easier to update the table in the field, if needed. And, a big *AND*, it's tmr0, not tmro !! Jan-Erik. -----Original Message----- From: Kevinhoward@AOL.COM [mailto:Kevinhoward@AOL.COM] Sent: den 27 juli 2003 20:30 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]:16bit timer and large lookup table 16f62x Hi, Using tmro sounds easier but I haven't worked out how to actually add how many times tmro has overflowed ff's to the table-(as you will have guessed I am still on the learning curve!!!) If I used TMRO; p1 btfsc pulse1 ;start goto p1 clrf tmro bcf intcon,2 ;clear tmro and intcon,2 p2 btfsc intcon,2 call oflowcount ;stores nuber of times tmro has overflowed btfsc pulse2 ;end time goto p2 movf tmro,w movwf time ;tmro value now stored in time workout movf time,w ;tmro value call table1 movwf timedelay ;tmro value now stored in time delay goto rest of program oflowcount btfss intcon,2 return incf overflow ;number of times tmro has overflowed stored here bcf intcon,2 return ;how can I add number of ff rollovers as stored in overflow to the table? table1 ;750-1000 lines addwf pcl,f retlw . retlw . ;etc Thanks again Kev -- 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 -- 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