Lab Three: Parallel I/O and Software Delay Loops with MC9S12DP512 Microcontroller - Prof. , Lab Reports of Microcomputers

The objectives and tasks for laboratory three in a microcontroller course. Students are required to interface a bar-led and dip-switch to the parallel i/o port of the mc9s12dp512 microcontroller, develop software delay loops, and embed an assembly language module in a c program. Instructions for each task and expected outcomes.

Typology: Lab Reports

Pre 2010

Uploaded on 07/22/2009

koofers-user-lwe
koofers-user-lwe 🇺🇸

10 documents

1 / 2

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:
i. To interface a bar-LED to a parallel port of the MC9S12DP512 microcontroller
ii. To check the waveform and timing of the port signals by using a logic analyzer
iii. To interface a DIP-Switch to a parallel port of the MC9S12DP512
microcontroller
iv. To develop a software delay loop in order to display data on the bar-LED that is
hooked up to the output port
v. 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,
pf2

Partial preview of the text

Download Lab Three: Parallel I/O and Software Delay Loops with MC9S12DP512 Microcontroller - Prof. and more Lab Reports Microcomputers in PDF only on Docsity!

Laboratory Three

Basic Parallel Input/Output, and Software Delay Loops

Objectives:

i. To interface a bar-LED to a parallel port of the MC9S12DP512 microcontroller

ii. To check the waveform and timing of the port signals by using a logic analyzer

iii. To interface a DIP-Switch to a parallel port of the MC9S12DP microcontroller

iv. To develop a software delay loop in order to display data on the bar-LED that is hooked up to the output port

v. 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.