PIC16LF1847T-I/SO Microchip Technology, PIC16LF1847T-I/SO Datasheet - Page 20

no-image

PIC16LF1847T-I/SO

Manufacturer Part Number
PIC16LF1847T-I/SO
Description
14 KB Flash, 1K Bytes RAM, 32 MHz Int. Osc, 16 I/0, Enhanced Mid Range Core, Nan
Manufacturer
Microchip Technology
Series
PIC® XLP™ mTouch™ 16Fr
Datasheet

Specifications of PIC16LF1847T-I/SO

Core Processor
PIC
Core Size
8-Bit
Speed
32MHz
Connectivity
I²C, LIN, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
15
Program Memory Size
14KB (8K x 14)
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
1K x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 3.6 V
Data Converters
A/D 12x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
18-SOIC (0.295", 7.50mm Width)
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
PIC16(L)F1847
FIGURE 3-1:
3.1.1
There are two methods of accessing constants in pro-
gram memory. The first method is to use tables of
RETLW instructions. The second method is to set an
FSR to point to the program memory.
DS41453B-page 20
Note 1:
CALL, RETURN
RETFIE, RETLW
Reserved. Shadows to 0000h-1FFFh.
READING PROGRAM MEMORY AS
DATA
Rollover Page 0
Rollover Page 3
Stack (16 Levels)
Reset Vector
Interrupt Vector
PC<14:0>
Page 2
Page 3
Page 0
Page 1
PROGRAM MEMORY MAP
AND STACK FOR
PIC16F/LF1847
15
(1)
(1)
2000h
7FFFh
0000h
0004h
0005h-
07FFh
0800h-
0FFFh
1000h
1FFFh
17FFh
1800h
Preliminary
3.1.1.1
The RETLW instruction can be used to provide access
to tables of constants. The recommended way to create
such a table is shown in
EXAMPLE 3-1:
The BRW instruction makes this type of table very sim-
ple to implement. If your code must remain portable
with previous generations of microcontrollers, then the
BRW instruction is not available so the older table read
method must be used.
3.1.1.2
The program memory can be accessed as data by set-
ting bit 7 of the FSRxH register and reading the match-
ing INDFx register. The MOVIW instruction will place the
lower 8 bits of the addressed word in the W register.
Writes to the program memory cannot be performed via
the INDF registers. Instructions that access the pro-
gram memory via the FSR require one extra instruction
cycle to complete.
ing the program memory via an FSR.
The HIGH directive will set bit<7> if a label points to a
location in program memory.
EXAMPLE 3-2:
constants
my_function
constants
my_function
;THE PROGRAM MEMORY IS IN W
BRW
RETLW DATA0
RETLW DATA1
RETLW DATA2
RETLW DATA3
;… LOTS OF CODE…
MOVLW
CALL constants
;… THE CONSTANT IS IN W
RETLW DATA0
RETLW DATA1
RETLW DATA2
RETLW DATA3
;… LOTS OF CODE…
MOVLW
MOVWF
MOVLW
MOVWF
MOVIW 0[FSR1]
RETLW Instruction
Indirect Read with FSR
LOW constants
FSR1L
HIGH constants
FSR1H
Example 3-2
DATA_INDEX
RETLW INSTRUCTION
ACCESSING PROGRAM
MEMORY VIA FSR
 2011 Microchip Technology Inc.
Example
;Add Index in W to
;program counter to
;select data
;Index0 data
;Index1 data
;Index0 data
;Index1 data
demonstrates access-
3-1.

Related parts for PIC16LF1847T-I/SO