I am using MSP430F427 which has 3 channels of 16 bit sigma delta ADC.
A sample application software from TI shows how to use this SD16 with an ISR.
I compiled the software source using CCS version 4, and downloaded it to the target board with LCD display.
The target board ADC output is displaced on the LCD. The ADC results seem like a random noise - it is changing continuously and very widely.
I monitored the output parameter "CurrentResult" that is a "long" type variable. It does not seem right.
For your information, I copy and paste the TI sample code as follows:
#pragma vector = SD16_VECTOR
__interrupt void SD16_ISR(void)
{
long CurrentResult;
GET_RESULT(CurrentResult); // Read SD16 result, clear IFG
if (VoltageSettleCtr) // Wait for voltages to settle
{
VoltageSettleCtr--; // Decrement counter
return; // Exit ISR
}
SD16Temp += CurrentResult; // Sum up results
if (++SD16TempCtr >= 256)
{
SD16Result = SD16Temp >> 8; // Div 256
SD16CCTL0 &= ~SD16SC; // Disable conversions
P2OUT &= ~BRIDGE_SUPPLY; // Power down bridge voltage
if (ProgramMode == PM_MEASURE)
if (Flags & FLAG_UPDATE_DISPL || LastADCValue != SD16Result)
{
Flags &= ~FLAG_UPDATE_DISPL; // Reset flag
LastADCValue = SD16Result; // Store new value
Disp_Signed_Long(((long)SD16Result - CalMin) * CAL_MIN_MAX_SPAN /
(CalMax - CalMin));
}
__bis_SR_register_on_exit(LPM3_bits); // Enter LPM3 on ISR exit
}
}
Can you give me some suggestions how to setup and debug the SD16 ISR using CCS V4?