Communication Processor Module
16-182
MPC823 USER’S MANUAL
MOTOROLA
SCC2
COMMUNICATION
16
PROCESSOR
MODULE
16.9.9 Initializing Serial Communication Controller
The serial communication controller requires that a number of registers and parameters be
configured after a power-on reset. Regardless of the protocol you are using, follow these
steps to initialize the serial communication controller:
1. Write the parallel I/O ports to configure and connect the I/O pins to the serial
communication controller.
2. The RAID field of the SDCR should be initialized with the appropriate arbitration ID.
3. Write the port C registers to configure the CTS and CD pins to be in parallel I/O with
interrupt capability or to be direct connections to the serial communication controller
(if modem support is needed).
4. If the time-slot assigner is used, the serial interface must be configured. If the serial
communication controller is used in NMSI mode, the SICR must still be initialized.
5. Write the GSMR_H and GSMR_L, but do not write the ENT or ENR bits yet.
6. Write the PSMR.
7. Write the DSR.
8. Initialize the required values for the serial communication controller in its parameter
RAM.
9. Clear out any current events in the SCCE register (optional).
10. Write the SCCM register to enable the interrupts in the SCCE register.
11. Write the CICR to configure the SCC2 interrupt priority.
12. Clear out any current interrupts in the CIPR (optional).
13. Write the CIMR to enable interrupts to the CPM interrupt controller.
14. Set the ENT and ENR bits in the GSMR_L.
The buffer descriptors can have their R or E bits set at any time. Notice that the CPCR does
not need to be accessed after a power-on reset. The serial communication controller should
be disabled and reenabled after any dynamic change in its parallel I/O ports or serial
channel physical interface configuration. A full reset using the RST bit in the CPCR is a
comprehensive reset that can also be implemented.
Follow these steps to handle an interrupt in the serial communication controller:
1. Once an interrupt occurs, read the SCCE register to find out which source has caused
the interrupt. The SCCE bits that are going to be “handled” in this interrupt handler
would normally be cleared at this time by writing ones to them.
2. Process the TX buffer descriptors to reuse them if the TX or TXE bit was set in the
SCCE register. If the transmit speed is fast or the interrupt delay is long, more than
one transmit buffer may have been sent by the serial communication controller. Thus,
it is important to check more than just one TX buffer descriptor during interrupt
handling. One common practice is to process all TX buffer descriptors in the interrupt
handler until one is found with its R bit set.