Let's Make Robots!

Default Clock speed for MSP430G2231 supplied with LaunchPad

Does anybody know what the exact clock speed for the MSP430G2231 on the TI LaunchPad is? And is there any delay-function or header to use with CSSv4? 

 

 The user guide for the LaunchPad is not helpful at all at least in this respect, neither is the MSP430G2231's datasheet.

 

Torrentula

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Default clockspeed is 1mhz +/- some hz...and temp induced divations. 

If you want a delay, use a timer and interupt. There are quite a few sample sources that you can find on the TI site for this.

If you want a really good intro into using this proc, I highly recommend checking out this site and also this one. 

thanks voodoobot!

Just wondering about the delay because at least avr-gcc gives you a prebuilt function.

 

Thank you!

Torrentula

This is what I use(__delay_cycles(ms)) and in this example it's wrapped in a function. I didn't write this but I had found it useful. I try to use timer related functions and if I can't use the timer, I use the watchdog interval timer as a type of timer....My current project uses the timer for a SoftwareSerial and as mentioned above, the watchdog interval timer is used for a delay in writing to a memory chip.

Hope this helps!

void delay(unsigned int ms)
{
 while (ms--)
    {
        __delay_cycles(1000); // set for 16Mhz change it to 1000 for 1 Mhz
    }
}

Sorry for asking a noob question:

How can I flash the MSP430 on the LaunchPad permanently so I doesn't have to be connected to the debugging software?

When you stop the debug session, CCS removes the breakpoints and debugging commands. At that point you should be able to run the device without it being in debug mode. If you don't stop the debug session and just disconnect it, the device will still be in the debug state and will most ikely not work as expected. At least this has been my expirence. So I recommend these steps.

  1. load program via debug.
  2. make sure program works
  3. stop debug session
  4. Once stopped, disconnect device and re plug in....that should do it.