Jump to content

mavis311

Members
  • Content Count

    16
  • Joined

  • Last visited

  1. mavis311

    ez430 case removal

    Awesome. I hadn't noticed that corner before. It's actually pretty easy to get apart with just thumbnails. Thanks!
  2. mavis311

    ez430 case removal

    So, I got this ez430 at the beginning of the semester but never got a chance to play with it. I just finished finals, and now I'm trying to figure out how to get the darn case off. I don't want to break it, but it doesn't seem like it wants to come apart even though it is obviously designed to do so. Any hints/tips?
  3. mavis311

    Several LaunchPads available in UK (eBay)

    Wow. I don't know what the launchpad is actually selling for in the UK, but
  4. mavis311

    SNUPI

    While it is not my project, hack a day has a link to a project the Ubiquitous Computing Lab at University of Washington called SNUPI. SNUPI stands for sensor nodes utilizing powerline infrastructure and uses the f2013 mcu. Thought some of you might find this interesting. It's nice to see the 430 in use in this application!
  5. mavis311

    About the Advertisements.

    I have to agree, it's very tasteful and unobtrusive.
  6. mavis311

    List of MSP430 Webpages and Blogs

    Goodspeed not Goodman
  7. Same here. I've also entertained thoughts of creating library during the learning process but I don't yet have enough experience to know what material would be suitable. The MSP430 is the first opportunity I've had to program a uc and I'm loving the experience.
  8. Wow. I've been trying to keep my two cents to myself, but after a few days of seeing updates in this thread I just can't anymore. If someone creates a library that simplifies things for the amateur programmer, how is that a bad thing? Sean, I understand your stance, but you seem to have forgotten that there isn't (and never will be) legislation or armed guards to force people to learn all the low level stuff about a thing. For example: to drive a car, must I be forced by the auto industry or the government to know what pistons are or how many camshafts are in my car's engine? Some, like myself, have an intense interest in the low level stuff and truly enjoy learning it. But I'm afraid that we are in the minority -- especially when you broaden your view and consider things like PC programming. How many people do you think program for MS Windows using assembly? I don't know, but I'd wager that the number is quite small relative to the number of people who are using Python or Java or C#/VB.NET. Complex systems like Windows/MacOS/Your-favorite-or-otherwise-most-frequently-used-gui-here have created multiple layers of abstraction and dependence for the programmer. When you write code to create a new window under Windows, you don't have to manually draw the window every time the screen refreshes, all of that is handled for you so that you can concentrate on the things that you are trying to accomplish with the window in the first place. Now, while the msp430 isn't terribly complicated, having a useful library available for beginning programmers can only increase overall interest in the platform and encourage people who would otherwise have considered the task to complex for them to bother with. The most polite way I can describe your attitude regarding this matter is with the word "purist." Not always a bad thing, but I can't help drawing a comparison with certain other people with a similar purist attitude, some of them were known as Nazi's. You choose your own learning experience. No one will ever force you or anyone else to use a library to program the msp430. Just because you want something, you are not entitled to it. I see this attitude everywhere I go, especially in the United States, and it makes me sick. Why don't you just download TI's documentation and create your own tutorials? You'll learn so much more in the process than you would picking the brains of others and we won't have to be exposed to your intolerance. A win/win situation if ever I've seen one.
  9. mavis311

    32k crystal install and test

    Thanks for this! I think I read somewhere what the difference on the launchpad was with/without the crystal. Of course, now I can't find it. Anyone?
  10. mavis311

    LaunchPad on-board button doesn't trigger interrupt

    I've never heard of this pull-up/-down resistor thing until all this. Now let me know if I don't have even a slippery grasp of this, but I've been assuming that enabling the resistor prevented p1.3 from getting a high enough signal to trigger the interrupt. BTW, I love this bit:
  11. mavis311

    LaunchPad on-board button doesn't trigger interrupt

    Since my initial problem is solved, I just wanted to thank you all for your help. I've learned a good bit so far, but have even more to learn. I'm sure you'll continue to hear from me as I progress along this path. Thanks!
  12. mavis311

    LaunchPad on-board button doesn't trigger interrupt

    So... how is it that enabling the pull-up resistor for p1.3 causes the interrupt not to occur more than once? And does enabling P1REN for p1.3 use a resistor other than R34 (from bluehash's schematic)?
  13. mavis311

    LaunchPad on-board button doesn't trigger interrupt

    Well, I seem to have solved this problem. There were a number of problems with the code I was using and the solution leaves me somewhat perplexed. @boseji: There was no issue with the WDT, although I still don't really know what that is. I test my program with and without the code you pointed out, and it works the same both ways. I removed it since I don't know what it does yet. I had just been overlooking it until you mentioned it; thanks. @GeekDoc: from what I've discovered thanks to beretta's tutorials, you are correct in your comments. The thing that is puzzling me right now is P1REN, the resistor enable. Uncommenting the line that refers to P1REN causes the problem that caused me to seek help on this matter. With the line commented, the interrupt code is executed every time the button is pressed. I still have a lot to learn, but I've only been at it for a couple of days now. Working code: //****************************************************************************** // Hello LaunchPad // A simple program to get familiar with the MSP430. // I just want to flash the LEDs and show a response to the button. //****************************************************************************** #include "msp430g2231.h" #define DELAY 25000 #define NUM_FLASHES 3 #define FLASH_DELAY 750 #define LED_MASK (BIT0 | BIT6) void initializeButton(void); void initializeLEDs(void); int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer initializeButton(); initializeLEDs(); __enable_interrupt(); // quick and dirty main loop // just gonna toggle the leds until the cows come home unsigned int i; for ( ; ; ) { P1OUT ^= LED_MASK; // delay alternations i = DELAY; do { i--; } while (i > 0); } } // code also basically stolen from the temp sensor program #pragma vector=PORT1_VECTOR __interrupt void PORT1_ISR(void) { P1IE &= ~BIT3; // disable p1.3 interrupt P1IFG &= ~BIT3; // clear interrupt flag // P1IES |= BIT3; // reset edge select // watchdog timer code has no effect in this instance, but removed anyway // WDTCTL = WDT_ADLY_250; // IFG1 &= ~WDTIFG; /* clear interrupt flag */ // IE1 |= WDTIE; // unstolen code from here down int initialState = P1OUT & (BIT0 | BIT6); // save led state // give a quick 3 flashes of both leds and then resets the leds to the // state they were in when the button was pushed int counter = (NUM_FLASHES + 1) * FLASH_DELAY - 1; int onDuration = FLASH_DELAY / 2; // on for half the time P1OUT &= ~LED_MASK; // turn both LEDs off to begin do { if (counter % FLASH_DELAY >= onDuration) P1OUT |= LED_MASK; // on for a bit else P1OUT &= ~LED_MASK; // off for a bit counter--; } while (counter > 0); P1OUT = (P1OUT & ~LED_MASK) | initialState; // restore initial LED state, don't molest other bits P1IE |= BIT3; // reenable interrupt } void initializeButton(void) { // P1DIR &= ~BIT3; // set p1.3 direction to 0 - input // P1OUT |= BIT3; // sets p1.3 high // P1REN |= BIT3; // Resistor Enable up for p1.3, uncomment this line for only one button press // P1IES |= BIT3; // Interrupt Edge Select - 0: trigger on rising edge, 1: trigger on falling edge P1IFG &= ~BIT3; // Clear the flag P1IE = BIT3; // PxIE - Interrupt Enable Register } void initializeLEDs(void) { P1DIR = 0x41; // (BIT0 | BIT6) P1OUT = BIT6; // begin with only green led on }
  14. mavis311

    LaunchPad on-board button doesn't trigger interrupt

    Where do you think I would find the register definitions? What schematic are you referring to? Interestingly, your suggested modifications both did and didn't work. Using CCS4, if I Debug the project and choose "Run", it works as expected. However, if I choose "Free Run" or if I just power up the board with my program on the msp430, the button only responds once until I hit reset, as before.
  15. mavis311

    LaunchPad on-board button doesn't trigger interrupt

    Perhaps not... I really don't know what I'm doing with these interrupts, I've just hacked together something that looks like it might work from what little understanding I have and from my intuitions about copy and pasting other code into my program. Speaking of copy/paste, here is the code I'm using. Let me know if there is anything else that I'm doing wrong or if you don't know what I'm trying to do on a line or something. //****************************************************************************** // Hello LaunchPad // A simple program to get familiar with the MSP430. // I just want to flash the LEDs and show a response to the button. //****************************************************************************** #include "msp430g2231.h" #define DELAY 25000 #define NUM_FLASHES 3 #define FLASH_DELAY 750 #define LED_MASK (BIT0 | BIT6) // code basically stolen from the temp sensor project that came preloaded void InitializeButton(void) // Configure Push Button { // not really sure what most of this does. P1DIR &= ~BIT3; P1OUT |= BIT3; P1REN |= BIT3; P1IES |= BIT3; P1IFG &= ~BIT3; P1IE |= BIT3; } int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer InitializeButton(); // initialize leds P1DIR |= LED_MASK; P1OUT = BIT6; __enable_interrupt(); // quick and dirty main loop // just gonna toggle the leds until the cows come home unsigned int i; for ( ; ; ) { P1OUT ^= LED_MASK; // delay alternations i = DELAY; do { i--; } while (i > 0); } } // code also basically stolen from the temp sensor program #pragma vector=PORT1_VECTOR __interrupt void PORT1_ISR(void) { P1IFG = 0; P1IE &= ~BIT3; /* Debounce */ WDTCTL = WDT_ADLY_250; IFG1 &= ~WDTIFG; /* clear interrupt flag */ IE1 |= WDTIE; // unstolen code from here down // gives a quick 3 flashes of both leds and then resets the leds to the // state they were in when the button was pushed int counter = (NUM_FLASHES + 1) * FLASH_DELAY - 1; int initialState = P1OUT; // save led state int onDuration = FLASH_DELAY / 2; // on for half the time P1OUT = 0; do { if (counter % FLASH_DELAY >= onDuration) P1OUT = LED_MASK; // on for a bit else P1OUT = 0; // off for a bit counter--; } while (counter > 0); P1OUT = initialState; // restore led state }
×