Prior to the start of programming a microcontroller, it is necessary to set the conditions governing the operation of the microcontroller. The governing conditions imply the clock defining the speed of execution of instructions, the source of the clock, the protection against instabilities of the power supply, the protection against irregular execution of the parts of the program (through WATCHDOG timer, to be descibed later), etc.
The configuration of a microcontroller is carried out by the four registers:
Oscillator Configuration Register
Watchdog Timer Configuration Register
BOR and POR (Voltage Protection) Configuration Register
General Code Segment Configuration Register
These registers are in the programming memory in the upper half of the memory. Details concerning the programming memory can be found in Chapter 8 of the book. It is important to know that the locations in the programming memory are 24-bit wide.
The access to the configuration registers is enabled only during configuration of the microcontroller. Any attempt to access the configuration registers in terms of the programming code will result in the microcontroller reset.