Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.COM

X  

PIC18FXXX Datasheet(PDF) 40 Page - Microchip Technology

Part # PIC18FXXX
Description  28/40-Pin High-Performance, Enhanced Flash Microcontrollers with CAN Module
Download  402 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC18FXXX Datasheet(HTML) 40 Page - Microchip Technology

Back Button PIC18FXXX Datasheet HTML 36Page - Microchip Technology PIC18FXXX Datasheet HTML 37Page - Microchip Technology PIC18FXXX Datasheet HTML 38Page - Microchip Technology PIC18FXXX Datasheet HTML 39Page - Microchip Technology PIC18FXXX Datasheet HTML 40Page - Microchip Technology PIC18FXXX Datasheet HTML 41Page - Microchip Technology PIC18FXXX Datasheet HTML 42Page - Microchip Technology PIC18FXXX Datasheet HTML 43Page - Microchip Technology PIC18FXXX Datasheet HTML 44Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 40 / 402 page
background image
PIC18FXX8
DS41159D-page 38
 2004 Microchip Technology Inc.
4.2
Return Address Stack
The return address stack allows any combination of up
to 31 program calls and interrupts to occur. The PC
(Program Counter) is pushed onto the stack when a
PUSH
, CALL or RCALL instruction is executed, or an
interrupt is Acknowledged. The PC value is pulled off
the stack on a RETURN, RETLW or a RETFIE instruc-
tion. PCLATU and PCLATH are not affected by any of
the RETURN instructions.
The stack operates as a 31-word by 21-bit stack
memory and a 5-bit Stack Pointer register, with the
Stack Pointer initialized to 00000b after all Resets.
There is no RAM associated with Stack Pointer
00000b. This is only a Reset value. During a CALL type
instruction, causing a push onto the stack, the Stack
Pointer is first incremented and the RAM location
pointed to by the Stack Pointer is written with the con-
tents of the PC. During a RETURN type instruction,
causing a pop from the stack, the contents of the RAM
location indicated by the STKPTR are transferred to the
PC and then the Stack Pointer is decremented.
The stack space is not part of either program or data
space. The Stack Pointer is readable and writable and
the data on the top of the stack is readable and writable
through SFR registers. Status bits indicate if the stack
pointer is at or beyond the 31 levels provided.
4.2.1
TOP-OF-STACK ACCESS
The top of the stack is readable and writable. Three
register locations, TOSU, TOSH and TOSL allow
access to the contents of the stack location indicated by
the STKPTR register. This allows users to implement a
software stack, if necessary. After a CALL, RCALL or
interrupt, the software can read the pushed value by
reading the TOSU, TOSH and TOSL registers. These
values can be placed on a user defined software stack.
At return time, the software can replace the TOSU,
TOSH and TOSL and do a return.
The user should disable the global interrupt enable bits
during
this
time
to
prevent
inadvertent
stack
operations.
4.2.2
RETURN STACK POINTER
(STKPTR)
The STKPTR register contains the Stack Pointer value,
the STKFUL (Stack Full) status bit and the STKUNF
(Stack Underflow) status bits. Register 4-1 shows the
STKPTR register. The value of the Stack Pointer can be
0 through 31. The Stack Pointer increments when val-
ues are pushed onto the stack and decrements when
values are popped off the stack. At Reset, the Stack
Pointer value will be ‘0’. The user may read and write
the Stack Pointer value. This feature can be used by a
Real-Time
Operating
System
for
return
stack
maintenance.
After the PC is pushed onto the stack 31 times (without
popping any values off the stack), the STKFUL bit is
set. The STKFUL bit can only be cleared in software or
by a POR.
The action that takes place when the stack becomes
full depends on the state of the STVREN (Stack Over-
flow
Reset
Enable)
configuration
bit.
Refer
to
Section 21.0 “Comparator Module” for a description
of the device configuration bits. If STVREN is set
(default), the 31st push will push the (PC + 2) value
onto the stack, set the STKFUL bit and reset the
device. The STKFUL bit will remain set and the Stack
Pointer will be set to ‘0’.
If STVREN is cleared, the STKFUL bit will be set on the
31st push and the Stack Pointer will increment to 31.
The 32nd push will overwrite the 31st push (and so on),
while STKPTR remains at 31.
When the stack has been popped enough times to
unload the stack, the next pop will return a value of zero
to the PC and sets the STKUNF bit, while the stack
pointer remains at ‘0’. The STKUNF bit will remain set
until cleared in software or a POR occurs.
Note:
Returning a value of zero to the PC on an
underflow has the effect of vectoring the
program to the Reset vector, where the
stack conditions can be verified and
appropriate actions can be taken.


Similar Part No. - PIC18FXXX

ManufacturerPart #DatasheetDescription
logo
Microchip Technology
PIC18FXXXX MICROCHIP-PIC18FXXXX Datasheet
7Mb / 444P
   64/80-Pin 1-Mbit Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt Technology
2004
More results

Similar Description - PIC18FXXX

ManufacturerPart #DatasheetDescription
logo
Microchip Technology
PIC18FXX8 MICROCHIP-PIC18FXX8_06 Datasheet
6Mb / 402P
   28/40-Pin High-Performance, Enhanced Flash Microcontrollers with CAN Module
2006
PIC18F258 MICROCHIP-PIC18F258 Datasheet
5Mb / 384P
   High Performance, 28/40-Pin Enhanced FLASH Microcontrollers with CAN
2002
PIC16F877A MICROCHIP-PIC16F877A Datasheet
3Mb / 234P
   28/40-pin Enhanced FLASH Microcontrollers
2003
PIC16LF876A-I MICROCHIP-PIC16LF876A-I Datasheet
2Mb / 234P
   28/40/44-Pin Enhanced Flash Microcontrollers
11/29/12
PIC16F876AT-I-SO MICROCHIP-PIC16F876AT-I-SO Datasheet
2Mb / 234P
   28/40/44-Pin Enhanced Flash Microcontrollers
11/29/12
PIC16F877A-IL MICROCHIP-PIC16F877A-IL Datasheet
2Mb / 234P
   28/40/44-Pin Enhanced Flash Microcontrollers
11/29/12
PIC16F877AT-I-PTG MICROCHIP-PIC16F877AT-I-PTG Datasheet
2Mb / 234P
   28/40/44-Pin Enhanced Flash Microcontrollers
11/29/12
PIC16F873A-ISP MICROCHIP-PIC16F873A-ISP Datasheet
2Mb / 234P
   28/40/44-Pin Enhanced Flash Microcontrollers
2001-2013
PIC16F877A-E MICROCHIP-PIC16F877A-E Datasheet
2Mb / 234P
   28/40/44-Pin Enhanced Flash Microcontrollers
07/28/03
PIC16LF877A-I MICROCHIP-PIC16LF877A-I Datasheet
2Mb / 234P
   28/40/44-Pin Enhanced Flash Microcontrollers
07/28/03
More results


Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL




Privacy Policy
ALLDATASHEET.COM
Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Datasheet Upload   |   Contact us   |   Privacy Policy   |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com