HOME SYLLABUS HOMEWORK LABS LINKS NOTES
|
The goal of this assignment is to gain experience using subroutines, improve your assembly language style, and practice using the integrated debugger in the CCS IDE. This includes:
Port 1: Digital I/O Description (Ch7)Port P1 input, P1IN: reading returns the logical values on the inputs if they are
configured for digital input/output. This register is read-only and volatile. It does not
need to be initialized because its contents are determined by the external signals. Port P1 output, P1OUT: writing sends the value to be driven to each pin if it is
configured as a digital output. If the pin is not currently an output, the value is stored in
Digital Input, Output, and Displays 209
a buffer and appears on the pin if it is later switched to be an output. This register is not
initialized and you should therefore write to P1OUT before configuring the pin for
output. Port P1 direction, P1DIR: clearing a bit to 0 configures a pin as an input, which is the
default in most cases.Writing a 1 switches the pin to become an output. This is for
digital input and output; the register works differently if other functions are selected
using P1SEL. Port P1 resistor enable, P1REN: setting a bit to 1 activates a pull-up or pull-down
resistor on a pin (like the P1.3 button). Pull-ups are often used to connect a switch to an input as in
the section "Read Input from a Switch" on page 80. The resistors are inactive by Port P1 selection, P1SEL: selects either digital input/output (0, default) or an alternative function (1). Further registers may be needed to choose the particular function. Button Example: How to make P1.3 work in Pseudo-code
Submission:1 - Have each part of the lab checked out by Matt, Clint or Damian by showing your code, flashing your code to the board, and display working circuit. 2 - Print your final code with the following header: /*************************************************** 3 - Make sure you have a well commented code
Copyright © 2011 by Keith Vertanen. |
Montana Tech --
College of Letters, Science &
Professional Studies -- Computer Science
Department
All Rights Reserved and Copyright
© 2013 by Damian Valles