PIC16F785-I/P Microchip Technology Inc., PIC16F785-I/P Datasheet - Page 24

no-image

PIC16F785-I/P

Manufacturer Part Number
PIC16F785-I/P
Description
MCU, 8-Bit, 2KW Flash, 128 RAM, 18 I/O, DIP-20
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC16F785-I/P

A/d Inputs
12-Channel, 10-Bit
Comparators
2
Cpu Speed
5 MIPS
Eeprom Memory
256 Bytes
Input Output
17
Memory Type
Flash
Number Of Bits
8
Package Type
20-pin PDIP
Programmable Memory
3.5K Bytes
Ram Size
128 Bytes
Speed
20 MHz
Timers
2-8-bit, 1-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device
PIC16F785/HV785
2.4
The INDF register is not a physical register. Addressing
the INDF register will cause indirect addressing.
Indirect addressing is possible by using the INDF
register. Any instruction using the INDF register
actually accesses data pointed to by the File Select
Register (FSR). Reading INDF itself indirectly will
produce 00h. Writing to the INDF register indirectly
results in a no operation (although Status bits may be
affected). An effective 9-bit address is obtained by
concatenating the 8-bit FSR and the IRP bit
(STATUS<7>), as shown in Figure 2-4.
FIGURE 2-4:
DS41249D-page 22
Bank Select
RP1RP0
Note:
Indirect Addressing, INDF and
FSR Registers
Direct Addressing
6
For memory map detail see Figure 2-2.
Data
Memory
DIRECT/INDIRECT ADDRESSING PIC16F785/HV785
Location Select
From Opcode
7FH
00H
Bank 0
00
0
Bank 1
01
Preliminary
Bank 2
10
A simple program to clear RAM location 20h-2Fh using
indirect addressing is shown in Example 2-1.
EXAMPLE 2-1:
NEXT CLRF
CONTINUE
Bank 3
MOVLW 0x20
MOVWF FSR
INCF
BTFSS FSR,4
GOTO
11
IRP
Bank Select
180h
1FFh
INDF
FSR
NEXT
7
INDIRECT ADDRESSING
;initialize pointer
;to RAM
;clear INDF register
;increment pointer
;all done?
;no clear next
;yes continue
© 2006 Microchip Technology Inc.
Indirect Addressing
File Select Register
Location Select
0

Related parts for PIC16F785-I/P