SECTION VI-11: ROM Width in the PIC18

A microprocessor's memory that holds code is byte-addressable and under the control of the program counter. Each location of the address space holds only one byte. If we have 16 address lines, it will give us 216 locations, which is 64K of memory space with an address map of 0000 - FFFFH. CPU's with 8-bit data will fetch one byte at a time. To bring in more information, code or data, into the CPU, increasing the width of the data bus to 16 bits. To increase performance even further, Intel corporation increased data bus width to 32 bits for the 386 and 64 bits for the Pentium. The data bus is like traffic lanes on the high way where each lane is 8 bits wide. The more lanes, the more information we can bring into the CPU for processing. 

For the PIC18, the internal data bus between the code ROM space and the CPU is 16 bits as shown below.

Program ROM Width for in PIC18 microcontroller

The 64K ROM space is shown as 32K X 16 using a 16-bit word data size. The same rule applies to the entire program address space of PIC18, which is 2M, organized as 1M X 16. The widening of the data path between the program ROM and the CPU is another way in which the PIC designers increased the processing power of the PIC18 family. Another reason to male the code ROM 16 bits wide is to match it with the instructions width of the PIC18 because the vast majority of the instructions are 2-byte instructions. This way, the CPU brings in an instruction from ROM every time it makes a trip to the program ROM. That will make instruction fetch a single cycle.

The PIC designers have made all instructions either 2 byte or 4 byte; there are no 1 byte or 3 byte instructions, as in the case with the x86 and 8051 chips. This is the part of the RISC architectural philosophy. Not all the program ROMs in the PIC microcontrollers have 16 bit width. The PIC16 ROM is 14 bit, while the PIC12 has a 12 bit width. The data memory SRAM for the file register in the PIC microcontroller is 8 bit and like program ROM, it is a byte addressable.

More From