欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC17LC42-16I/JW 参数 Datasheet PDF下载

PIC17LC42-16I/JW图片预览
型号: PIC17LC42-16I/JW
PDF下载: 下载PDF文件 查看货源
内容描述: 高性能8位CMOS EPROM / ROM微控制器 [High-Performance 8-Bit CMOS EPROM/ROM Microcontroller]
分类和应用: 微控制器可编程只读存储器电动程控只读存储器
文件页数/大小: 240 页 / 1141 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第35页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第36页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第37页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第38页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第40页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第41页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第42页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第43页  
PIC17C4X  
6.3  
Stack Operation  
6.4  
Indirect Addressing  
The PIC17C4X devices have a 16 x 16-bit wide hard-  
ware stack (Figure 6-1). The stack is not part of either  
the program or data memory space, and the stack  
pointer is neither readable nor writable. The PC is  
“PUSHed” onto the stack when a CALL instruction is  
executed or an interrupt is acknowledged. The stack is  
“POPed” in the event of a RETURN, RETLW, or a RETFIE  
instruction execution. PCLATH is not affected by a  
“PUSH” or a “POP” operation.  
Indirect addressing is a mode of addressing data  
memory where the data memory address in the  
instruction is not fixed. That is, the register that is to be  
read or written can be modified by the program. This  
can be useful for data tables in the data memory.  
Figure 6-10 shows the operation of indirect address-  
ing. This shows the moving of the value to the data  
memory address specified by the value of the FSR  
register.  
The stack operates as a circular buffer, with the stack  
pointer initialized to '0' after all resets. There is a stack  
available bit (STKAV) to allow software to ensure that  
the stack has not overflowed.The STKAV bit is set after  
a device reset. When the stack pointer equals Fh,  
STKAV is cleared. When the stack pointer rolls over  
from Fh to 0h, the STKAV bit will be held clear until a  
device reset.  
Example 6-1 shows the use of indirect addressing to  
clear RAM in a minimum number of instructions. A  
similar concept could be used to move a defined num-  
ber of bytes (block) of data to the USART transmit reg-  
ister (TXREG). The starting address of the block of  
data to be transmitted could easily be modified by the  
program.  
FIGURE 6-10: INDIRECT ADDRESSING  
Note 1: There is not a status bit for stack under-  
flow. The STKAV bit can be used to detect  
the underflow which results in the stack  
pointer being at the top of stack.  
RAM  
Instruction  
Executed  
Note 2: There are no instruction mnemonics  
called PUSH or POP. These are actions  
that occur from the execution of the CALL,  
RETURN, RETLW, and RETFIE instruc-  
tions, or the vectoring to an interrupt vec-  
tor.  
Opcode  
Address  
File = INDFx  
Instruction  
Fetched  
Note 3: After a reset, if a “POP” operation occurs  
before a “PUSH” operation, the STKAV bit  
will be cleared. This will appear as if the  
stack is full (underflow has occurred). If a  
“PUSH” operation occurs next (before  
another “POP”), the STKAV bit will be  
locked clear. Only a device reset will  
cause this bit to set.  
FSR  
Opcode  
File  
After the device is “PUSHed” sixteen times (without a  
“POP”), the seventeenth push overwrites the value  
from the first push. The eighteenth push overwrites the  
second push (and so on).  
1996 Microchip Technology Inc.  
DS30412C-page 39  
 复制成功!