2013 Microchip Technology Inc.
Advance Information
DS33030A-page 65
PIC24FV16KM204 FAMILY
4.3.2
DATA ACCESS FROM PROGRAM
MEMORY AND DATA EEPROM
MEMORY USING TABLE
INSTRUCTIONS
The
TBLRDL
and
TBLWTL
instructions offer a direct
method of reading or writing the lower word of any
address within the program memory without going
through data space. It also offers a direct method of
reading or writing a word of any address within data
EEPROM memory. The
TBLRDH
and
TBLWTH
instruc-
tions are the only method to read or write the upper 8 bits
of a program space word as data.
The PC is incremented by 2 for each successive
24-bit program word. This allows program memory
addresses to directly map to data space addresses.
Program memory can thus be regarded as two 16-bit,
word-wide address spaces, residing side by side, each
with the same address range.
TBLRDL
and
TBLWTL
access the space which contains the least significant
data word, and
TBLRDH
and
TBLWTH
access the space
which contains the upper data byte.
Two table instructions are provided to move byte or
word-sized (16-bit) data to and from program space.
Both function as either byte or word operations.
1.
TBLRDL
(Table Read Low): In Word mode, it
maps the lower word of the program space
location (P<15:0>)
to a data address (D<15:0>).
In Byte mode, either the upper or lower byte of
the lower program word is mapped to the lower
byte of a data address. The upper byte is
selected when byte select is ‘
1
’; the lower byte
is selected when it is ‘
0
’.
2.
TBLRDH
(Table Read High): In Word mode, it
maps the entire upper word of a program address
(P<23:16>) to a data address. Note that
D<15:8>, the ‘phantom’ byte, will always be ‘
0
’.
In Byte mode, it maps the upper or lower byte of
the program word to D<7:0> of the data
address, as above. Note that the data will
always be ‘
0
’ when the upper ‘phantom’ byte is
selected (byte select =
1
).
In a similar fashion, two table instructions,
TBLWTH
and
TBLWTL
, are used to write individual bytes or
words to a program space address. The details of
their operation are explained in
.
For all table operations, the area of program memory
space to be accessed is determined by the Table
Memory Page Address register (TBLPAG). TBLPAG
covers the entire program memory space of the
device, including user and configuration spaces. When
TBLPAG<7> =
0
, the table page is located in the user
memory space. When TBLPAG<7> =
1
, the page is
located in configuration space.
FIGURE 4-6:
ACCESSING PROGRAM MEMORY WITH TABLE INSTRUCTIONS
Note:
The
TBLRDH
and
TBLWTH
instructions are not
used while accessing data EEPROM memory.
Note:
Only Table Read operations will execute in the
configuration memory space, and only then, in
implemented areas, such as the Device ID.
Table Write operations are not allowed.
0
8
16
23
00000000
00000000
00000000
00000000
‘Phantom’ Byte
TBLRDH.B
(Wn<0> =
0
)
TBLRDL.W
TBLRDL.B
(Wn<0> =
1
)
TBLRDL.B
(Wn<0> =
0
)
23
15
0
TBLPAG
00
000000h
800000h
002BFEh
Program Space
Data EA<15:0>
The address for the table operation is determined by the data EA
within the page defined by the TBLPAG register. Only read
operations are provided; write operations are also valid in the
user memory area.
Содержание PIC24FV16KM204 FAMILY
Страница 12: ...PIC24FV16KM204 FAMILY DS33030A page 12 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 28: ...PIC24FV16KM204 FAMILY DS33030A page 28 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 34: ...PIC24FV16KM204 FAMILY DS33030A page 34 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 120: ...PIC24FV16KM204 FAMILY DS33030A page 120 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 130: ...PIC24FV16KM204 FAMILY DS33030A page 130 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 136: ...PIC24FV16KM204 FAMILY DS33030A page 136 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 158: ...PIC24FV16KM204 FAMILY DS33030A page 158 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 172: ...PIC24FV16KM204 FAMILY DS33030A page 172 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 194: ...PIC24FV16KM204 FAMILY DS33030A page 194 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 206: ...PIC24FV16KM204 FAMILY DS33030A page 206 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 228: ...PIC24FV16KM204 FAMILY DS33030A page 228 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 232: ...PIC24FV16KM204 FAMILY DS33030A page 232 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 260: ...PIC24FV16KM204 FAMILY DS33030A page 260 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 312: ...PIC24FV16KM204 FAMILY DS33030A page 312 Advance Information 2013 Microchip Technology Inc ...
Страница 313: ... 2013 Microchip Technology Inc Advance Information DS33030A page 313 PIC24FV16KM204 FAMILY ...
Страница 315: ... 2013 Microchip Technology Inc Advance Information DS33030A page 315 PIC24FV16KM204 FAMILY ...
Страница 316: ...PIC24FV16KM204 FAMILY DS33030A page 316 Advance Information 2013 Microchip Technology Inc ...
Страница 317: ... 2013 Microchip Technology Inc Advance Information DS33030A page 317 PIC24FV16KM204 FAMILY ...
Страница 322: ...PIC24FV16KM204 FAMILY DS33030A page 322 Advance Information 2013 Microchip Technology Inc ...
Страница 324: ...PIC24FV16KM204 FAMILY DS33030A page 324 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 330: ...PIC24FV16KM204 FAMILY DS33030A page 330 Advance Information 2013 Microchip Technology Inc NOTES ...
Страница 334: ...PIC24FV16KM204 FAMILY DS33030A page 334 Advance Information 2013 Microchip Technology Inc NOTES ...