System Initialization
Élan™SC520 Microcontroller User’s Manual 3-21
3.11 DISABLING INTERNAL PERIPHERALS
Most applications will use the ÉlanSC520 microcontroller’s internal UART devices and its
internal real-time clock (RTC). However, some applications might need to use external
devices mapped to these same I/O locations. To use external devices, the corresponding
internal device must be disabled. This is necessary because these internal peripherals are
at fixed I/O locations and cannot be re-mapped. If any internal devices are disabled,
accesses to the I/O addresses for these peripherals are forwarded to the external GP bus.
Disabling these peripherals turns off their address decoding, so that externally connected
peripherals can be used in their place. If the addresses cannot be externally decoded
without a chip select, a PAR register must be mapped to allow a chip select to be asserted
for these addresses.
Using external devices in place of the internal ones might be necessary for several reasons.
A common reason would be to use a multifunction external chip that has parallel ports,
serial ports, floppy disk controller, an RTC, and other devices.
■ The internal RTC can be disabled by setting the RTC_DIS bit in the Address Decode
Control (ADDDECCTL) register (MMCR offset 80h).
■ UART 1 and UART 2 can be disabled by setting the UART1_DIS and UART2_DIS bits
in the Address Decode Control (ADDDECCTL) register.
Note that, if the internal peripherals are disabled, the external peripheral’s interrupt signals
will need to be connected to external interrupt lines, which then need to be routed to the
appropriate interrupt channel. For example, if an external UART is used to replace UART
2 (as COM2), then its interrupt could be connected to GPIRQ8, which would then need to
be routed to interrupt priority P3.
Also, in this scenario, the pin used for GPIRQ8 would need to be configured as a general-
purpose IRQ (the interface function for the pin, not its default PIO function) by setting the
PIO15_FNC bit in the PIO15–PIO0 Pin Function Select (PIOPFS15_0) register (MMCR
offset C20h).
Note: When the internal peripherals are disabled, they are still fully functional. Disabling
the peripherals disables the address decoding
only
for that device. For example, if the RTC
is programmed to generate interrupts and then subsequently disabled, it will continue to
generate interrupts but will no longer be accessible. Before disabling an internal peripheral,
be sure to turn off its interrupts.