Basic Parallel Input/Output, and Software Delay Loops - Lab 3 | ECE 4510, Lab Reports of Microcomputers

Material Type: Lab; Professor: Bazuin; Class: Microcontroller Applications; Subject: Electrical & Computer Engineer; University: Western Michigan University; Term: Unknown 1989;

Typology: Lab Reports

Pre 2010

Uploaded on 09/17/2009

koofers-user-tup
koofers-user-tup 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Laboratory Three
Basic Parallel Input/Output, and Software Delay Loops
Objectives:
1. To interface a bar-LED to a parallel port of the MC9S12DP512 microcontroller
2. To check the waveform and timing of the port signals by using a logic analyzer
3. To interface a DIP-Switch to a parallel port of the MC9S12DP512 microcontroller
4. To develop a software delay loop in order to display data on the bar-LED that is
hooked up to the output port
5. To embed an assembly language module in a C program
Task One:
Interface an 8-bit bar-LED unit to the parallel I/O port as specified in your Prelab Assignment.
Write a C program that will configure the port for output and will send alternating data to the
port at the highest data transfer rate possible. Check the waveform and timing of the port
signals by a logic analyzer and make screen shots for your lab report. The scale of the plot
should be clearly indicated (e.g., 10ns/unit). You are to determine the maximum data transfer
rate [in KByte/s] at which your program can send data to the port. In order to achieve that set up
a suitable program loop.
Task Two:
i. You are now to add one 8-bit input port to the system using the parallel I/O Port as
specified in your Prelab Assignment. The input data will be provided using an 8-bit DIP-
Switch unit. The output data will be displayed on the bar-LED unit. Develop a C program
that reads the status of the DIP-switches through the input port, and then copies it to the
output port for verification. Verify the correct operation by single-stepping your code.
ii. Next develop a C program that reads the status of the DIP-switches, carries out the task
described in the Prelab Assignment, and then displays the results on the output port.
Task Three:
Develop a C program to display a visible bit pattern on the LEDs as given in your Prelab, or
determined by your Lab TA. Keep each bit pattern on for a time period specified in your Prelab, or
determined by your Lab TA. Employ a software delay between each data item that is sent to the
port. The required timing should be achieved by embedding an assembly code module in your C
program.
Demonstrate these programs to your Lab TA. All programs should be documented by screen
shots and/or C source code and assembly list files, as appropriate. All list files should be
commented on for full credit.
Note: Save your circuit for the next Lab.

Partial preview of the text

Download Basic Parallel Input/Output, and Software Delay Loops - Lab 3 | ECE 4510 and more Lab Reports Microcomputers in PDF only on Docsity!

Laboratory Three

Basic Parallel Input/Output, and Software Delay Loops

Objectives:

  1. To interface a bar-LED to a parallel port of the MC9S12DP512 microcontroller
  2. To check the waveform and timing of the port signals by using a logic analyzer
  3. To interface a DIP-Switch to a parallel port of the MC9S12DP512 microcontroller
  4. To develop a software delay loop in order to display data on the bar-LED that is hooked up to the output port
  5. To embed an assembly language module in a C program

Task One:

Interface an 8-bit bar-LED unit to the parallel I/O port as specified in your Prelab Assignment. Write a C program that will configure the port for output and will send alternating data to the port at the highest data transfer rate possible. Check the waveform and timing of the port signals by a logic analyzer and make screen shots for your lab report. The scale of the plot should be clearly indicated (e.g., 10ns/unit). You are to determine the maximum data transfer rate [in KByte/s] at which your program can send data to the port. In order to achieve that set up a suitable program loop.

Task Two:

i. You are now to add one 8-bit input port to the system using the parallel I/O Port as specified in your Prelab Assignment. The input data will be provided using an 8-bit DIP- Switch unit. The output data will be displayed on the bar-LED unit. Develop a C program that reads the status of the DIP-switches through the input port, and then copies it to the output port for verification. Verify the correct operation by single-stepping your code.

ii. Next develop a C program that reads the status of the DIP-switches, carries out the task described in the Prelab Assignment, and then displays the results on the output port.

Task Three:

Develop a C program to display a visible bit pattern on the LEDs as given in your Prelab, or determined by your Lab TA. Keep each bit pattern on for a time period specified in your Prelab, or determined by your Lab TA. Employ a software delay between each data item that is sent to the port. The required timing should be achieved by embedding an assembly code module in your C program.

Demonstrate these programs to your Lab TA. All programs should be documented by screen shots and/or C source code and assembly list files, as appropriate. All list files should be commented on for full credit.

Note: Save your circuit for the next Lab.