|
Taking a Look at the PIC18Cxxx Series
by David Brobst
Start ý PIC18Cxxx
Chips ý Memory ý Data
Memory ý Advanced Indirect Addressing
ý Deep and Accessible Stack ý Interrupts
ý Power-On Features ý Clock
Speed ý 10-Bit A/D ý Hardware
Multiplier ý Timers ý CCP/PWM
ý USART ý I2C
Master ý Table Read/Write ý Current
Status ý Sources and PDF
ADVANCED INDIRECT ADDRESSING
Hand in hand with the deep data memory,
the PIC18Cxxx family provides three separate indirect addressing
pointers, each with five modes of operation. The indirect address
pointers are composed of two registers that are concatenated to form
a 12-bit wide word that can handle the complete data space, so no
paging is necessary when using indirect addressing (a blessed relief).
The five modes of operation are: do nothing, post-decrement, post-increment,
pre-increment, and add an offset. The three independent indirect pointers
in conjunction with the operating modes make manipulating and tracking
such things as arrays and large amounts of data manageable. Each of
these operating modes is described in Table 2.
|
Operating mode
|
Description
|
|
Do nothing
|
After accessing the indirect data,
the pointer is left as is. This is the current operating mode
in the low- and mid-range PIC devices.
|
|
Post-decrement
|
After accessing the indirect data,
the pointer is decremented by one. All carries between the two
pointer registers are serviced internally.
|
|
Post-increment
|
After accessing the indirect data,
the pointer is incremented by one. All carries between the two
pointer registers are serviced internally.
|
|
Pre-increment
|
Before accessing the indirect data,
the pointer is incremented. All carries between the two pointer
registers are serviced internally.
|
|
Add an offset
|
The data in the indirect pointer
is modified by the value in the working register (W) before
the data access. The modification is a signed byte (2ýs complement)
added to the indirect pointer, so the pointer can be offset
by 127 to ý128. The value in W and the pointer remains the same
after the operation as before.
|
Table 2ýThe indirect memory modes
of the 18Cxxx family encourage creative memory manipulation
and data storage.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |