Typewriter User Manual

7- 46 MC68340 USER’S MANUAL MOTOROLA
7.5 SERIAL MODULE INITIALIZATION SEQUENCE
The following paragraphs discuss a suggested method for initializing the serial module.
7.5.1 Serial Module Configuration
If the serial capability of the MC68340 is being used, the following steps are required to
properly initialize the serial module.
NOTE
The serial module registers can only be accessed by byte operations.
Command Register (CR)
Reset the receiver and transmitter for each channel.
The following steps program both channels:
Module Configuration Register (MCR)
Initialize the stop bit (STP) for normal operation.
Select whether to respond to or ignore FREEZE (FRZx bits).
Select the input capture clock (ICCS bit).
Select the access privilege for the supervisor/user registers (SUPV bit).
Select the interrupt arbitration level for the serial module (IARBx bits).
Interrupt Vector Register (IVR)
Program the vector number for a serial module interrupt.
Interrupt Level Register (ILR)
Program the interrupt priority level for a serial module interrupt.
Interrupt Enable Register (IER)
Enable the desired interrupt sources.
Auxiliary Control Register (ACR)
Select baud rate set (BRG bit).
Initialize the input enable control (IEC bits).
Output Port Control Register (OPCR)
Select the function of the output port pins.
Interrupt Status Register (ISR)
The XTAL_RDY bit should be polled until it is cleared to ensure that an unstable
crystal input is not applied to the baud rate generator.
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...