Academic Program

General Purpose RAM

General Purpose RAM

General purpose RAM is located in each memory bank just below the SFRs. This memory is available for application data.

gp-memory.png

 

Common RAM

The last 16 bytes of bank 0 (addresses 70h - 7Fh) are repeated on every data bank. This allows application programs to access variables located in these addresses without having to set BSR.

common-ram.png

 

Shadow Registers

Located in the bottom of bank 31 are the PIC16F1xxx shadow and stack registers. The shadow registers save the program's context by capturing several core registers when an interrupt occurs. The core registers are restored when a RETFIE (return from interrupt) instruction is executed. 

shadow-registers.png

The stack is used to store the Program Counter in the event of an interrupt or subroutine call.