PIC16CR58A Microchip Technology, PIC16CR58A Datasheet - Page 24

no-image

PIC16CR58A

Manufacturer Part Number
PIC16CR58A
Description
ROM-Based 8-Bit CMOS Microcontroller Series
Manufacturer
Microchip Technology
Datasheets

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16CR58A-04/P042
Manufacturer:
MOTOROLA
Quantity:
80
PIC16C5X
4.7
The INDF register is not a physical register.
Addressing INDF actually addresses the register
whose address is contained in the FSR register (FSR
is a pointer ). This is indirect addressing.
EXAMPLE 4-1:
• Register file 05 contains the value 10h
• Register file 06 contains the value 0Ah
• Load the value 05 into the FSR register
• A read of the INDF register will return the value
• Increment the value of the FSR register by one
• A read of the INDR register now will return the
Reading INDF itself indirectly (FSR = 0) will produce
00h. Writing to the INDF register indirectly results in a
no-operation (although STATUS bits may be affected).
A simple program to clear RAM locations 10h-1Fh
using indirect addressing is shown in Example 4-2.
FIGURE 4-13: DIRECT/INDIRECT ADDRESSING
DS30453B-page 24
bank select
of 10h
(FSR = 06h)
value of 0Ah.
(FSR)
6
5
Indirect Data Addressing; INDF and
FSR Registers
Direct Addressing
location select
Note 1: For register map detail see Section 4.2.
Data
Memory
INDIRECT ADDRESSING
4
(opcode)
(1)
00h
0Fh
10h
0
1Fh
Bank 0
00
3Fh
Bank 1
01
Preliminary
Addresses map back
to addresses in Bank 0.
5Fh
Bank 2
10
EXAMPLE 4-2:
NEXT
CONTINUE
The FSR is either a 5-bit (PIC16C52, PIC16C54s,
PIC16CR54s, PIC16C55s), 6-bit (PIC16C56s,
PIC16CR56s), or 7-bit (PIC16C57s, PIC16CR57s,
PIC16C58s, PIC16CR58s) wide register. It is used in
conjunction with the INDF register to indirectly address
the data memory area.
The FSR<4:0> bits are used to select data memory
addresses 00h to 1Fh.
PIC16C52, PIC16C54s, PIC16CR54s, PIC16C55s:
T h e s e d o n o t u s e b a n k i n g . F S R < 6 : 5 > a r e
unimplemented and read as '1's.
P I C 1 6 C 5 7 s ,
PIC16CR58s: FSR<6:5> are the bank select bits and
are used to select the bank to be addressed (00 =
bank 0, 01 = bank 1, 10 = bank 2, 11 = bank 3).
7Fh
Bank 3
11
movlw
movwf
clrf
incf
btfsc
goto
:
P I C 1 6 C R 5 7 s ,
HOW TO CLEAR RAM
USING INDIRECT
ADDRESSING
0x10
FSR
INDF
FSR,F
FSR,4
NEXT
6
1998 Microchip Technology Inc.
Indirect Addressing
bank
5
;initialize pointer
; to RAM
;clear INDF register
;inc pointer
;all done?
;NO, clear next
;YES, continue
4
location select
(FSR)
P I C 1 6 C 5 8 s ,
0

Related parts for PIC16CR58A