Hi ,
I am newbie in programming microcontroller. I am writing a code on msp430F2274 to implement a command so that when typed the temperature is measured and displayed using uart to putty.
I am trying to transmit the lower and upper bytes separately within the interrupt routine, below. Is there anything I missed in here.
I can display input characters from the keyboard, for example the command.
My whole code works and actually i used the LED as a check (the lines P1DIR |= 0x01; P1OUT |= BIT0; ) that the ADC10_ISR is actually called.
But no output is displayed, in fact IAR exits running the code.
thanks in advance,
/**
* ADC interrupt routine. Pulls CPU out of sleep mode for the main loop.
**/
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR (void)
{
ADCValue = ADC10MEM;
P1DIR |= 0x01; // LED check
P1OUT |= BIT0;
ADCValue1 = (ADCValue & 0x00FF); // lsb
ADCValue2 = (ADCValue & 0xFF00) >> 8; // msb
while (!(IFG2&UCA0TXIFG));
UCA0TXBUF = ADCValue2 << 1;
while (!(IFG2&UCA0TXIFG));
UCA0TXBUF = ADCValue1;
__bic_SR_register_on_exit(CPUOFF); // Enable CPU so the main while loop continues
}