Jump to content
43oh

Timer works only with CCS debugger


Recommended Posts

Hi,

 

I have a very simple program,

which writes a message to oled,

and then start "Timer A" to blink the internal led.

 

The program looks to work fine when I execute it from CCS using "Debug".

(Code Composer Studio, Version: 6.1.1.00022)

 

But when I just connect it to USB for power,

or hit the "reset" button,

the program executes the code before the timer,

but the timer interrupt is not working.

 

The code for timer was taken from here (2nd example: "Using the Timer")

http://www.crash-bang.com/getting-started-msp430-timers-3/

 

I suspect it is something with the settings of timer, not with CCS,

but I dont know what can cause this problem.

 

Thanks for any help.

Link to post
Share on other sites

@@tripwire

 

I'm using MSP-EXP430G2, G2553

 

From main, this is the code which looks relevant to me:

 

 

// init for oled

    WDTCTL = WDTPW | WDTHOLD;                // Stop watchdog timer
    DCOCTL = CALDCO_16MHZ;                  // Set DCO for 16MHz using
    BCSCTL1 = CALBC1_16MHZ;                 // calibration registers

 

// init for timer

    TACCTL0 |= CCIE; //Enable Interrupts on Timer
    TACCR0 = delayCycles; //Number of cycles in the timer
    TACTL |= TASSEL_1; //Use ACLK as source for timer
    TACTL |= MC_1; //Use UP mode timer

 

// loop

    while (1)
    {
        _bis_SR_register(LPM3_bits + GIE); //Enter Low Power Mode 3 with interrupts
    }

Link to post
Share on other sites
 

A question regarding soldering the crystal:

 

It looks my soldering skills need to be improved...

I failed to solder the crystal, and now I need to buy a new one.  :(

 

The crystal which came in the kit is this one:


 

And according to "how to solder" - "MSP 430 launchpad soldering Crystal" 

tutorial in YouTube


 

There are 3 points to solder: the 2 legs and the body.

 

My local supplies store has this one in stock:


 

But this one seem to have only 2 legs, and the body is in "barrel" shape,

which doesnt look like intended to be soldered to the board.

 

So my question is:

Can the crystal from the sparkfun website can be used instead ?

Do I need to solder the "barrel"/body ?

 

Thanks for your help.

 


 
Link to post
Share on other sites
So my question is:
Can the crystal from the sparkfun website can be used instead ?
Do I need to solder the "barrel"/body ?

 

It looks like the sparkfun crystal is slightly bigger than the stock launchpad one. It's also a through-hole part rather than SMT. I think it would be possible to push the leads through the plated through-holes on either side of the pads used by the stock SMT crystal. Then you could solder the two wires from the back of the board, which might be easier than surface mounting.

 

The body connection can probably be made with the sparkfun crystal even though it doesn't have a flat underside. Having said that, the body connection is not essential. It grounds the case, which helps to shield against any interference. It should still work just fine without it, and it's better to leave it unconnected than to overheat the crystal if you're finding it awkward to solder.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...