> Anyone have a piece of code they might be willing to share Some pretty good hints here http://www.piclist.com/techref/microchip/tables.htm I've got project routines for Flash reads on a 16F877 with 3 really huge tables but I'd need to tidy them up (ie add more comments, maybe labels too) before posting A taster - the tables are cross-referenced. A number input to the PIC from a PC actually refers to a bit in memory, not a whole 14-bit byte, which explains the "0:13". The input number is /14 to find the byte and remainder is the bit in the next byte. That part is fairly simple, the whole thing is more complicated, as a randomiser is also included for generating look-ups. It's a gambling application ;================================================ ; Read flash memory ;================================================ ;increment target address if division result > 0:13 readf bank0 movf addl,w ;pre-load address low btfss res_eq0 ;check non-zero flag. If set then result > 0 goto $+5 ;else use pre-loaded address low value incfsz addl,w ;base + offset + 1 goto $+3 incf add1h,f ;increment high address if low rollover incf add2h,f movwf addlow ;low address for this routine ;------- entry point for random routine getrnd movf addhigh,w ;table 1 or 2 address high bank2 movwf eeadrh bank0 movf addlow,w ;address low bank2 movwf eeadr bank3 bsf eecon1,eepgd bsf eecon1,rd nop nop nop nop bank2 movf eedata,w bank0 movwf lo bank2 movf eedath,w bank0 movwf hi return -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist