Posts

Showing posts with the label TI Launchpad

Energia: Code on a Timer with Tiva / Stellaris Launchpads

Image
Do you wish you could smoothly fade LEDs without having to code that into the main loop of your program?  Do you wish you could sample sensors or input ports an a regular basis while doing other activities in the main part of your Energia program?  Are you looking for simple ways of creating periodic activities without having to worry about timing loops or how long other processing takes in your loop() function?  If so, then you want to use a timer interrupts! This post describes how to run time based code in a Tiva/Stellaris Launchpad with 1ms precision. The same code runs on the MSP430 Launchpad with 2ms precision. Your function will be invoked at the interval you register without having to integrate any code in your run loop. The timer is in github along with a simple blinking light demo program. Usage AnyMsTimer calls a function()  on regular intervals independent of work you are doing in the the loop() function or the functions it calls. Register...

Cutting the TI Launchpad to Stuff it in a Smaller Case

Image
I've been giving away TI Launchpad Blinken-Light projects to some of my software-only friends so they can have something new to play with.  The projects are basically a TI-Launchpad, an RGB LED and a USB cable all mounted in some kind of case.  I've burned the simple firmware available on GitHub  so they can flash the LED over the serial port. Gamestop a Nintendo DS gift card tin. The TI Launchpad mounts fine in the tin if you tern it sideways but you have to shorten the board if you want the USB connector to come out the back. I used a Dremel cutting wheel to cut the board about one pin spacing below the last header pins. None of that circuitry is required to program or run the board.  That cuts off the reset switch, the two LEDs and the extra Vcc and GND pins. Here is the cutoff board mounted in a Gamestop DS Gift Card tin.  I mounted the 10mm RGB LED to the case and drilled a hole in the top. The case is pretty thin so it is pretty easy to sc...

MSP430 Fading and other long running activities using TwoMsTimer instead of delay()

Image
This video shows a simple test TI Launchpad test bed with an RGB LED tied to three PWM pins and the red LED that comes standard. The color fading and red LED flashing are independently controlled  with the code described below. Source Code Some folks just can't wait to open the source.  Here is the TwoMsTimer source along with the demo program used in this blog. Overview Micro-controller projects often include a mix of parallel tasks.  Handling those tasks with the right priority or interleaving can be a challenge when some of the tasks happen over long  periods of time. Long is relative to the execution speed of the CPU in this case. The simplest way to handle long running activities in a micro-controller is through the use of a loop that contains some type of delay to limit the loop's speed. One of the main problems with this type of code is that the  main loop() or central routines are blocked from doing anything else while in the delay block. The...

Digital Thermometer with TI Lanchpad MSP430 and Sparkfun breakout board for Nokia 5110 LCD

Image
The TI Launchpad  comes with a demonstration program that reports the current temperature of the on chip die back to a connected computer over the Launchpad's Serial/USB bridge.  The code is written in Texas Instruments Code Composer Studio (CCS).  CCS is a nice development environment but assumes a certain level of technical expertise not required when getting started with other environments. The LaunchPad Experimenter's Guide provides a schematic for the board. The folks on the Energia project on github (  https://github.com/energia/Energia  ) project have created a Arduino like development environment for the MSP 430.  Their libraries hide the register manipulation details from the developer though knowing those details is important when tuning the power tuning and performance of the MSP 430 CPUs.  The Energia project has a sample thermometer program that displays the current temperature on an the Nokia 5110 LCD display. Source is located on thei...