CS452 - Real-Time Programming - Spring 2009

Lecture 17 - Serial IO: Programmer's Model

Practical Details

Split serial I/O channels


Serial Hardware

DMA

Direct Memory Access

HDLC

High-level Data Link Control

Serial Interrupts

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

What service is required

Transmitting

  1. Getting started
  2. Bytes arrive to transmit

    If transmitter is busy (UARTxFlag at 0x800[bc]0018)

    If transmitter is not busy & fewer than 16 bytes to transmit

    If transmitter is not busy & more than 16 bytes to transmit

  3. Modem status interrupt

    EITHER

    OR

  4. Transmit interrupt

    If there are more than 8 bytes to transmit

    If there are fewer than 8 bytes to transmit

Receiving

  1. Getting started
  2. Receive interrupt
  3. Receive Time Out interrupt

Typical Task Structure

Most simple

  1. Separate server/notifier pair for Receive and for Transmit
  2. Reparate Receive/Transmit quartet for each channel

Receive

  1. Server provides
  2. Notifier provides
  3. Questions.

Transmitter

  1. Server provides
  2. Notifier provides
  3. Questions

Issues

  1. Should it be possible to allocate a server?
  2. What should transmit/receive granularity be?
  3. Should servers be specialized to match devices on the end of their channel?
  4. How should echo be handled?

Return to: