title: ADC on MSP430 stuck on either timer delay or cunable to take ADC unless I remove all timer and push button interrupt
body: <p>I have used MSP430 to write a custom blinking code with adjustable frequency. I use an ADC to adjust the frequency but I have been having issues with the ADC portion of the code being stuck while I use it with timer 0 interrupts and a Port 1 interrupt. But if I remove them from the program the ADDC works fine. Could anyone help me point out my error or help me understand the mechanism with which I could have the ADC running again? Attached below is a portion of my code:</p>
  <pre><code>float updatealphaFreq(){
  int af_update = 0;
      if(p_count&gt;0)
      {
          WDTCTL = WDTPW | WDTHOLD;   // stop watchdog timer
          BCSCTL1= CALBC1_1MHZ;
          DCOCTL = CALDCO_1MHZ;
  
          ADC12CTL0 = SHT0_2 + ADC12ON;             // Set sampling time, turn on ADC12
          ADC12CTL1 = SHP + SHS0;                          // Use sampling timer
          ADC12IE = 0x01;                           // Enable interrupt
          ADC12CTL0 |= ENC;                         // Conversion enabled
          P6DIR &amp;= ~0x01;                            // P6.0, i/p
          P6SEL |= 0x01;                            // P6.0-ADC option select
          P1DIR |= 0x01;                            // P1.0 output-LED
  
  
          //lcdInit();// Initialize LCD
  
  
  
          //lcdSetText(&quot;Select Frequency &quot;, 0, 0);
  
          //lcdClear();
          while(1){
          //__enable_interrupt();
          ADC12CTL0 |=  ADC12SC ;
  
          //delayMS(1000);
          //lcdSetText(&quot;Value of a_freq: &quot;, 0, 0);
          float i = 0;
          af_update = ADC12MEM0/100;
          i = af_update *0.325;
          //lcdSetInt(i*100, 0,1);
          //delay_ms(10000);
          //lcdSetText(&quot;                    &quot;, 0, 1);
          }
  
  
          ADC12CTL0 &amp;=~ENC;
          ADC12CTL0 &amp;=~(REFON + ADC12ON);
          ADC12CTL0 =0;
  
      }
      p_count = 0;
      while((P1IN &amp; BIT3)!=BIT3);
      return af_update;
   }
  
  #pragma vector=PORT1_VECTOR
  __interrupt void Port_1(void)
  {
     
  
  switch (P1IFG &amp; BUTTON) {
            case BUTTON:
          P1IFG = P1IFG &amp; ~BUTTON;
  
          // flip the LED output
          P1OUT ^= LED1;
          P1OUT ^= LED2;
          break;
      default:
          break;
  }
  
  return;
  }
  
  
  //Timer ISR
  #pragma vector = TIMER0_A0_VECTOR
  __interrupt void Timer_A_CCR0_ISR(void)
  {
  OFCount++; //Increment Over-Flow Counter
  }
  </code></pre>