RFPIC12C509AG Microchip Technology Inc., RFPIC12C509AG Datasheet - Page 24

no-image

RFPIC12C509AG

Manufacturer Part Number
RFPIC12C509AG
Description
18/20-pin 8-bit Cmos Microcontroller With Uhf Ask/fsk Transmitter
Manufacturer
Microchip Technology Inc.
Datasheet
indirect addressing.
rfPIC12C509AG/509AF
4.8
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
EXAMPLE 4-1:
• Register file 07 contains the value 10h
• Register file 08 contains the value 0Ah
• Load the value 07 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-7:
DS70031A-page 22
of 10h
(FSR = 08)
value of 0Ah.
Indirect Data Addressing; INDF
and FSR Registers
bank select
(FSR)
6
DIRECT/INDIRECT ADDRESSING
Note 1: For register map detail see Section 4.2.
INDIRECT ADDRESSING
5
Direct Addressing
location select
Data
Memory
4
(opcode)
(1)
00h
0Fh
10h
0
Preliminary
1Fh
Bank 0
00
3Fh
Bank 1
EXAMPLE 4-2:
NEXT
CONTINUE
The FSR is a 5-bit wide register. It is used in conjunc-
tion 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.
rfPIC12C509AG/509AF:
between bank 0 and bank 1. FSR<7:6> is unimple-
mented, read as '1’.
Addresses
map back to
addresses
in Bank 0.
01
movlw
movwf
clrf
incf
btfsc
goto
:
USING INDIRECT
ADDRESSING
HOW TO CLEAR RAM
0x10
FSR
INDF
FSR,F
FSR,4
NEXT
6
©
Indirect Addressing
2001 Microchip Technology Inc.
bank
5
Uses
4
;initialize pointer
; to RAM
;clear INDF register
;inc pointer
;all done?
;NO, clear next
;YES, continue
FSR<5>.
location select
(FSR)
0
Selects

Related parts for RFPIC12C509AG