English
Language : 

PIC16F193X Datasheet, PDF (55/418 Pages) Microchip Technology – 28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology
2.4.1 ACCESSING THE STACK
The stack is available through the TOSH, TOSL and
STKPTR registers. STKPTR is the current value of the
Stack Pointer. TOSH:TOSL register pair points to the
TOP of the stack. Both registers are read/writable. TOS
is split into TOSH and TOSL due to the 15-bit size of the
PC. To access the stack, adjust the value of STKPTR,
which will position TOSH:TOSL, then read/write to
TOSH:TOSL. STKPTR is 5 bits to allow detection of
overflow and underflow.
During normal program operation, CALL, CALLW and
Interrupts will increment STKPTR while RETURN and
RETFIE will decrement STKPTR. At any time STKPTR
can be inspected to see how much stack is left. The
STKPTR always points at the currently used place on
the stack. Therefore, a CALL or CALLW will write the
PC and then increment the STKPTR, and a return will
decrement the PC and then unload the PC.
2.4.2 OVERFLOW/UNDERFLOW RESET
If the STVREN bit in Configuration Word 2 is
programmed, the device will be reset if the stack is
PUSHed beyond the sixteenth level or POPed beyond
the first level, setting the appropriate bits (STKOVF or
STKUNF, respectively) in the PCON register.
PIC16F193X/LF193X
2.5 Indirect Addressing, INDF and
FSR Registers
The INDFn registers are not physical registers. Any
instruction that accesses an INDFn register actually
accesses the register at the address specified by the
File Select Registers (FSR). If the FSRn address
specifies one of the two INDFn registers, the read will
return ‘0’ and the write will not occur (though Status bits
may be affected). The FSRn register value is created
by the pair FSRnH and FSRnL.
The FSR registers form a 16-bit address that allows an
addressing space with 65536 locations. These locations
are divided into three memory regions:
• Traditional Data Memory
• Linear Data Memory
• Program Flash Memory
© 2008 Microchip Technology Inc.
Preliminary
DS41364A-page 53