Score from the MIT electronics swapfest

Discussion in 'Embedded Systems and Microcontrollers' started by DerStrom8, Sep 15, 2013.

  1. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Hi there everyone!

    This morning I walked over to MIT for their monthly electronics swapfest to see what gems I could find. They had a lot of nice equipment and components there, but I ended up buying only two items: A 6-foot DVI cable and a Texas Instruments MSP430 Launchpad, for a grand total of $8. I am kicking myself for not picking up a beautiful 6-digit frequency counter--the gentleman was selling it for $35, and I'm sure I could have talked him down to $25. I wish I'd bought it, it would have been a nice addition to my bench. I'm hoping it will be there next month (the last swapfest of the season), and I'll see about picking it up then.

    Anyway, the point of this thread is to discuss the Launchpad. Does anyone here have experience with it, and have any suggestions? I've never used one before, so I've only just learned about some of the software that can be used with it, its specs, etc. Are there any limitations I should be aware of? My first impression is that it's nice, but won't serve as a replacement for the Arduino. As I said though, I only just got it and have not used one in the past.

    Thanks everyone!
    Regards,
    Matt
     
  2. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,022
    MrChips has you covered. Here and many other threads on AAC.

    Have fun!
     
    DerStrom8 likes this.
  3. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Perfect! Thanks for the link!

    And thank you, MrChips for the documentation!
     
  4. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    @MrChips, if you're reading this--

    Do you know if there's an existing delays header file for the M430G2553? I know there are cycle delays, but I'm looking for a delay_ms or something like that. I can write a simple one (though inaccurate) and was considering creating my own personal delays.h, but I was hoping there's already one sitting around somewhere.

    Thanks,
    Matt
     
  5. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,675
    2,722
    As an alternative, you could practice writing code without any delays.
     
  6. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    I do, and have for years, but it's just a convenient thing to have sometimes.
     
  7. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Hi Matt,

    Nice score. As for the Launchpad... the __delay_cycles() instrincic function in the CCS compiler is truly "cycle accurate" so it's pretty valuable. Why not just create 'clock', 'usecs', and 'msecs' constants and use them? (Note: one usec = one cycle per MHz of the clock)

    Code ( (Unknown Language)):
    1.  
    2.  
    3.   #define clock 8             // 8-MHz DCO Clock
    4.   #define usecs clock         // cycles per usec operand multiplier
    5.   #define msecs clock*1000    // cycles per msec operand multiplier
    6.  
    7.   ~~~
    8.  
    9.     __delay_cycles(4*usecs)   // 4-usec delay
    10.     __delay_cycles(22*msecs)  // 22-msec delay
    11.  
    If that looks too sloppy, you could always create a couple macros.

    Good luck. Have fun.

    Cheerful regards, Mike
     
    Last edited: Sep 20, 2013
    killivolt likes this.
  8. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    If you prefer the Arduino style development environment, check out Energia.

    Here's a video of the 5-pin Charlieplexed version... For some reason, I can't post the sketch but you can find it in this post.
     
  9. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Hey Mike. I've been using functions that work like that, but I wasn't sure they were that accurate. I didn't think 1 clock cycle was actually 1 uS. If it is, that simplifies things significantly.

    Many thanks,
    Matt
     
  10. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Well, it's one cycle per MHz for each microsecond so it's one cycle per microsecond when using a one Megahertz clock, or two cycles per microsecond when using a two Megahertz clock, etc.
     
    DerStrom8 likes this.
  11. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Thanks Mike. I'd heard of Energia, and I have used Arduino before, but I find it too dumbed-down for my liking. I don't feel I have much control over what happens, so I got CodeComposer Studio for now. I'll probably try Energia at some point though.

    Regards,
    Matt
     
    killivolt likes this.
Loading...