Start

End

Group

Website URL

Location

Interests

Sparkfun

Github

Form: Made a base similar to the Skylanders Portal, with some spray foam, coroplast, and Color Changing LEDs. This was added to a Totem Pole. Kid brother's school project. Function: Used an EZ430-F2013 as a simple Soft Switch, leds on 5 minute timer, to save the batteries from being drained. Code (main.c):
#include "common.h"
/*--------------
EZ430 Soft Switch, 5 Minute Sleep Timer using Watchdog
LED is P1.0 D1 on EZ430
TRANS is P1.1 2n2222 Transistor Base
PB is P1.2 Pushbutton
P1.3-P1.7, P2.6, P2.7 free
--------------*/
bool switch_state = 0;
void cpu_init(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WatchDog Timer
BCSCTL1 = CALBC1_1MHZ; // Set range to 1mhz Calibrated Range
DCOCTL = CALDCO_1MHZ; // Set DCO to 1mhz Calibrated DCO
// SMCLK = DCO = 1MHz
P2SEL &= ~BIT6 & ~BIT7; // Disable External Oscillator Pins
P2DIR |= BIT6 | BIT7; // Set as Output
P2OUT &= ~BIT6 & ~BIT7; // Set as Output Low
}
void out_init(void)
{
P1SEL &= ~LED & ~TRANS; // Set Pins as GPIO
P1DIR |= LED | TRANS; // Set Pins as Output
P1OUT &= ~LED & ~TRANS; // Set LED and TRANS Pins to Off
// Used for Testing, not needed as will not be visible
// P1OUT |= LED; // Turn on EZ430 LED
}
void pushbutton_init(void)
{
P1SEL &= ~PB; // Set Button as GPIO
P1DIR &= ~PB; // Set Button as Input
P1REN |= PB; // Set Buttons Pull-Up/Pull-Down Mode
P1OUT |= PB; // Set Buttons Pull-Up
P1IES |= PB; // P1.2 Interrupt set for High to Low Transition (Active Low)
P1IFG &= ~PB; // P1.2 Interrupt Flag Cleared
P1IE |= PB; // P1.2 Interrupt Enabled
}
// Port 1 interrupt service routine
#pragma vector = PORT1_VECTOR
__interrupt void Port_1_ISR(void)
{
// Clear LPM & Disable Interrupts to Allow main() to handle commands before returning to sleep
_BIC_SR_IRQ(LPM4_bits + GIE);
// Check which button pressed
if ( (P1IFG & PB) == 0x04) {
if (switch_state == 0) switch_state = 1;
else switch_state = 0;
}
// Debounce
scripted_wait();
scripted_wait();
scripted_wait();
scripted_wait();
scripted_wait();
// P1.2 IFG cleared
P1IFG &= ~PB;
}
volatile int second_count = 0;
volatile int minute_count = 0;
void timeDog_on(void)
{
WDTCTL = WDT_MDLY_32; // WatchDog Interval (Clock Source / Interval) (SMCLK / 32)
// 1MHz / 32 = 31.25kHz
// 1 / ( Clock Source / Interval ) = Freq in Milliseconds
// Happens 32 times per second! Duh! Every 32766 Clock Ticks. DUH!
IE1 |= WDTIE; // Enable WatchDog Interrupt, Still need to enable Global Interrupts
}
void timeDog_off(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WatchDog Timer
IE1 &= ~WDTIE; // Disable WatchDog Interrupt
minute_count = 0; // Reset Timer Count to 0
second_count = 0; // Reset Timer Count to 0
}
// WatchDog interrupt service routine
#pragma vector = WDT_VECTOR
__interrupt void WatchDog_ISR(void)
{
second_count++; // 32 Interrupts per Second * 60 seconds = 1920 per minute
if (second_count >= 1920) {
second_count = 0;
minute_count++;
}
if (minute_count >= 5) {
switch_state = 0;
// __low_power_mode_off_on_exit(); // Exit LPM at Interrupt End
_BIC_SR_IRQ(LPM4_bits + GIE);
}
}
void scripted_wait(void)
{
// SW Delay (how many seconds??)
volatile unsigned int hick;
hick = 10000;
do hick--;
while (hick != 0);
}
int main(void)
{
cpu_init();
out_init();
pushbutton_init();
__enable_interrupt();
// Turn on Switch when first plugged in for 30 seconds
minute_count = 4;
second_count = 960;
switch_state = 1;
// Setup Complete, now check state, run function, then go to sleep with interrupts
while (1) {
if (switch_state == 0) {
P1OUT &= ~TRANS; // Switch Off
timeDog_off(); // Disable Watchdog Interrupt
// __low_power_mode_4(); // Sleep until Button Press
__bis_SR_register(LPM4_bits + GIE);
__no_operation();
}
else if (switch_state == 1) {
P1OUT |= TRANS; // Switch On
timeDog_on(); // Enable Watchdog Interrupt
// __low_power_mode_0(); // Sleep with Timer
__bis_SR_register(LPM0_bits + GIE);
__no_operation();
}
}
}
Code (common.h):
#ifndef COMMON_H
#define COMMON_H 1
#include <msp430f2013.h>
#include <stdbool.h>
#ifndef TRUE
#define TRUE true
#endif
#ifndef FALSE
#define FALSE false
#endif
#ifndef BOOL
typedef bool BOOL;
#endif
#define LED BIT0 // P1.0
#define TRANS BIT1 // P1.1
#define PB BIT2 // P1.2
void scripted_wait(void);
#endif
Schematic: (not 100% complete, missing on board Reset pull-up, Decoupling Cap, and most of the EZ430 programming board stuff) The lights were made using some Slow Color Changing LEDs from a USB . These have a microcontroller inside providing current control and pwm. No resistor needed, and have a wide input range. But 3V is not enough for full brightness and colors, so the entire EZ430-F2013 stick was used. This is for a few reasons:
Power. The LEDs need 4V + for brightness, while the msp430 needs 3.5V. The EZ430's USB input and regulator ensures I have both voltages.
Plug and Play. I can reprogram the stick without having to worry about the 0.05" pins or wiring, or a programmer.
Adaptability. Currently uses a 3x AA battery pack with a usb female connector, can easily be switched to a USB wall charger without any changes.
I have multiple EZ430s lying around.
After figuring out the electronics (A simple NPN transistor is used, while the base resistor is probably undersized as I did not actually measure the total LED current consumption, bad cde, bad.), the code took some testing. Using the Watchdog timer and LPM0 and LPM4, as well as a switch, the lights turn on for 30 seconds when first plugged into power. After turning off, it works as follows. LPM4 until the switch is pressed, then the lights turn on. Dropping into LPM0 as the Watchdog Timer uses the SMCLK, it counts to 5 minutes then turn off, or it can be turned off by pressing the switch again. No hardware debounce, just some for loop delays, it works fine as long as the switch isn't held in for long, otherwise it might turn off/on again. The Totem was made using a PVC pipe, with plaster shaped on top. The Base was made using three things. The first is the coroplast (corrugated plastic, like cardboard. Same stuff street signs are made of). The one used was fairly opaque, a more transparent one would have been better. Once it was cut to size and holes drilled for the leds, the second part is some cardboard rolled around it. Once taped, the dirty part of the job was getting Expanding Spray Foam onto the sides. This was harder than it should have been since the can I used had a broken nozzle. Simply hold it from the inside, spray the foam on, rotate, spray some more, let it dry, rotate, spray some more, etc (a coat hanger worked great to hold it up between rotations). I pressed some of the air out once it started drying, be careful as spray foam is incredibly sticky, and at some points pulls, while at others it gets stringy. Finally done and hardened to touch, some of the less rocky parts were cut off with an exacto knife. It was then painted using some grey primer. No highlighting needed due to the texture and grooves creating shadows. (Warning, some spray foams will melt/be eaten away by some spray paints. I used Great Stuff brand spray foam from Home Depot, and I forget the spray paint brand). Hint, there is multiple types. The beige one I used expands more (1" holes) while the pink one (fire/heat resistant) is stiffer and has less air pockets. If I had to do this again, I would use the pink for it all. This is a basic cosplay/halloween prop/decoration technique Once done, everything was assembled. He has to get an A.

Hi there!
I wanted to do a temperature logger with my chronos ez-430.
Everything worked fine, and I installed the DataLog firmware (correct frequency).
After that I wasn't able to communicate with the watch anymore.
Wireless update still works, but on the normal firmware i can't sync, yust like with datalog firmware.
do you have any suggestions on how to solve this?
thanks,
Jonas Otto

I loved the eZ430-Chronos.
On the Internet many projects made ??on the basis of this development tool. But one thing I did not like is that you need a computer to manage their programs. And without a computer Chronos watch can not control anything. So I bought Anaren CC110L RF BoosterPack (868 Mhz). But this kit does not work with Chronos. I looked a lot of information and code on this forum and on the internet. But always something was wrong, I did not want to rewrite the SimpliciTi protocol. And finally... I did emulation of RF USB dongle. The project uses the unmodified Chronos Control Centre and firmware of sportswatch. But blurobin and wireless firmware update does not work. To me, this part is not important. I used code composer studio. And now I have a working SimpliciTI on msp430g2553 with CC110L. And Run many examples which are in SimpliciTi installation directory.
Here is a video how it works.
p.s.
Thanks to @gwdeveloper, with post SimpiciTI Tutorial for CC2500
p.p.s.
Project attached CCS SimpliciTI MSP430 CC110L Anaren busterpack.rar

How do I change the USB ID being looked for for programming? I have an ez430-F2013 USB stick that I would like to use with Energia. I have added the board to the list and compiled Blink successfully but it can't find the interface. It's looking for id 0451:f432 and the ID for the stick is :430

So, in last week's deal i got one Ez430 Chronos watch. Installed the last CCS, got almost a day of infrutiferously reading the e2e community reports on how to correct the **** path error on "C:\ti\ccsv5\msp430\include".. I ended up finding by miself these files were relocated to C:\ti\ccsv5\ccs_base\msp430\include.
So i took the easiest way and just duplicated the whole folder to the place where ccs was looking for it. (didn't found out how to change this in CCS, and somewhere i read that it was a eclipse bug, so i decided not to discuss with ccs and do what it wanted). I was able to get the examples imported and compiled. Woohoo!!!
Now, i have no idea how to backup the information memory, so i don't mess with the calibrations. Anybody knows of a TI note on doing that?
Thank-you very much for the attention, and i hope that helps anibody who runs in the same path invalid thing. Took me almost two days to fix ><"