- on Microcontrollers
- Published in issue 11/2004 on page 0
Goodbye '16, Welcome PIC18F, Part 2
ROM (program memory) and long lookup tables
The 18Fxx2 series of processors have either 16 k or 32 k of Flash ROM. However, each program instruction takes at least one word (i.e., two bytes) so in terms of the number of lines of program code you could write, you are looking at a maximum of 8 k or 16 k. Consequently, in terms of programming, you can only ever address even numbered ROM locations.If you look at the program memory window for a 16F series program, the program address increments by one for each line, i.e., 0000, 0001, 0002 etc. The same code in an 18F would produce a program where each line incremented by two; 0000, 0002, 0004 etc.This doesn’t matter in the normal course of events, but when we come to lookup tables, it does.The whole of the ROM memory is completely linear and there are no problems with CALL or GOTO instructions, no matter what the length of the program.