Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Reputation Activity

  1. Like
    gatesphere reacted to GeekDoc in Weird CCS problem with #define   
    I knew I'd seen it somewhere... MSP430x2xx Family User Guide, section 10.2:
  2. Like
    gatesphere reacted to GeekDoc in Self-Powered Breadboard Setup   
    I wanted a neater way to do some breadboarding at my desk, so I built an enclosure with batteries and two power supplies and mounted some breadboards to it.

    Click the photo to see the build on my blog.
  3. Like
    gatesphere got a reaction from teoah in Weird CCS problem with #define   
    By page 10-6 of the MSP430x2xxx family user's guide, you would do it like this in ASM:

    Which in C would look something like:

    Assuming WDTCNTCL is defined in the appropriate device header. I haven't looked into it, but it should be. Check it out for yourself?
    The problem with this is that you'd have to do this every few operations or the program would reset anyways. But maybe you can come up with a solution?
    Good luck!
  4. Like
    gatesphere reacted to cde in Launchpad Easy Breadboarding Trick   
    Just a follow-up. Finally sat down and soldered the sockets on. Easiest way that I could think of to make sure the sockets where nice and level (and straight) was to mount the sockets on a header on a breadboard. Since I didn't have one wide enough, I used two. And it also made it easier than using a helping hands holder.

    Flux helped alot. How do people solder or desolder/fix things with 15w irons anyway? The solder won't remelt a second time, and I suck at using desoldering braided wire.
    Anyway, the real follow-up is this. Made a small jumper from a 4 pin header, that brings p2.7 to p2.4 and p2.6 to p2.5. I used a pair of wire cutters at the very edge of the lead, enough to snip it without cutting it off completely. This let me bend it across to the next lead. This pair is for p2.6 to p2.5. Even with the extended lead header I had, I couldn't do the same to the top, so I took an extra header pin, and using a helping hands holder, positioned it on top. After soldering the pins together, clipped the excess on either side.

    Optionally, you can throw some heatshink on it.

    Only had yellow in that size. Yuck. Will either replace with black eventually (or launchpad red), or just leave it uncovered.
  5. Like
    gatesphere reacted to cde in Choosing a MSP430 chip   
    Found this nice brochure on TI's site.
    A complete breakdown of the various msp430 chips, what peripherals they has, and what those peripherals do as well as explaining the different LPM Modes. Well, except for the most important question to us, SBW capability.
    Interesting to note, there is quite a bit of overlapping of the MSP430G line and the MSP430F20xx line. Basically, all of the basic options (Different type of ADC on 2 parts is the only difference), except that the Valueline chips are just cheaper (And apparently, use less power too). I expect the F20xx line to be obsoleted eventually in favor of the ValueLine chips.
    Edit: The F20xx line can come in better temperature rating -40 to 105c, vs -40 to 85c)
    Aside from the MSP430G and F20xx lines which come in nice PDIP and SOIC packages, there is the MSP430F21x1 Line. Also comes in SOIC, has more gpio/flash/ram than the Gxx or F20xx lines, but no hardware UART/SPI/I2C or good ADC, but worst of all, NO SPY-BI-WIRE, ie, no launchpad/ez430 support. Avoid the MSP430F21x1 Line of chips unless you want to buy a new programmer. For the same reason, avoid the entire MSP430F1xxx Family.
    The next step above the Gxx and F20xx line that we can use is the MSP430F21x2 line. It's like doubling a Gxxx chip. More Flash, More Ram, More GPIO, More Timer Comparators, double the Hardware Interfaces, at about three times the cost haha (1.55 in 1k volume vs the 0.52 in 1k for the G2231). They come in the smallest hobbyist friendly package, 28-TSSOP, and are SBW compatible.
    The final line I will talk about is the MSP430F22xx line. They are basically bigger badder versions of the F21x2 line (More Ram/Flash/GPIO/Timers and a 12ch vs 10ch ADC). The F22x4 version has an a pair of opamps built in compared to the F22x2 line (20 cents more) but otherwise the same thing. The thing is that they come in a 38 pin TSSOP package. 28 pin TSSOP is the highest that I have seen in affordable dip breakout packages, so this is probably the limit for the general hobbyist unless you will etch/order custom pcbs. SBW compatible. The highest end version F227x has 32kbits of Flash, which is beyond CCS's 16kb limit. The Lower end F223x has 8kb flash, which is beyond IAR's 4kb limit. Which means you can still use them in CCS or IAR, but only up to the code limit, but you'd be paying more for using less (Unless you need to Opamps). MSPGCC has no limit.
    There are other SBW chips, but they are in insanely small pin packages and I won't bother going through the datasheets. As well, the planned 20pin DIP chips should be SBW and Launchpad compatible as well.
    Hopefully TI adds SBW as a searchable parameter for their search tool soon/eventually.
    Launchpad/EX430 compatible lines:
    G2xxx 14-DIP/SOIC (Valueline/Launchpad Standard)
    F20xx 14-DIP/SOIC (But unless you have a bargain, the G2xxx line is cheaper/better imho)
    F21x2 28-TSSOP (2 or 3 times as good as Valueline) IAR can only use half of the highet chip's flash.
    F22xx 38-TSSOP (3 or 4 times better than Valueline) CCS can only use half of the highest chip's flash. IAR can only use half/a fourth/an eighth of the flash on the F223x/F225x/F227x respectfully.
  6. Like
    gatesphere reacted to GeekDoc in Joby Taffey made Hack-A-Day!   
    One of our members was featured on Hack-A-Day! They featured his work on the USB dongle from the Girl Tech IM-ME device. Have a look: HERE
    Nice work Joby!
  7. Like
    gatesphere reacted to GeekDoc in Connecting Piezo Vibration Sensor to LaunchPad   
    You can use any P1.x pin as long as you configure it to ADC.*
    The extra components there are for voltage limiting (zener diode) and keeping the pin voltage from floating when there is no voltage from the peizo (pull-down resistor).*
    The Arduino is a 5v device and accepts 5v logic. The MSP430 is a 3.3v device; 5v logic could damage the MSP430. Replacing the zener with a 3.3v version will limit the output to 3.3v (anything higher will be shunted to ground through the zener diode). Using the 5.1v zener could allow a damaging voltage level (5.1v) to your MSP430.*
    *Note: I'm not the best at this stuff on this forum, and I have been wrong before. :? Hopefully others will confirm or correct my post.
  8. Like
    gatesphere got a reaction from bluehash in DIY $3 contact microphone/piezo pickup   
    Hello all,
    I hacked together a piezo pickup for acoustic instruments (initially to test the sensitivity of the piezo elements I'm going to use in another project, but this experiment turned out rather well). This thing is awesome. My roommate and I had fun with this thing for hours last night, taping it to everything... even our throats. It picks up voices!
    Anyways, the whole thing can be built for around $3 from RadioShack, assuming you already have a soldering iron, solder, and electrical tape. But who doesn't?
    I did a write up with pictures and demo recording on my blog. Check it out here: http://blog.suspended-chord.info/?c=25

  9. Like
    gatesphere got a reaction from bluehash in LaunchPad + BeagleBoard Sentry Droid security cam   
    Not my project, but I thought you all would find this interesting.
    EDIT: corrected link.
  10. Like
    gatesphere got a reaction from GeekDoc in HD44780-based LCD - cursor problem   
    To me, the problem seems to be your heavy use of the "extern" keyword. It's un-needed in any of those files, but the file causing issues is lcd.h.
    The code (starting on line 70):

    extern void vWait( int uibaseinterval, int ucrounds); extern void LCD_init(void); void LCD_sendByte( char data); extern void LCD_inst( char data); extern void LCD_char( char data); extern void LCD_string(char const *point); extern void LCD_cursor( char data); extern void LCD_write_CGRAM( char CGR_addr,const char *CGR_data); extern void LCD_init_CGRAM(void); extern void LCD_disp_allpixels (void);
    I'd just take the extern off of those. Your function calls will all be in the right scope, so long as you include lcd.h. If lcd.c is in your project, CCS/IAR/gcc will know enough to compile it without you telling it to. Including lcd.h lets the compiler know that those functions exist and will be found elsewhere. Using extern here is just overkill and confusing the compiler. Or, at least that's what I think. I could be wrong. Try it and see?
  11. Like
    gatesphere got a reaction from GeekDoc in NXP Embed Design Challenge - Free LPC1768 kit   
    Good news! I've gotten it to work!
    Bad news... it depends on a heavy (but free) Eclipse-based IDE (however, it uses gcc-arm behind the scenes, so there is no code-size limit!). Also, no mbed libraries, nor JTAG/debugging. But that might just prompt me to write an LPChere framework ala MSPhere, and there's always serial monitoring.
    I'll be doing a blog post later. For now, I must be off. Just thought I'd share the good news!
  12. Like
    gatesphere reacted to simpleavr in HD44780-based LCD - cursor problem   
    actually i think it is the other way around, to use the XIN XOUT as IOs, i have to set them to 0s
    P2SEL &= ~(BIT6|BIT7);
    it is more consistent this way, all P1 pins have P1SEL bit low when they are digital IOs.
    i checked the datasheet p.43 and p.44 to confirm this, the tables also implies that u cannot use P2.7 as IO when P2.6 is timer output.
    i observed this as i always sets P2SEL=0x00; to make them available as IO.
    i would guess that at POR value of P2SEL is set to BIT6+BIT7 (aux function, but default setting) and u have to reset them (turn off) to enable IO.
  13. Like
    gatesphere got a reaction from larsie in LaunchPad library-TLV5620, w/ example waveform generator   
    Hi all. I've written a quick library to support the TLV5620 8-bit, quad-channel DAC from TI. This is a relatively powerful chip, and available in TI's magnificent sample program, in quantities of up to five in two temperature ranges (C and I).
    Anyways, as I'm lazy and don't want to rewrite my blog post here, and as I'd also like to attract more traffic to my blog, I'll just post the link here.
    If you have any questions or comments, feel free to leave them here or on my blog. I'll try to answer everything to the best of my knowledge
    Blog post:
  14. Like
    gatesphere got a reaction from bluehash in Quick and dirty 74HC595 shift register demo   
    Hi all.
    In an effort to prototype the shiftOut() function for my MSPhere library, I went ahead and threw together a quick and dirty binary LED counter using the LaunchPad, 8 LEDs, 8 1k resistors (not ideal, but they're the lowest value I had on hand, the rest are packed up to go to campus with me on Sunday), and of course, a 74HC595 shift register.
    Basically, you set up the circuit as follows: (all pin numbers are in regards to the '595 chip, information available at http://www.msarnoff.org/chipdb/74595)
    Q0-Q7 (pins 15, 1-7): LED to ground, with suitable resistor in series.
    GND (pin 8): ground, obviously.
    Vcc (pin 16): Vcc, obviously
    MR (pin 10): Vcc.
    OE (pin 13): ground.
    DS (pin 14): P1.0 on the LaunchPad
    RCK (pin 12): P1.1 on the LaunchPad
    SCK (pin 11): P1.2 on the LaunchPad
    What the code does is count from 0 to 255, with each count setting the latch pin (RCK, P1.1) low to prevent flashing of the LEDs while shifting bits, and then calls shiftOut(), which breaks the value down into bits, writing them out to DS one at a time, while pulsing SCK low-high in the process to allow the bits to be shifted out. After that, the RCK is brought high again, allowing the LEDs to light in unison. Then there is a delay of 25000 clock cycles to allow the count to be followed by the human eye.
    Here's my code:

    // LaunchPad 74HC595 Test // uses a 74HC595 chip to make a binary counter which counts from 0 to 255 and then resets // written by gatesphere/suspended-chord (http://suspended-chord.info/) // 27 August 2010 // placed into the public domain #define __MSP430G2231__ //#define MSBFIRST //uncomment this line to shift bits out in reverse (most significant bit to least significant bit) #include // pins: // P1.0 -> data pin DS (pin 14) // P1.1 -> latch pin RCK (pin 12) // P1.2 -> clock pin SCK (pin 11) #define DATAPIN BIT0 #define CLOCKPIN BIT2 #define LATCHPIN BIT1 void shiftOut(char data); void main() { WDTCTL = WDTPW + WDTHOLD; // kill WDT P1OUT = 0x00; P1DIR = DATAPIN + CLOCKPIN + LATCHPIN; while(1) { volatile unsigned char i = 0; volatile unsigned int j; while (i < 256) { P1OUT &= ~LATCHPIN; // take latch low shiftOut(i); // push out i P1OUT |= LATCHPIN; // enable LEDs i++; for (j = 0; j < 25000; j++); // delay 25000 cycles } } } void shiftOut(char data) { volatile int i; char temp, temp2; #ifdef MSBFIRST // reverse order of the bits for (i = 0; i < 8; i++) { temp = (0x01 & data); data = data >> 1; temp2 = (temp2 << 1) + temp; } data = temp2; #endif for (i = 0; i < 8; i++) { // 8 bits to a char char bittowrite = (0x01 & data); // get bit data = data >> 1; // shift data left if (bittowrite == 1) { // send bit P1OUT |= DATAPIN; } else { P1OUT &= ~DATAPIN; } // pulse clockpin P1DIR |= CLOCKPIN; P1DIR &= ~CLOCKPIN; } }
  15. Like
    gatesphere got a reaction from bluehash in MSPhere - Arduino-like framework of functions for the MSP430   
    Hello all,
    If you've been reading my posts, you might have heard me mention a framework I've been working on for the MSP430 to bring the Arduino functions and programming paradigm to the MSP430--in particular the LaunchPad and compatible devices. Note that this is not a direct port of the Arduino libraries, but original work with a few code snippets whose basic functionality is the same on both architectures littered in.
    Well, I've made some progress, and thought I'd start this thread about it. I will update this first post as time goes on, linking all of my blog articles to this post, and eventually my code.
    Current news is on my blog as always, but here's a post list:
    Introductory post - in which I detail the first steps of my work, potential future trajectory, and explain the name a bit. (Thanks NJC!)
    Update 1 - in which I announce the wiki and homepage for the framework.
    Update 2 - in which I lay bare my progress towards an initial release.
    Anyone is welcome to contribute anything they wish, and it will be released under the GNU GPLv3 when it's been completed a bit more.
    EDIT 26August2010: I have started a wiki section for this framework. It is available here.
    EDIT 31August2010: I have posted a small homepage for the framework. It contains useful links. It is available here.
    EDIT 08September2010: I have posted an update to the blog enumerating how far I've come with it, and which hurdles lie ahead before an initial release. Link above, see "Update 2".
  16. Like
    gatesphere got a reaction from bluehash in ADC10 Example - a photo-sensitive noise maker   
    Hey all,
    I made up a quick little noise maker to get used to some ADC10 code. Code and information is available on my blog: http://blog.suspended-chord.info/?c=16
    Let me know what you think!
    EDIT: New blog post with fixed code: http://blog.suspended-chord.info/?c=17
  17. Like
    gatesphere got a reaction from GeekDoc in HD44780-based LCD - cursor problem   
    This is quite easy, if you don't have the crystal soldered on. These two pins are P2.6 and P2.7, and to enable them as GPIO pins, you simply use something like...

    P2SEL |= BIT6 + BIT7;
    This register (the PxSEL register) tells the MSP430 which function to use the pin for. P1 is set by default to be GPIO, and P2 is set by default to be for peripheral use. Setting the appropriate bits to 1 in the PxSEL registers tells the MSP430 to use the secondary mode, which for P2 is as a GPIO pin.
    Hope this helps!
    Oh, and cde... great idea with the LEDs. I never would have thought of that!
  18. Like
    gatesphere reacted to cde in HD44780-based LCD - cursor problem   
    Two options for debugging, and they can be done simultaneously.
    First, throw some leds between the shift register and the lcd. Don't know how much current can be sourced from the register, but all you need is enough to light them for debugging purposes. This allows you to ensure every control nibble you push is what it should be.
    Second, you could tie the register's latch to its clock, and drive the lcd's enable pin directly. More control, same number of lines.
    Since the 2 line setup comes relatively quick into using the lcd, and the first five you should be able to verify quickly.
    Additionally, can you place the cursor on ANY line 2 ram address? Try a loop moving it to every position(And write a character) from 0 to 255.
    According to http://www.spikenzielabs.com/SpikenzieL ... ow_To.html (and to a page with alot more detailed DDRAM address configurations that I can no longer find since I saw it like 2 weeks ago, errr http://ouwehand.net/~peter/lcd/lcd0.sht ... e_displays), the address for the second row of a 2x16 is at 0xC0. Not 0x40. Try that.
  19. Like
    gatesphere reacted to bluehash in You can Thank users now!   
    Hi All,
    43oh has a new feature, where you can "Thank" users if their posts have been helpful to you. You will see a tiny "Thumbs Up" sign on the top right of every post, except yours..as you can't thank yourself :mrgreen: .
    This also adds two fields to your profile. Hope you guys like it and make use of it.. Thank away!
  20. Like
    gatesphere got a reaction from GeekDoc in HD44780-based LCD - cursor problem   
    Ah, gotcha. Good.
    Thanks for the thought, and ouch! Hope your mouth feels better soon!
    Looking at your code and the datasheet (60 pages, yeesh), you do have the right value being sent during initialization. One thing I might suggest is taking out the 595, just for now, to see if you can get it to work directly in 4-wire mode. Again, binary values help there. And since you'd be using P1 directly, you could just set P1OUT to whatever value you needed. One thing I noticed in the sheet and didn't quite find in your code (probably my bad, I'm terrible at reading other people's code) is that the datasheet said that you can simply shift the cursor beyond the 40th character to move it to the beginning of the second line (and any subsequent lines). Maybe something to try?
    Any time. And the same goes for you!
    EDIT: Also, interesting wait function. How accurate is it? It might be nice to include in MSPhere...
  • Create New...