PIC12F1840 MICROCHIP [Microchip Technology], PIC12F1840 Datasheet - Page 16

no-image

PIC12F1840

Manufacturer Part Number
PIC12F1840
Description
8-Pin Flash Microcontrollers with nanoWatt XLP Technology
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC12F1840-E/MF
Manufacturer:
MICROCHIP
Quantity:
3 000
Part Number:
PIC12F1840-E/SN
Manufacturer:
TI
Quantity:
1 200
Part Number:
PIC12F1840-E/SN
0
Part Number:
PIC12F1840-I/MF
Manufacturer:
CONEXANT
Quantity:
101
Part Number:
PIC12F1840-I/P
Manufacturer:
MICROCHIP
Quantity:
200
Part Number:
PIC12F1840-I/SN
Manufacturer:
MICROCHIP
Quantity:
4 500
Part Number:
PIC12F1840-I/SN
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1840-I/SN
0
Company:
Part Number:
PIC12F1840-I/SN
Quantity:
10 300
Company:
Part Number:
PIC12F1840-I/SN
Quantity:
10 900
Part Number:
PIC12F1840T-E/SN
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1840T-E/SN
0
Company:
Part Number:
PIC12F1840T-I/SNVAO
Quantity:
32
PIC12F/LF1840
FIGURE 3-1:
DS41441A-page 16
Program
On-chip
Memory
Interrupt, RETFIE
RETURN, RETLW
CALL, CALLW
Rollover to Page 0
Rollover to Page 1
Interrupt Vector
Stack Level 15
Stack Level 0
Stack Level 1
Reset Vector
PROGRAM MEMORY MAP
AND STACK FOR
PIC12F/LF1840
PC<14:0>
Page 1
Page 0
15
0000h
0004h
0005h
7FFFh
07FFh
0800h
0FFFh
1000h
Preliminary
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.
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.
constants
my_function
BRW
RETLW DATA0
RETLW DATA1
RETLW DATA2
RETLW DATA3
;… LOTS OF CODE…
MOVLW
call constants
;… THE CONSTANT IS IN W
READING PROGRAM MEMORY AS
DATA
RETLW Instruction
DATA_INDEX
RETLW INSTRUCTION
 2011 Microchip Technology Inc.
Example
;Add Index in W to
;program counter to
;select data
;Index0 data
;Index1 data
3-1.

Related parts for PIC12F1840