

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Electrical & Computer Engineering Page 1 / 3
In this lab, we will learn how to create additional asynchronous serial ports by memory-mapping a Texas Instruments (or substitute) TL16C550 UART to our 68HC12 development board. This interface will allow characters to be received and transmitted between the microprocessor and a PC serial port. This is an additional serial port to the one built into our 68HC12. In an early experiment you will use polling for the receive and transmit flags in your TL16C550 UART’s internal registers; later you will replace this mechanism with an interrupt-driven communication system. You will also write code for the 68HC12’s internal UART. REQUIRED MATERIALS 1 - 16C550 UART Chip (40-pin) 1 - Socket for UART (40-pin wide) 1 - 1.8432 MHz Clock 1 - Socket for Clock (8-pin wide) 1 - RS232 Line Driver (20-pin) either DS229 Chip or SP232 Chip 1 - Socket for RS232 Line Driver (20-pin narrow) 4 - 0.1 uF capacitors for RS232 charge pump 1 - Socket for the 4 charge pump capacitors (8-pin) 2 - 0.1 uF bypass capacitors (UART & RS232 chips) 1 - Female DB9 Header 1 - Socket for DB9 Header (only need a single row of 5 pins) PART I – WRITE USING POLLING The first step in being prepared for this lab is to study the UART/RS232 notes attached to this lab as well as the data sheets for the TL16C550 and the RS232 line driver chips, both on our web site. We will be using the TL16C550 in TL16C450 mode. The C550 chip is a functional upgrade of the C450 with optional FIFO mode (which we will not use). You will also be using a Sipex SP232A RS- 232 Line Driver/Receiver device (or similar). The web sites for the manufacturers of the two above devices are www.ti.com and www.sipex.com, respectively. Upon studying these materials, proceed as follows:
Electrical & Computer Engineering Page 2 / 3
Use your earlier software to initialize the UART's internal registers to again match the HyperTerminal settings. Next, write a short routine to test (i.e. poll) the Data Ready (DR) flag in the Line Status Register. When the flag is set (high), read the Receiver Buffer Register (RBR) and display the character on your LCD added in the last lab. Don’t forget to initialize the LCD. Force this code to repeat in an infinite loop such that we can type keys in the HyperTerminal window and see them show up one at a time on your LCD. PART III – WRITE/READ VIA INTERRUPTS Wire the 68HC12's IRQ signal to the UART as shown in the UART/RS232 notes. Do not forget to add the appropriate CPLD jumper. The UART will now be used to interrupt the 68HC12 whenever a character is sent out or received. Here are the specific steps to achieve this objective:
The 68HC12 has an Asynchronous Serial Communication Interface (SCI). This system works just like the C chip. It only requires an external RS-232 driver. This is the system that is connected to the on-board DB-9 header. READ Chapter 11 in the S&HE book (soft-cover) sections 11.1, 11.2, and 11.3. These sections discuss the SCI system in detail. You are to write a program similar to that of Part III (reading and writing using interrupts) using the SCI system. The program is described below.