Morse Code Thermometer is a program that builds on the Blinking Thermometer. Instead of blipping the light to represent the temperature it blinks the light in Morse Code to represent the temperature. More interesting, when the light looks to be on it is actually switched on-off at about 500 Hz. So, with a modification to the Development Stick that brings a wire out from the first discrete output pin, you can actually have audio. In my setup I used two resistors (1k & 330) to voltage divide the discrete output and feed the resultant signal into my computers AUX audio input. A filter cap might help, but the tone sounds pretty good to me.
I've also used this signal into a VOX controlled radio transmitter. It turns out to be a slick way to transmit temperature to a remote location. An FRS radio can be used but I don't think the FCC allows anything but voice in the U.S. Ham Radio usage requires a license.
Since I haven't looked into using the PWM output, I am generating the tone by switching the output
under software control using a timer interrupt of about 1 msec. The dot and dash timing is
further divided down using a software counter in the HS interrupt service routine.
There are a few constants that might be interesting to play with.
The ADCSlope is 34 meaning that
the ADC puts out a count that changes by 34 when the temperature changes by 1 Degree F. I
determined this constant based on the value from the TI authors. The TI authors said 31 was
approximately 0.5 degrees C. I'm sure if you looked at how the ADC is setup you could derive this
value.
The ADCOffset was determined by knowing the temp, setting a breakpoint, and seeing what the value
that was returned in LastADCVal. Your device might have a different offset.
RestartDelay determines how many LS interrupt service calls are performed before starting the whole
thing over. The speed of the LS interrupt service is determined by CodeSpeed.
Text specifies the text sent. '??' is used to indicate the location within the text stream
to insert the temperature.
//****************************************************************************** // MSP430F20x3 Demo - SD16, Using the Integrated Temperature Sensor // // Description: Use SD16 and it's integrated temperature sensor to detect // temperature. Blink LED to represent temp. // // By B. L. Wiscons May 2007 based on example by // M. Buccini / L. Westlund // Texas Instruments Inc. // October 2005 // Built with IAR Embedded Workbench Version: 3.42A //****************************************************************************** #include <msp430x20x3.h> #include <string.h> //#include |