ELEC 332
Design Challenges
This exercise suggests a number of possibilities for creative programming
to extend the capabilities of our growing MSP430 system.
However, it also contains a lot of other stuff that has to be done.
To allow you to respond to this challenge, but to prevent exhausting
your resources so early in the semester, you need only accept one of the
following challenges.
-
Programming Challenge 1: Digital Voltmeter.
Write a program which performs the following loop:
-
Read a character from the PC via the serial port.
-
If that character is between '1' and '5',
read the analog voltage on the corresponding P1 port pin via the A/D converter.
-
Send the value to the PC via the serial port
in a meaningful format (hexadecimal number, decimal number, etc.).
-
GOTO 1.
-
Programming Challenge 2: PC controlled PWM.
This basically entails going in the opposite direction from the previous challenge.
Write a program which accepts numbers (in any meaningful format)
from the PC via the serial port
and produces a PWM waveform on P1.2 having a corresponding duty cycle.
-
Programming Challenge 3: Timer driven SIO.
Software delay loops are a simple, but wasteful and potentially inaccurate
way of generating timed intervals.
A better way is to use the programmable timer function.
Ideally this would also be interrupt driven, so that the processor could be
doing other tasks while waiting for a character to be decoded.
The challenge:
write a program which,
using time intervals measured by the programmable timer rather than
software delay loops,
accepts characters from the PC and echos them back via the serial port.
There are a number of example programs available which cover this topic,
both in the TI literature and elsewhere.
However, they tend to (a) target to other branches of the MSP430 family,
(b) be overly complicated, or (c) both.
Feel free to mine this source of ideas,
but try to refine and improve upon what you dig out.