In: Electrical Engineering
The following problems are related to PIC18F46K22 data memory:
(a) What is the data memory space and actual implemented size?
(b) What does direct addressing mean?
(c) What does indirect addressing mean?
(d) What is the Access Bank used for?
(e) What is the address range for Bank 6?
(f) What is the purpose of the registers FSR0, FSR1, FSR2 for?
Answer:- a) PIC18 devices have 4096 bytes of data memory. The memory space is divided into 16 banks that contains 256 bytes each.
Answer:- b) The direct addressing specifies
either all or part of the source and/or destination address of the
instruction in the opcode itself. The address value is used
directly with the instruction. Ex-
MOVWF 0x70; here 0x70 is the address of the destination.
Answer:- c) Indirect addressing has the address of
the source or destination in a register. In PIC18, File Selection
Registers (FSRs) and Indirect File Operands (INDFs) are used as
pointers to the locations which are to be read or written.
Answer:- d) The access bank is used by PIC18
instructions that include the Access RAM bit (the ‘a’ parameter
in
the instruction).
If ‘a’ is equal to ‘1’, then the instruction
uses the BSR and the 8-bit address included in the
opcode for the data memory address.
If ‘a’ is ‘0’, the instruction is forced to use the access
bank address map.
Answer:- e) The address range of bank 6 is from 0x600 to 0x6FF.
Answer:- f) FSR0, FSR1 and FSR2 each represent a pair of 8-bit register. It can have a 12-bit data memory address. These are used as pointers to data memory locations.