PIC18F258 MICROCHIP [Microchip Technology], PIC18F258 Datasheet - Page 56

no-image

PIC18F258

Manufacturer Part Number
PIC18F258
Description
High Performance, 28/40-Pin Enhanced FLASH Microcontrollers with CAN
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F258-E/SO
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC18F258-I/P
Manufacturer:
ST
Quantity:
320
Part Number:
PIC18F258-I/SO
Manufacturer:
MICROCHIP
Quantity:
2 000
Part Number:
PIC18F258-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2580
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC18F2580-E/ML
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F2580-E/SO
Manufacturer:
Microchi
Quantity:
2 952
Part Number:
PIC18F2580-E/SP
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F2580-I/SO
Manufacturer:
MICRO
Quantity:
10
Part Number:
PIC18F2580-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2580-I/SO
0
Part Number:
PIC18F2585-I/SO
Quantity:
2
PIC18FXX8
4.10
The Access Bank is an architectural enhancement that
is very useful for C compiler code optimization. The
techniques used by the C compiler are also useful for
programs written in assembly.
This data memory region can be used for:
• Intermediate computational values
• Local variables of subroutines
• Faster context saving/switching of variables
• Common variables
• Faster evaluation/control of SFRs (no banking)
The Access Bank is comprised of the upper 160 bytes
in Bank 15 (SFRs) and the lower 96 bytes in Bank 0.
These two sections will be referred to as Access Bank
High and Access Bank Low, respectively. Figure 4-6
indicates the Access Bank areas.
A bit in the instruction word specifies if the operation is
to occur in the bank specified by the BSR register, or in
the Access Bank.
When forced in the Access Bank (a = ’0’), the last
address in Access Bank Low is followed by the first
address in Access Bank High. Access Bank High maps
most of the Special Function Registers so that these
registers can be accessed without any software
overhead.
FIGURE 4-7:
DS41159B-page 54
Note 1: For register file map detail, see Table 4-1.
Access Bank
Bank Select
2: The access bit of the instruction can be used to force an override of the selected bank (BSR<3:0>) to the
3: The MOVFF instruction embeds the entire 12-bit address in the instruction.
registers of the Access Bank.
BSR<3:0>
(2)
DIRECT ADDRESSING
Location Select
7
Direct Addressing
Data
Memory
From Opcode
(1)
(3)
Preliminary
(3)
000h
0FFh
Bank 0
00h
4.11
The need for a large general purpose memory space
dictates a RAM banking scheme. The data memory is
partitioned into sixteen banks. When using direct
addressing, the BSR should be configured for the
desired bank.
BSR<3:0> holds the upper 4 bits of the 12-bit RAM
address. The BSR<7:4> bits will always read ’0’s, and
writes will have no effect.
A MOVLB instruction has been provided in the
instruction set to assist in selecting banks.
If the currently selected bank is not implemented, any
read will return all '0's and all writes are ignored. The
STATUS register bits will be set/cleared as appropriate
for the instruction performed.
Each Bank extends up to FFh (256 bytes). All data
memory is implemented as static RAM.
A MOVFF instruction ignores the BSR, since the 12-bit
addresses are embedded into the instruction word.
Section 4.12 provides a description of indirect address-
ing, which allows linear addressing of the entire RAM
space.
0
100h
1FFh
Bank 1
01h
Bank Select Register (BSR)
 2002 Microchip Technology Inc.
E00h
EFFh
Bank 14
0Eh
F00h
FFFh
Bank 15
0Fh

Related parts for PIC18F258