Jump to content
nemetila

Using Stellaris Launchpad as a Thermometer

Recommended Posts

Hi,
 
Here is my first project with Stellaris Launchpad. This is a very simple thermometer, that uses the internal temperature sensor of the Stellaris MCU for temperature measuring, and the UART_0 module for sending data to a PC application. The PC application displays the current temperature in °C numerically and graphically (acts as a logger).
 
post-1253-14264605218722_thumb.png
 
Short Description:
 

In every two seconds the MCU:

  • measures the temperature with ADC:
    • ADC with 4 Samples and FIFO Depth
    • Each FIFO with 64X Hardware Sample Averaging
    • ADC Speed: 250 KS/s
  • calculates the average and the temperature data in °C:
    • Only integer math is used
  • sends data to the PC:
    • UART_0 module, TX only
    • Baud Rate 115200 kbit/s
    • Data format: „C”         -> real temp 23.56978°C       
    • Data format: „dC”       -> real temp 23.56978°C        sent data: „236dC”
    • Data format: „cC”       -> real temp 23.56978°C        sent data: „2357cC”
  • and then enters to hibernation:
    • Hibernation reduces self heating
    • Wake from hibernation by RTC or WAKE_PIN

 

LED indicators:

  • BLUE:  start from cold reset
  • GREEN: start from hibernation by RTC (indicates run mode)
  • RED: start from hibernation by WAKE_PIN

 

Source Code:

 

I used CCS 5.3 with StellarisWare to create the source code. Here is the full project:Stellaris_v01.zip

Install CCS 5 and StellarisWare.

Download and extract the *.zip file, then start CCS and use "Project"->"Import existing CCS Eclipse Project".

Browse the extracted "Stellaris_v01" directory and click "Finish". Build Project then debug.

 

 

I developed the PC application in C# with Visual Studio 2012, in Windows 8. The release files:

Release.zip

 

I updated my PC application. New features:

  • error corrections
  • users can select between Celsius [°C] and Fahrenheit [°F] temperature scale

The release files: http://forum.stellarisiti.com/index.php?app=core&module=attach&section=attach&attach_id=309

 

The source files: https://copy.com/4DkJpd4O49ky

 

 

Requirements:

 

A firmware for the MSP430 LaunchPad (MSP430G2553) with additional features(selectable averaging, supply voltage mesurement) is also available to the same PC application.

The source code: main.c

post-1253-14264605220255_thumb.png

 

Important notes:

  • „Getting Started with the Stellaris ® EK-LM4F120XL LaunchPad Workshop”: "Code Composer Studio has some issues connecting to hibernating devices (and reconnecting) since they essentially power off in the middle of the debugging process.

    We’ll try to step around those issues, but you may see CCS terminate abruptly. If this

    happens, you can restart CCS and try again, or you can use the LM Flash Programmer to reprogram the device with the qs-rgb (non-hibernation) program. In either case, you need to hold SW2 down to keep the LM4F device awake in order for either tool to connect."

  • I am new to ARM(Stellaris).

  • Some of the hibernation API functions is not clear to me.

  • Sorry for my English  :rolleyes:

Regards,

Laszlo

 

Updated: 02 June 2014

Share this post


Link to post
Share on other sites

Hi,

 

Thank You for your question.  :)

I'm a beginner too with Stellaris. I can debug UARTprintf function.

 

Possible sources of the problem:

 

Case 1: Because I used the StellarisWare library files:

"If you are playing around with the code and get the message “No source available for 

…”, close that editor tab. The source code for that function is not present in our project. It 
is only present as a library file." /Stellaris WorkShop WorkBook, page 3-18/
 
Case 2: After the MCU has entered to hibernation mode, CCS loses connection with the LaunchPad, because the MCU is not powered.
When it wakes again, CCS can't connect again.
"Note: Code Composer Studio has some issues connecting to hibernating devices (and re-
connecting) since they essentially power off in the middle of the debugging process. 
We’ll try to step around those issues, but you may see CCS terminate abruptly. If this 
happens, you can restart CCS and try again, or you can use the LM Flash Programmer to 
reprogram the device with the qs-rgb (non-hibernation) program. In either case, you need 
to hold SW2 down to keep the LM4F device awake in order for either tool to connect."
/Stellaris WorkShop WorkBook, page 6-10/
 

Share this post


Link to post
Share on other sites

I updated my PC application.

 

New features:

  • error corrections
  • users can select between Celsius [°C] and Fahrenheit [°F] temperature scale

post-1253-14264605230815_thumb.png

 

File to download: Release.zip

 

Feel free to ask if you have any questions or requests.  :)

 

 

 

Share this post


Link to post
Share on other sites

Hi

I am new in microcontrolloer programming. While I compile the program in IAR workbench, I got the following message:

 

Error[Pe020]: identifier "GPIO_PA0_U0RX" is undefined
Error[Pe020]: identifier "GPIO_PA1_U0TX" is undefined

 

I have included all necessary headerfiles and choose the stellaris in device option. Appreciate help.

 

Rgs.

Anisul
 

Share this post


Link to post
Share on other sites

Hi,

 

I think you have to add this two Preprocessor symbols:

IAR -> Options -> C/C++Compiler -> Preprocessor -> Defined symbols: (one per line) ->

ewarm

PART_LM4F120H5QR

 

Here is my settings:

post-1253-142646052374_thumb.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...