Hi,
I am trying to get familiar with the MSP430 and I wanted to generate
periodic interrupts using timer_A in simulator mode of IAR Embedded Workbrnch. 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 code I am using is:
#include <msp430x20x3.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1DIR |= 0x01; // P1.0 output
CCTL0 = CCIE; // CCR0 interrupt enabled
CCR0 = 50000;
TACTL = TASSEL_2 + MC_2; // SMCLK, contmode
_BIS_SR(GIE); // Enter LPM0 w/ interrupt
for(;;);
}
// Timer A0 interrupt service routine
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
P1OUT ^= 0x01; // Toggle P1.0
CCR0 += 50000; // Add Offset to CCR0
}
and I expect to see timer_A (TAR register) incrementing
Can someone please tell me what am I doing wrong?
Is it possible to simulate Timer in IAR Embedded Workbench?
Thank you,