
#)
User
’
s Manual
18-10
1999-08
On-Chip RAM
Based on the application, the user may wish to initialize portions of the internal writable
memory (IRAM/XRAM) before normal program operation. Once the register bank has
been selected by programming the CP register, the desired portions of the internal
memory can easily be initialized via indirect addressing.
Interrupt System
After reset the individual interrupt nodes and the global interrupt system are disabled. In
order to enable interrupt requests the nodes must be assigned to their respective
interrupt priority levels and be enabled. The vector locations must receive pointers to the
respective exception handlers. The interrupt system must globally be enabled by setting
bit IEN in register PSW. Care must be taken not to enable the interrupt system before
the initialization is complete in order to avoid e.g. the corruption of internal memory
locations by stack operations using an uninitialized stack pointer.
Watchdog Timer
After reset the watchdog timer is active and is counting its default period. If the watchdog
timer shall remain active the desired period should be programmed by selecting the
appropriate prescaler value and reload value. Otherwise the watchdog timer must be
disabled before EINIT.
Ports
Generally all ports of the C161PI are switched to input after reset. Some pins may be
automatically controlled, e.g. bus interface pins for an external start, TxD in Boot mode,
etc. Pins that shall be used for general purpose IO must be initialized via software. The
required mode (input/output, open drain/push pull, input threshold, etc.) depends on the
intended function for a given pin.
Peripherals
After reset the C161PI
’
s on-chip peripheral modules enter a defined default state (see
respective peripheral description) where it is disabled from operation. In order to use a
certain peripheral it must be initialized according to its intended operation in the application.
This includes selecting the operating mode (e.g. counter/timer), operating parameters
(e.g. baudrate), enabling interface pins (if required), assigning interrupt nodes to the
respective priority levels, etc.
After these standard initialization also application-specific actions may be required like
asserting certain levels to output pins, sending codes via interfaces, latching input levels, etc.