Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MSP430F1611 interrupt problem

Status
Not open for further replies.

Beenaplaye

Member level 2
Joined
Aug 23, 2009
Messages
49
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Belgium
Activity points
1,577
Hi guys,


My program doesnt go in the interrupt routine from TimerB or TimerA.

Code:
int main( void )
{
  // Stop watchdog timer to prevent time out reset
  WDTCTL = WDTPW + WDTHOLD;
  DCOCTL = 7;
  BCSCTL1 &= 0x7F;
  // set clock on 8.000Mhz clock and put it on MCLK and SMCLK
    do 
    {
      unsigned char i = 0xFF;
      IFG1 &= ~OFIFG;                     // Clear OSCFault flag
      for (; i > 0; i--);         // Time for flag to set
    }
    while ((IFG1 & OFIFG) == OFIFG);      // OSCFault flag still set?                
    BCSCTL2 |= 0x8A;                      // MCLK = XT2 (safe) SMCLK = XT2/2 
  
	
        P4SEL |= 0x40;         
        P4DIR |= 0x40;
         
         TBCCR0 = 200;               // geeft een periode van 5khz bij 8 Mhz clock
         TBCCR6 = 100;               // genereerd negatieve spanning voor scherm
         TBCCR1 = 20;
         TBCCTL0 = 0;             // enable timer interrupt CCIFG0
         TBCCTL1 = CCIE;             // enable timer interrupt CCIFG0
         TBCCTL6 = 0x00C0;           // mode 6 pwm op uitgang TB6
         TBCTL = 0x02D6;            // start timer 
         
         
         TACCTL0 = 0;
         TACCR0 = 200;
         TACTL = 0x02D6;            // start timer
   
      
  
  //return 0;
}

#pragma vector=TIMERB0_VECTOR
__interrupt void Timer_B0_ISR(void)
{
	P2OUT ^= 0x01;

}

#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A0_ISR(void)
{
       P2OUT ^= 0x01;
}

TBR and TAR is counting. The correct flags are set. I realy dont have a clue what's wrong.
 

Hi

Compeer your software to routine given by TI for MSP430f1xxx

Or even first run TI routine to check whether your hardware function OK

All the best

Bobi

The microcontroller specialist
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top