参数资料
型号: PIC18LF4331T-I/ML
厂商: Microchip Technology
文件页数: 81/119页
文件大小: 0K
描述: IC MCU FLASH 4KX16 44QFN
标准包装: 1,600
系列: PIC® 18F
核心处理器: PIC
芯体尺寸: 8-位
速度: 40MHz
连通性: I²C,SPI,UART/USART
外围设备: 欠压检测/复位,LVD,电源控制 PWM,QEI,POR,PWM,WDT
输入/输出数: 36
程序存储器容量: 8KB(4K x 16)
程序存储器类型: 闪存
EEPROM 大小: 256 x 8
RAM 容量: 768 x 8
电压 - 电源 (Vcc/Vdd): 2 V ~ 5.5 V
数据转换器: A/D 9x10b
振荡器型: 内部
工作温度: -40°C ~ 85°C
封装/外壳: 44-VQFN 裸露焊盘
包装: 带卷 (TR)
PIC18F2331/2431/4331/4431
DS39616D-page 64
2010 Microchip Technology Inc.
6.1.2.3
PUSH
and POP Instructions
Since the Top-of-Stack (TOS) is readable and writable,
the ability to push values onto the stack and pull values
off the stack without disturbing normal program execu-
tion is a desirable option. To push the current PC value
onto the stack, a PUSH instruction can be executed.
This will increment the Stack Pointer and load the
current PC value onto the stack. TOSU, TOSH and
TOSL can then be modified to place data or a return
address on the stack.
The PUSH instruction places the current PC value onto
the stack. This increments the Stack Pointer and loads
the current PC value onto the stack. The POP instruc-
tion discards the current TOS by decrementing the
Stack Pointer. The previous value pushed onto the
stack then becomes the TOS value.
6.1.2.4
Stack Full/Underflow Resets
These Resets are enabled by programming the
STVREN bit in Configuration Register 4L. When the
STVREN bit is cleared, a full or underflow condition will
set the appropriate STKFUL or STKUNF bit, but not
cause a device Reset. When the STVREN bit is set, a
full or underflow condition will set the appropriate
STKFUL or STKUNF bit and then cause a device
Reset. The STKFUL or STKUNF bits are cleared by the
user software or a Power-on Reset.
6.1.3
FAST REGISTER STACK
A Fast Register Stack is provided for the STATUS,
WREG and BSR registers, to provide a “fast return”
option for interrupts. The stack for each register is only
one level deep and is neither readable nor writable. It is
loaded with the current value of the corresponding
register when the processor vectors for an interrupt. All
interrupt sources will push values into the stack
registers.
The values in the registers are then loaded back into
their associated registers if the RETFIE, FAST instruc-
tion is used to return from the interrupt. If both low and
high-priority interrupts are enabled, the stack registers
cannot be used reliably to return from low-priority inter-
rupts. If a high-priority interrupt occurs while servicing a
low-priority interrupt, the stack register values stored by
the low-priority interrupt will be overwritten. In these
cases, users must save the key registers in software
during a low-priority interrupt.
If interrupt priority is not used, all interrupts may use the
Fast Register Stack for returns from interrupt. If no
interrupts are used, the Fast Register Stack can be
used to restore the STATUS, WREG and BSR registers
at the end of a subroutine call. To use the Fast Register
Stack for a subroutine call, a CALL label, FAST
instruction must be executed to save the STATUS,
WREG and BSR registers to the Fast Register Stack. A
RETURN
, FAST instruction is then executed to restore
these registers from the Fast Register Stack.
Example 6-1 shows a source code example that uses
the Fast Register Stack during a subroutine call and
return.
EXAMPLE 6-1:
FAST REGISTER STACK
CODE EXAMPLE
6.1.4
LOOK-UP TABLES IN PROGRAM
MEMORY
There may be programming situations that require the
creation of data structures, or look-up tables, in
program memory. For PIC18 devices, look-up tables
can be implemented two ways:
Computed GOTO
Table Reads
6.1.4.1
Computed GOTO
A computed GOTO is accomplished by adding an offset
to the program counter. An example is shown in
A look-up table can be formed with an ADDWF PCL
instruction and a group of RETLW nn instructions. The
W register is loaded with an offset into the table before
executing a call to that table. The first instruction of the
called routine is the ADDWF PCL instruction. The next
instruction executed will be one of the RETLW nn
instructions that returns the value “nn” to the calling
function.
The offset value (in WREG) specifies the number of
bytes that the program counter should advance and
should be multiples of 2 (LSb = 0).
In this method, only one data byte can be stored in
each instruction location and room on the return
address stack is required.
EXAMPLE 6-2:
COMPUTED GOTO USING
AN OFFSET VALUE
CALL
SUB1, FAST
;STATUS, WREG, BSR
;SAVED IN FAST REGISTER
;STACK
SUB1
RETURN FAST
;RESTORE VALUES SAVED
;IN FAST REGISTER STACK
MOVFW
OFFSET
CALL
TABLE
ORG
0xnn00
TABLE
ADDWF
PCL
RETLW
0xnn
RETLW
0xnn
RETLW
0xnn
.
相关PDF资料
PDF描述
PIC16C56A-04I/SO IC MCU OTP 1KX12 18SOIC
PIC18F4515T-I/ML IC MCU FLASH 24KX16 44QFN
PIC18F4515-E/PT IC MCU FLASH 24KX16 44TQFP
PIC18F4515-E/ML IC MCU FLASH 24KX16 44QFN
PIC18LF2610T-I/SO IC MCU FLASH 32KX16 28SOIC
相关代理商/技术参数
参数描述
PIC18LF43K22-E/ML 功能描述:8位微控制器 -MCU 8KB Flash 3968b RAM SERIAL EE IND RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC18LF43K22-E/MV 功能描述:8位微控制器 -MCU 8KB FL 512b RAM 8bit familynanoWatt XLP RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC18LF43K22-E/P 功能描述:8位微控制器 -MCU 8KB Flash 3968b RAM SERIAL EE IND RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC18LF43K22-E/PT 功能描述:8位微控制器 -MCU 8KB Flash 3968b RAM SERIAL EE IND RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC18LF43K22-I/ML 功能描述:8位微控制器 -MCU 8KB Flash 3968b RAM SERIAL EE IND RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT