CS452 - Real-Time Programming - Fall 2010

Lecture 17 - Serial I/O: Implementation

Public Service Announcements

  1. Final exam: 9.30, December 16, 2010


Easy way to use interrupts

Enable only combined; read UART registers to decide what to do.

Think of the receive and transmit parts of the UART as separate state machines

Handy Features


Implementation

The simplest way to handle the interrupts is to turn on only the combined interrupt and then look at the registers of the device.

To identify the current interrupt

Read UARTxIntIDIntClr at 0x800[bc]001c

When service is required, without FIFO.

Transmitting

  1. Initialization
  2. When bytes arrive to transmit
  3. On transmit interrupt
  4. On modem status interrupt

Receiving

  1. Receive interrupt

Using the FIFO

Left as an exercise.


Task Structure

We are supposed to support

int Get( int port )

and

int Put( int port, char c )

These are wrappers for sends to one or more serial servers.

How many servers and notifiers?

one server two servers four servers
one

notifier

likely queue

congestion in

server

likely queue

congestion

in notifer

two

notifiers

one per channel?

one per direction?

how should they

be paired?

four

notifiers

certain queue

congestion

in server

likely queue

congestion in

server

best performance,

most tasks

How should we handle a terminal?

Issues

  1. Line editing
  2. Echo

    Either

    Or

Many other issues come up below as we consider possible task structures.


Return to: