Computer science lab assignment
Lab 1 - Digital Logic Implemented on a Microcontroller
Preparation
· Download, load into CCS, and run these five projects:
1. GPIO_MSP432asm - Simple output
2. InputOutput_MSP432asm - More complex with inputs and outputs
3. Squarewaves_MSP432asm - Output to two pins
4. SSR_MSP432asm - Output to one pin
5. Switch_MSP432asm - Simple input from a switch and output to an LED
· Watch the related video(s) here
Purpose
The general purpose of this lab is to familiarize you with the software development. You will learn how to perform digital I/O on parallel ports of the MSP432. Software skills you will learn include port initialization, logic operations, and unconditional branching.
Procedure
The basic approach to this lab will be to develop and debug your system on the LaunchPad.
a) Find the five example projects listed above. Compile, download and run all five projects on your LaunchPad and choose the one that best matches the problem. These four example project codes show the basic template for the first few labs. Make a copy of one that projects and rename it Lab 1. You will not need global variables in this lab.
b) Write a flowchart for this program (see eq.(1)). I expect 5 to 15 symbols in the flow chart. Put this in Part 3.a of the lab report (see the template document).
c) Write pseudo code for this program (see eq.(1)). I expect 5 to 10 steps in the pseudo code. You may use any syntax you wish, but the algorithm should be clear. Put this in Part 3.b of the lab report (see the template document).
d) You will write assembly code (see eq.(1)) that inputs from P1.1 and P1.4, and outputs to P1.0. If eq.(1) is true, then the red LED should be on. Otherwise, the LED should be off (see this video to see how it should work). Put this in Part 4 of the lab report (see the template document).
|
P1.0 = (not(P1.1)) and (not(P1.4)) |
Demonstration
During the demonstration, you will be asked to run your program to verify proper operation. You should be able to single step your program and explain what your program is doing and why. You need to know how to set and clear breakpoints. You should know how to visualize Port 1 I/O in the debugger.
Lab Report
The lab report is how I will grade you on your labs. Usually, the report is due 1 week following the completion of the lab (see TITANium for due dates). However, do to unforeseen circumstances, due dates may change. I will try my best to keep everyone informed of any changes. With this said, it is your responsibility to turn the report in during the scheduled due date. There is a 10% penalty for late reports. Your report must be in MS Word Doc format. Submitting the report in another format will result in a 10% penalty. Your lab report must include the cover sheet from the lab report template available on TITANium. Not including the cover sheet will result in a 10% penalty. The template contains instructions for the report and the rubric used for grading the labs. Please, read it thoroughly. Don’t forget to include pertinent information such as code, flowcharts, waveform output, etc. in your report . Please, no “spaghetti” code, keep your code clean and use comments. Remember, your code will affect your lab grade. If I can’t understand it, then I will assume it’s incorrect.
2/2