Programming; Serial Module Initialization; I/O Driver Example; Interrupt Handling - Motorola MC68306 User Manual

Integrated ec000 processor
Table of Contents

Advertisement

6.4.2 Programming

The basic interface software flowchart required for operation of the serial module is shown
in Figure 6-10. The routines are divided into three categories:

• Serial Module Initialization

• I/O Driver

• Interrupt Handling

6.4.2.1 SERIAL MODULE INITIALIZATION. The serial module initialization routines
consist of SINIT and CHCHK. SINIT is called at system initialization time to check channel
A and channel B operation. Before SINIT is called, the calling routine allocates two words
on the system stack. Upon return to the calling routine, SINIT passes information on the
system stack to reflect the status of the channels. If SINIT finds no errors in either channel
A or channel B, the respective receivers and transmitters are enabled. The CHCHK
routine performs the actual channel checks as called from the SINIT routine. When called,
SINIT places the specified channel in the local loopback mode and checks for the
following errors:
• Transmitter Never Ready
• Receiver Never Ready
• Parity Error
• Incorrect Character Received
6.4.2.2 I/O DRIVER EXAMPLE. The I/O driver routines consist of INCH and OUTCH.
INCH is the terminal input character routine and gets a character from the channel
receiver. OUTCH is used to send a character to the channel transmitter.
6.4.2.3 INTERRUPT HANDLING. The interrupt handling routine consists of SIRQ, which
is executed after the serial module generates an interrupt caused by a channel A change-
in-break (beginning of a break). SIRQ then clears the interrupt source, waits for the next
change-in-break interrupt (end of break), clears the interrupt source again, then returns
from exception processing to the system monitor.
MOTOROLA
MC68306 USER'S MANUAL
6-37

Advertisement

Table of Contents
loading

Table of Contents