Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 2: Core SFRs
TOC
Introduction
Ch. 1
Ch. 2
Ch. 3
Ch. 4
Ch. 5
Ch. 6
Ch. 7
Ch. 8
Ch. 9
App. A
App. B
App. C
Chapter 2: Core SFRs
Features and Function
The special function registers can be classified into two categories:
Core (CPU) registers - control and monitor operation and processes in the central processor. Even though there are
only a few of them, the operation of the whole microcontroller depends on their contents.
Peripheral SFRs- control the operation of peripheral units (serial communication module, A/D converter etc.). Each
of these registers is mainly specialized for one circuit and for that reason they will be described along with the
circuit they are in control of.
The core (CPU) registers of the PIC16F887 microcontroller are described in this chapter. Since their bits control several
different circuits within the chip, it is not possible to classify them into some special group. These bits are described along
with the processes they control.
STATUS Register
Fig. 2-1 STATUS Register
The STATUS register contains: the arithmetic status of the W register, the RESET status and the bank select bits for data
memory. One should be careful when writing a value to this register because if you do it wrong, the results may be
different than expected. For example, if you try to clear all bits using the CLRF STATUS instruction, the result in the
register will be 000xx1xx instead of the expected 00000000. Such errors occur because some of the bits of this register are
set or cleared according to the hardware as well as because the bits 3 and 4 are readable only. For these reasons, if it is
required to change its content (for example, to change active bank), it is recommended to use only instructions which do
http://www.mikroe.com/en/books/picmcubook/ch2/ (1 of 12)5/3/2009 11:32:08 AM