PIC16F506 Microchip Technology, PIC16F506 Datasheet - Page 26

no-image

PIC16F506

Manufacturer Part Number
PIC16F506
Description
(PIC12F510 / PIC16F506) 8-Bit Flash Microcontroller
Manufacturer
Microchip Technology
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F506-I/P
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16F506-I/SL
Manufacturer:
MICROCHIP
Quantity:
16 700
Part Number:
PIC16F506-I/SL
Manufacturer:
Microchip Technology
Quantity:
33 360
Part Number:
PIC16F506-I/SL
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16F506-I/SL
0
Part Number:
PIC16F506-I/ST
Manufacturer:
MICROCHIP
Quantity:
2 000
Part Number:
PIC16F506-I/ST
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16F506-I/ST
0
Company:
Part Number:
PIC16F506-I/ST
Quantity:
8 000
Part Number:
PIC16F506T-I/SL
Manufacturer:
ROHM
Quantity:
400 000
Part Number:
PIC16F506T-I/SL
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16F506T-I/ST
Manufacturer:
ZARLINK
Quantity:
320
PIC12F510/16F506
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.
4.8.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-1.
FIGURE 4-5:
DS41268B-page 24
bank select
of 10h
(FSR = 08)
value of 0Ah.
Note 1: For register map detail, see Figure 4-2.
(FSR)
6
5
Indirect Data Addressing: INDF
and FSR Registers
Direct Addressing
INDIRECT ADDRESSING EXAMPLE
location select
Data
Memory
4
DIRECT/INDIRECT ADDRESSING (PIC12F510)
3
(opcode)
(1)
2
1Fh
00h
0Fh
10h
1
0
Bank 0
00
3Fh
Bank 1
01
Preliminary
Addresses map back to
addresses in Bank 0.
EXAMPLE 4-1:
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.
PIC16F506 – Uses FSR<6:5>. Selects from Bank 0 to
Bank 3. FSR<7> is unimplemented, read as ‘1’.
PIC12F510 – Uses FSR<5>. Selects from Bank 0 to
Bank 1. FSR<7:6> are unimplemented, read as ‘11’.
NEXT
CONTINUE
MOVLW
MOVWF
CLRF
INCF
BTFSC
GOTO
:
:
0x10
FSR
INDF
FSR,F
FSR,4
NEXT
HOW TO CLEAR RAM
USING INDIRECT
ADDRESSING
© 2006 Microchip Technology Inc.
6
Indirect Addressing
bank
select
5
;initialize pointer
;to RAM
;clear INDF register
;inc pointer
;all done?
;NO, clear next
;YES, continue
4
(FSR)
3
location select
2
1
0

Related parts for PIC16F506