Introduction
A microcomputer communicates with I/O devices using interface devices such as UART, timer, and parallel interface. These interface devices usually provide serial port, parallel ports, and /or internal timer. By writing appropriate binary numbers into the internal registers of these interface devices, a user can program them to carry out desired functions such as a real time clock, device controls, computer communication, etc. Interrupt mechanism is usually used for CPU to process desired I/O functions.
You have learned the concepts of interrupt processing and interfacing techniques in the class. In this laboratory, you are to implement a simple TALK FUNCTION using the RS232 serial port. Using serial port to carry out computer communication has broad applications in the computer industry. It allows data communication between digital electronic devices using a few hardwire connections. The RS232 interface is an industry standard for implementing asynchronous serial data communication ports on devices such as CRT terminals, keyboards, and modems. No matter what application one wish to realize using a serial port, the key to make it work contains only a few steps.
Program the UART by writing control words (registers) in it;
Write interrupt service routines to perform specific functions;
Build the logic construct of the program.
We will be using Motorola's ColdFire board in the Laboratory and you
need to be familiar with its DUART as well as its Parallel Interface and
Timer.
Objectives
The main objective of this laboratory is to exercise interface designs
through implementation of the "talk" function. To implement the "talk"
function, we need to connect two ColdFire boards through their serial
ports. A full duplex communication link is to be established so that a
user working on one computer can talk with a user on another computer freely.
By freely we mean that a user can type and send a message to the other
user at any time even when the user is receiving messages.
Preparation & Reading Materials
Review the class notes regarding interrupts and the interface device (UART).
Read the ColdFire user's manual on the UART (section 14) to learn how
to initialize it and program it to perform serial communications.
The initialization sequence for the UART is given in section 14-35 of
the ColdFire user's manual.
Read the ColdFire user's manual on the TIMER (section 12) to learn how
to initialize it and generate time-out signals.
An example of an initialization sequence for the TIMER is given in
section 12-14 of the ColdFire user's manual.
Basic Requirements
The basic requirements that you should implement in the lab are as follows:
The outgoing messages typed by the local user, and the received messages from the remote user must be displayed on two different lines without intermixing of characters. (separate the transmit and recieve areas of the display by a "-" or a "*" for example)
All characters should maintain their integrity throughout the transfer from board to board. (For example, if "a&b_ c" is transmitted from the host, it should look like "a&b_ c" on the receiving terminal)
After you send a sentence ended by a dot to the remote user, you expect to receive a response within 10 seconds. If not, a time-out signal should be generated and a reminder (a beep) should be sent to the remote user.
A control-c ends a talk process (ends the program).
Lab Procedures
In preparing for this lab, you should write a program in C or Assembly to carry out the main logic of the "talk" function.
Write assembly programs to set up the internal registers of the UART to carry out serial communications.
Write transmit and receive character subroutines.
Write assembly code programs to initialize timer control register and other internal registers in the ColdFire so that the timer can generate time-out signals as described above.
Write display subroutines to display transmit and received messages.
Put all routines together to form the entire program.
Finishing Up
Connect two computer boards using serial ports.
Compile your C programs and link with the assembly codes (if you used C).
Debug and run the entire program, testing all functionality.
Demonstrate the working "talk" funtion to the TA.