Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Yes of course! Another question. How can I power the receiver circuit using the mains line in a safe way?
  2. Hey guys, I'm interested in building a remote-controlled (IR) light dimmer using the MSP430 for both the transmitter and the receiver. I'm still in the design phase, but I think I've figured most of it out. But because I'm still new to electronics, I don't know the best way to do things or what components there are out there. I have two issues in particular: [*:3mo52mus]- Is there a knob (just like those in a wall-mounted dimmer) which is NOT a pot but a free-rotating wheel with a way of sensing rotation clockwise and counter-clockwise? Does something like this exist? [*:3mo52
  3. Ah, I see. Is there a way to turn this off?
  4. Yup! That was the problem. I removed the RST jumper and it works fine now. Thanks! Edit: Actually I was wrong. The jumper isn't what makes the difference between working and not working. What makes the difference is whether or not you're debugging it or not. It only seems to work when you're not in debugging mode.
  5. I've been tryin to get the code posted there to work on my EXP430G2 board (rev 1.4) with the G2231 but to no avail (even a straight copy/paste doesn't work). The code compiles and runs, but pressing the switch does absolutely nothing. Am I supposed to change something if I'm using the G2231? One thing I thought was the problem was this line: #define FLIP_HOLD (0x3300 | WDTHOLD) /* flip HOLD while preserving other bits */ Shouldn't the 0x3300 part be 0x5A00 (WDTPW)? (Although I tried that with no go). I tried playing around with the code, but nothing seems to work. Also, many cha
  6. N00b question, but I don't understand floating pins. How can it make any difference if the pin isn't connected to anything? How can input ever read as 1 if there's no current?
  7. Thanks both of you for clearing up the watchdog timer question! Ah ok. I'm starting to understand. So when I do, for example, P1DIR |= BIT0 It translates into an instruction (BIS.B from what I see?) which sets the first bit of the Port 1 direction register, which then sets the first I/O pin on Port 1 as output, using logic gates. Then, when I do P1OUT |= BIT0 I set the output on the first I/O pin on Port 1 to high, which basically means to let the current go through? (ie. turn on the LED if there's an LED there). So then, is "writing to a pin" the same thing as "s
  8. Thanks for the reply bluehash! Yes, I understand that. My question is, how do I tickle the dog (using code) if I don't want to put him to sleep? Or is the dog tickled automatically? Yes! That's what I mean. What does it mean to set a pin as input or output?
  9. From what I understand, using OR is not the same at all as using +. For example: 1001 OR 1100 = 1101 (in decimals -> 9 OR 12 = 13) but 13 in binary is 10101, not 1101. So the end result is not the same.
  10. Thanks for the warm welcome. It works like a charm! Being completely new to this world, I have a few general questions (let me know if I should post it in another subforum): - Are all variables limited to 16 bits? For example, my DELAY variable has a maximum value of 0xFFFF. How would I go about sleeping for longer, say... 0xFFFFFFFF? (short of looping in a loop I guess). - I kind of understand why we need to disable the watchdog timer, but what if I wanted to leave it on? How would I make sure that it won't reset my program unexpectedly, but still reset it if it crashes? (Not sure if
  11. Hi, I am a newb (both in C and programmers) with an MSP430G2231 mounted on a LaunchPad. I successfully compiled the "Hello World" program: #include "msp430g2231.h" #define LEDRED BIT0; #define DELAY (0xFFFF); void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1DIR |= LEDRED; // Set P1.0 to output direction P1OUT &= ~LEDRED; // Turn off LED while (1) { P1OUT ^= LEDRED; // Toggle LED volatile unsigned int i = DELAY; // Delay while (i != 0) i--; } } Right now, I'm trying to also get the green LED to blink as well, so I have the f
  • Create New...