This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Timer Simulation

Other Parts Discussed in Thread: MSP430F2013

Hi,

I am trying to get familiar with the MSP430 and I wanted to generate
periodic interrupts using timer_A. The problem is that timer_A
doesn't advance, no matter what I do.

I am using IAR Embedded Workbench and I run simulation using C-Spy.
The processor is MSP430F2013. The init sequence I am using is:

void main(void)
{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
  TACTL = TASSEL_2 + MC_2;                  // SMCLK, contmode
  while(1);
}

and I expect to see timer_A (TAR register) incrementing

Can someone please tell me what am I doing wrong?

Thank you,
Aju

  • Aju,

     

    It looks like you are missing 2 main components: the definition of the ISR and the setting of the GIE (general interrupt enable) bit. Please refer to a timer example at the following link, which you can model your code after to cut down on development time: www.ti.com/msp430codeexamples.

**Attention** This is a public forum