Hi, Mike Blakey wrote: >I am using a 16f876 and have a large lookup table of values, (196 bytes) At present >this table is in EEDATA. the access to the data is not quite fast enough, I believe >that it is possible to copy this data into program memory, possible using a routine >at boot-up. I have looked in Microchips archive, and don't fully understand how to >do this. Has anyone done this sort of thing before, and could point me in the right >direction, Thanks. From what I understand you are using the eeram to store the table ? In that case I assume something like this is used to access it: ; *********************************************************************** ; EE_WRITE_BYTE - Routine to read a byte from ee ram ; Adress in W, byte will be delivered in W EE_READ_BYTE BANK2 MOVWF EEADR ; put in adress reg. BSF STATUS,RP0 ; bank3 !! BCF EECON1,EEPGD ; set to read data memory BSF EECON1,RD ; set bit to read BCF STATUS,RP0 ; bank2 !! MOVF EEDATA,W ; move data to W BANK0 ; Reset to BANK0 ! RETURN ; and return Something around 12 instructions not counting the call/return, if this is to 'slow' then there always is the program table path which can be accomplished by somthing like: GET_TABLE_BYTE ADDWF PCL MY_TABLE dt 0x01, 0x02, 0x03, 0x04,...... IF ((HIGH ($)) != (HIGH (MY_TABLE))) ERROR "TABLE CROSSES PAGE BOUNDARY, RE-ALIGN !" ENDIF Which would generate more or less only 1 instruction for the same task. Which is as fast as you can go I'm afraid. On the 16F876 one can always access the flash mem by similar means as the eeram but it would only be something around 1-2 instructions shorter than the normal eeram read. However it would 'save' program space if it would be sufficient to save only 7 bits/variable. see: http://www.piclist.com/techref/microchip/tables.htm for additional info and pointers. *beware* of program pages ! /Tony -- 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