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.
Tool/software: Code Composer Studio
sir this is program part of temperature measurement
int long temp;
int long IntDegF;
int long IntDegC;
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
ADC12CTL0 = SHT0_8 + REFON + ADC12ON;
ADC12CTL1 = SHP; // enable sample timer
ADC12MCTL0 = SREF_1 + INCH_10;
ADC12IE = 0x001;
ADC12CTL0 |= ENC;
while(1)
{
ADC12CTL0 |= ADC12SC; // Sampling and conversion start
__bis_SR_register(CPUOFF + GIE); // LPM0 with interrupts enabled
// oF = ((x/4096)*1500mV)-923mV)*1/1.97mV = x*761/4096 - 468
// IntDegF = (ADC12MEM0 - 2519)* 761/4096
IntDegF = (temp - 2519) * 761;
IntDegF = IntDegF / 4096;
// oC = ((x/4096)*1500mV)-986mV)*1/3.55mV = x*423/4096 - 278
// IntDegC = (ADC12MEM0 - 2692)* 423/4096
IntDegC = (temp - 2692) * 423;
IntDegC = IntDegC / 4096;
__no_operation(); // << SET BREAKPOINT HERE
}
}
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=ADC12_VECTOR
__interrupt void ADC12ISR (void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(ADC12_VECTOR))) ADC12ISR (void)
#else
#error Compiler not supported!
#endif
{
temp = ADC12MEM0; // Move results, IFG is cleared
__bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
}
in this program i dont know how to check the result of temperature can you guide me.
and i want to know that INTDegC,INTDegF,where storage take place
**Attention** This is a public forum