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.

CCS/MSP430G2553: Audio input interpretation

Part Number: MSP430G2553


Tool/software: Code Composer Studio

Hi,

I am using a pre-amp microphone to detect different sound frequency using an MSP430.

I was able to get some values through the expression table by using a sound app that emits sounds at different frequencies.

However I am not sure how to interpret the values I see the expression table. I know it is not frequency since it showed almost the same value at different frequencies.

But even changing the volume did not change these values. So I'm guessing it is not representing amplitude either. So these are main questions

1) What does the values in the expression column represent? (in terms of the sound the microphone picks up- like amplitude, frequency)

2) Sometimes the values are highlighted by a yellow color. What does that mean?

I have attached a copy of the values I got for a constant sound of 1000Hz.

Also below is the code I used for this program.

#include <msp430.h>

int adc[10] = {0}; //sets up array of 10 integers with zeros


void init(void)
{
WDTCTL = WDTPW + WDTHOLD; //stop watchdog timer
ADC10CTL1 = CONSEQ_2 + INCH_0; //Repeat single channel, A0
ADC10CTL0 = ADC10SHT_2 + MSC + ADC10ON + ADC10IE; //Sample & Hold Time, ADC10 ON, Interrupt Enable (ADC10IE)
ADC10AE0 |= 0x01; //P1.0 ADC select
ADC10DTC1 = 0x0A; //0x0A = 10 conversions; DTC is Data Transfer Control it automatically transfers conversion results from ADC10MEM
}

#pragma vector=ADC10_VECTOR //ADC10 interrupt service routine
__interrupt void ADC10_ISR(void)
{
__bic_SR_register_on_exit(CPUOFF); //clear CPUOFF bit from 0
}

void adc_samp10(void)
{
ADC10CTL0 &= ~ENC; //Disable conversion
while (ADC10CTL1 & BUSY); //wait if ADC10 is busy
ADC10SA = (int)adc; //Transfers data to array DTC auto increments address
ADC10CTL0 |= ENC + ADC10SC; //Enable conversion and conversion start
__bis_SR_register(CPUOFF + GIE); //low power mode 0
}

void main(void)
{
init(); //run initilization block
while(1)
{
adc_samp10(); //runs the ADC block and stores values into array
}
//8bit_fft(); //run FFT function block

}