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.

msp430f5529 temperature sensor

Dear sir,

i have written the code for temperature sensor for f5529lp,here is my code.but i am not getting output.

#include <msp430.h>

long temp;
long IntDegF;
long IntDegC;

int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
ADC12CTL1 = ADC12DIV_3; // Temp Sensor ADC10CLK/4
ADC12MCTL0 = ADC12SREF_1 + ADC12INCH_10;
ADC12CTL0 = ADC12IE+ ADC12SHT02 + ADC12ON;
__enable_interrupt(); // Enable interrupts.
TA0CCR0 = 30; // Delay to allow Ref to settle
TA0CCTL0 |= CCIE; // Compare-mode interrupt.
TA0CTL = TASSEL_2 | MC_1; // TACLK = SMCLK, Up mode.
LPM0; // Wait for delay.
TA0CCTL0 &= ~CCIE; // Disable timer Interrupt
__disable_interrupt();

while(1)
{
ADC12CTL0 |=ADC12ENC+ADC12SC; // Sampling and conversion start
__bis_SR_register(CPUOFF + GIE); // LPM0 with interrupts enabled


// oC = ((A10/1024)*1500mV)-986mV)*1/3.55mV = A10*423/1024 - 278
temp = ADC12MEM;
IntDegC = ((temp - 673) * 423) / 1024;

__no_operation(); // SET BREAKPOINT HERE
}
}

// ADC10 interrupt service routine

#pragma vector=ADC12_VECTOR
__interrupt void ADC12_ISR (void)

{
__bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
}


#pragma vector=TIMER0_A0_VECTOR
__interrupt void ta0_isr(void)

{
TA0CTL = 0;
LPM0_EXIT; // Exit LPM0 on return
}

 

**Attention** This is a public forum