
rivalslayer
-
Content Count
14 -
Joined
-
Last visited
Posts posted by rivalslayer
-
-
Awesome! Now we will have a working 16-bit Ultra Low Power Video game that will run on CR2032 batteries...
-
WOW! That's a big thing. I never thought about big stuff with the MSP430 Value line. You gave me inspiration man! I like it. Thanks for sharing!
-
Nice project. Can be be used to extend output capabilities. Thanks for sharing...!
-
Ya I was thinking about it. I haven't tried it though, but I will.
-
I think I could use timer for this job... Let's think on it a little more...
-
I was working on a Simon Game which runs on LPM4 most of the time, and I was having some issues with bouncing. So I did waste a few CPU cycles for two specially placed delays. I have written the test code to light up two LEDs when a button is pressed and made it totally with external interrupts.
When I used to work with AVRs, I used timers to debounce, but here I thought I can save too much battery if I used a little CPU utilization. I could use the timer with external interrupts but that would waste my only timer, which I have to use other purposes.
Here it goes,
Two LEDs are wired to P1.0, P1.1 (with 220 ohms in series) and the button is hooked between GND and P1.4. I had to use internal pull ups and make this work. It is working pretty fine.
#include long a; int counter = 0; //To check if the interrupt are working properly void init(); int main(){ init(); _EINT(); LPM4; while(1); } void init(){ // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; //Setting up the I/O P1DIR = BIT0 + BIT1; P1REN = BIT4; P1IE = BIT4; P1IES = BIT4; P1OUT = BIT4; P1IFG = 0x0; } #pragma vector = PORT1_VECTOR __interrupt void button_handler(){ LPM4_EXIT; _DINT(); P1OUT ^= BIT0 + BIT1; for(a = 0; a <= 0x200; a++); P1IES ^= BIT4; counter++; P1IFG = 0x0; for(a = 0; a <= 0x200; a++); _EINT(); LPM4; }
I like LPM4.
I changed the PxIES register to toggle the edge selection of interrupts. And basically that did the trick. I had to write two little delays specially placed so no misleading edges are detected.
Usually I don't put a while loop there in the main when I go to LPMs, but I saw that after a few ISRs, it stops working, and at the debugger I saw that it got restarted. So I put this while loop. I used the counter variable to see if the ISRs are working properly.
I used some standard buttons (Those comes with LaunchPad, I dunno the names).
-
Thanks for fixing the footprint GeekDoc.
It will help us a lot.
-
bluehash,
I definitely will fix it. I will upload it as soon as I fix it.
-
@bluehash, thanks a lot for moving it to apt section. I really didn't notice a project section. I would post it there. Sorry.
-
@simpleavr I used external interrupt, with a button. It did the trick.
@bluehash Thanks a lot! I have this footprint only and I am afraid the width of the real device is greater than the footprint. Have to modify is a bit.
@GeekDoc Ya I know, but the width was not really correct there...
BTW, This is my smallest PCB.
-
I was wondering what I could do with all the low-power I got and I decided I can make a pretty small message box, which will display a message with the press of a button. This time, it's only a message in Binary ASCII form.
I used a TicTac Lozenge box and made a small home brew through hole PCB, and powered it with a CR2032. I used the MSP430G2101 micro, as that was all I needed. I went up to LPM4 mode, to save a lot of power, and ran the whole application through timers and interrupts. I hope this thing will run for a few months on a single battery. (It never turns off, it just displays the message and sleeps again)
Problem was the footprint of MSP430G2101 in EAGLE. It was not really up to the size of the real device (I got it from the internet, I forgot where). Had to improvise. Will be making a new footprint. This project is the first one where I made a PCB footprint (for the CR2032 battery holder) myself.
Here is the thing...
-
Thanks a lot! I am trying to save energy by building a controlled water heater. The prob is heating is done through oil here, not electrical geysers. So I decided to build a controller.
-
Hii...
I recently got a LAUNCHPAD. TI has made shipping free in India, that was great! Saved me a lot. Thanks a lot to TI.
I am excited about the fact that I can run a MSP430 for months with a single CR3032 Battery. It's awesome. Thought lacking project ideas currently, I am experimenting on various peripherals.
I had some trouble with vectors on the beginning as I was more used to AVRs and WinAVR. Did have some trouble setting up IAR Embedded Workbench for MSP430, but had it working finally. Now I use CCS.
Launchpad+Accelerometer+Processing=Snake game!!!
in Projects
Posted
Great!