Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.COM

X  

PIC18F452 Datasheet(PDF) 52 Page - Microchip Technology

Part # PIC18F452
Description  High Performance, Enhanced FLASH Microcontrollers with 10-Bit A/D
Download  332 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC18F452 Datasheet(HTML) 52 Page - Microchip Technology

Back Button PIC18F452 Datasheet HTML 48Page - Microchip Technology PIC18F452 Datasheet HTML 49Page - Microchip Technology PIC18F452 Datasheet HTML 50Page - Microchip Technology PIC18F452 Datasheet HTML 51Page - Microchip Technology PIC18F452 Datasheet HTML 52Page - Microchip Technology PIC18F452 Datasheet HTML 53Page - Microchip Technology PIC18F452 Datasheet HTML 54Page - Microchip Technology PIC18F452 Datasheet HTML 55Page - Microchip Technology PIC18F452 Datasheet HTML 56Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 52 / 332 page
background image
PIC18FXX2
DS39564B-page 50
 2002 Microchip Technology Inc.
4.12
Indirect Addressing, INDF and
FSR Registers
Indirect addressing is a mode of addressing data mem-
ory, where the data memory address in the instruction
is not fixed. An FSR register is used as a pointer to the
data memory location that is to be read or written. Since
this pointer is in RAM, the contents can be modified by
the program. This can be useful for data tables in the
data memory and for software stacks. Figure 4-9
shows the operation of indirect addressing. This shows
the moving of the value to the data memory address
specified by the value of the FSR register.
Indirect addressing is possible by using one of the
INDF registers. Any instruction using the INDF register
actually accesses the register pointed to by the File
Select Register, FSR. Reading the INDF register itself,
indirectly (FSR = 0), will read 00h. Writing to the INDF
register indirectly, results in a no operation. The FSR
register contains a 12-bit address, which is shown in
Figure 4-10.
The INDFn register is not a physical register. Address-
ing INDFn actually addresses the register whose
address is contained in the FSRn register (FSRn is a
pointer). This is indirect addressing.
Example 4-4 shows a simple use of indirect addressing
to clear the RAM in Bank1 (locations 100h-1FFh) in a
minimum number of instructions.
EXAMPLE 4-4:
HOW TO CLEAR RAM
(BANK1) USING INDIRECT
ADDRESSING
There are three indirect addressing registers. To
address the entire data memory space (4096 bytes),
these registers are 12-bit wide. To store the 12-bits of
addressing
information,
two
8-bit
registers
are
required. These indirect addressing registers are:
1.
FSR0: composed of FSR0H:FSR0L
2.
FSR1: composed of FSR1H:FSR1L
3.
FSR2: composed of FSR2H:FSR2L
In addition, there are registers INDF0, INDF1 and
INDF2, which are not physically implemented. Reading
or writing to these registers activates indirect address-
ing, with the value in the corresponding FSR register
being the address of the data. If an instruction writes a
value to INDF0, the value will be written to the address
pointed to by FSR0H:FSR0L. A read from INDF1 reads
the
data
from
the
address
pointed
to
by
FSR1H:FSR1L. INDFn can be used in code anywhere
an operand can be used.
If INDF0, INDF1 or INDF2 are read indirectly via an
FSR, all ’0’s are read (zero bit is set). Similarly, if
INDF0, INDF1 or INDF2 are written to indirectly, the
operation will be equivalent to a NOP instruction and the
STATUS bits are not affected.
4.12.1
INDIRECT ADDRESSING
OPERATION
Each FSR register has an INDF register associated
with it, plus four additional register addresses. Perform-
ing an operation on one of these five registers deter-
mines how the FSR will be modified during indirect
addressing.
When data access is done to one of the five INDFn
locations, the address selected will configure the FSRn
register to:
• Do nothing to FSRn after an indirect access (no
change) - INDFn
• Auto-decrement FSRn after an indirect access
(post-decrement) - POSTDECn
• Auto-increment FSRn after an indirect access
(post-increment) - POSTINCn
• Auto-increment FSRn before an indirect access
(pre-increment) - PREINCn
• Use the value in the WREG register as an offset
to FSRn. Do not modify the value of the WREG or
the FSRn register after an indirect access (no
change) - PLUSWn
When using the auto-increment or auto-decrement fea-
tures, the effect on the FSR is not reflected in the
STATUS register. For example, if the indirect address
causes the FSR to equal '0', the Z bit will not be set.
Incrementing or decrementing an FSR affects all 12
bits. That is, when FSRnL overflows from an increment,
FSRnH will be incremented automatically.
Adding these features allows the FSRn to be used as a
stack pointer, in addition to its uses for table operations
in data memory.
Each FSR has an address associated with it that per-
forms an indexed indirect access. When a data access
to this INDFn location (PLUSWn) occurs, the FSRn is
configured to add the signed value in the WREG regis-
ter and the value in FSR to form the address before an
indirect access. The FSR value is not changed.
If an FSR register contains a value that points to one of
the INDFn, an indirect read will read 00h (zero bit is
set), while an indirect write will be equivalent to a NOP
(STATUS bits are not affected).
If an indirect addressing operation is done where the
target address is an FSRnH or FSRnL register, the
write operation will dominate over the pre- or
post-increment/decrement functions.
LFSR
FSR0 ,0x100
;
NEXT
CLRF
POSTINC0
; Clear INDF
; register and
; inc pointer
BTFSS FSR0H, 1
; All done with
; Bank1?
GOTO
NEXT
; NO, clear next
CONTINUE
; YES, continue


Similar Part No. - PIC18F452

ManufacturerPart #DatasheetDescription
logo
Microchip Technology
PIC18F452 MICROCHIP-PIC18F452 Datasheet
5Mb / 332P
   28/40-pin High Performance, Enhanced FLASH Microcontrollers with 10-Bit A/D
2006
PIC18F452 MICROCHIP-PIC18F452 Datasheet
5Mb / 332P
   High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D
08/29/06
PIC18F452-IPT MICROCHIP-PIC18F452-IPT Datasheet
5Mb / 332P
   High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D
08/29/06
PIC18F4520 MICROCHIP-PIC18F4520 Datasheet
6Mb / 390P
   28/40/44-Pin Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt Technology
2004
PIC18F4520 MICROCHIP-PIC18F4520 Datasheet
283Kb / 16P
   28/40/44-Pin Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt Technology
2005
More results

Similar Description - PIC18F452

ManufacturerPart #DatasheetDescription
logo
Microchip Technology
PIC18F452-IPT MICROCHIP-PIC18F452-IPT Datasheet
5Mb / 332P
   High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D
08/29/06
PIC18F242-I-SO MICROCHIP-PIC18F242-I-SO Datasheet
5Mb / 332P
   High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D
08/29/06
PIC18F442-I MICROCHIP-PIC18F442-I Datasheet
5Mb / 332P
   High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D
08/29/06
PIC18LF252-ISP MICROCHIP-PIC18LF252-ISP Datasheet
5Mb / 332P
   High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D
08/29/06
PIC18LF252-I MICROCHIP-PIC18LF252-I Datasheet
5Mb / 332P
   High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D
08/29/06
PIC18FXX2 MICROCHIP-PIC18FXX2_06 Datasheet
5Mb / 332P
   28/40-pin High Performance, Enhanced FLASH Microcontrollers with 10-Bit A/D
2006
PIC18CXX2 MICROCHIP-PIC18CXX2_13 Datasheet
4Mb / 304P
   High Performance Microcontrollers with 10-bit A/D
11/29/12 1999-2013
PIC18CXX2 MICROCHIP-PIC18CXX2 Datasheet
5Mb / 296P
   High-Performance Microcontrollers with 10-Bit A/D
1999
PIC18CXX2 MICROCHIP-PIC18CXX2_01 Datasheet
4Mb / 305P
   High Performance Microcontrollers with 10-bit A/D
2001
PIC18C242-I-SP MICROCHIP-PIC18C242-I-SP Datasheet
4Mb / 304P
   High Performance Microcontrollers with 10-bit A/D
11/29/12
More results


Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL




Privacy Policy
ALLDATASHEET.COM
Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Datasheet Upload   |   Contact us   |   Privacy Policy   |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com