PIC16HV540 Microchip Technology, PIC16HV540 Datasheet - Page 17

no-image

PIC16HV540

Manufacturer Part Number
PIC16HV540
Description
Enhanced PIC16C54 EPROM-Based 8-Bit CMOS Microcontroller
Manufacturer
Microchip Technology
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16HV540-04/P
Manufacturer:
Microchip
Quantity:
1 736
Part Number:
PIC16HV540-04/SO
Manufacturer:
Microchip
Quantity:
485
Part Number:
PIC16HV540-04I/P
Manufacturer:
MICROCHIP
Quantity:
664
Part Number:
PIC16HV540-04I/SO
Manufacturer:
Maxim
Quantity:
41
Part Number:
PIC16HV540-20/P
Quantity:
5
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
indirect addressing.
EXAMPLE 4-3:
• 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-4.
FIGURE 4-4:
of 10h
(FSR = 06)
value of 0Ah.
2000 Microchip Technology Inc.
Indirect Data Addressing; INDF and
FSR Registers
(Note 1)
DIRECT/INDIRECT ADDRESSING
(FSR)
6
INDIRECT ADDRESSING
5
Direct Addressing
location select
Note 1:
Data
Memory
4
2:
(opcode)
(2)
Bits 5 and 6 are unimplemented and read as 1’s.
For register map detail, see Section 4.2.
00h
0Fh
10h
0
1Fh
Preliminary
Bank 0
EXAMPLE 4-4:
NEXT
CONTINUE
The FSR is a 5-bit (PIC16HV540) 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.
PIC16HV540: Do not use banking. FSR<6:5> are
unimplemented and read as '1's.
(Note 1)
6
Indirect Addressing
5
movlw
movwf
clrf
incf
btfsc
goto
:
4
HOW TO CLEAR RAM
USING INDIRECT
ADDRESSING
location select
(FSR)
PIC16HV540
0x10
FSR
INDF
FSR,F
FSR,4
NEXT
;YES, continue
0
;initialize pointer
; to RAM
;clear INDF register
;inc pointer
;all done?
;NO, clear next
DS40197B-page 17

Related parts for PIC16HV540