Hii I am working on MSP430F5438.
I am trying to take input from MIC and collecting ADC12MEM0 output in a 16 bit unsigned int continously ,and send it on UART.
on UART i got output only dots(.), am not getting where i made mistake in coding.
#define AUDIO_PORT_OUT P6OUT
#define AUDIO_PORT_DIR P6DIR
#define AUDIO_PORT_SEL P6SEL
#define MIC_INPUT_PIN BIT5
#define MIC_PWD_PIN BIT4
#define SAM_HLD_TM ADC12SHT0_5
#define ADC_ON ADC12ON
#define ADC_REF_ON ADC12REFON
#define ADC_REF_VOLT ADC12REF2_5V
#define MULTI_SAM_MODE ADC12MSC
#define CONV_MODE ADC12CONSEQ_2
#define CLK_SRC_SMCLK ADC12SSEL_3
#define CLK_DIV ADC12DIV_5
#define SHP ADC12SHP
#define SMP_HLD_SRC ADC12SHS_0
#define START_ADD ADC12CSTARTADD_0
#define AUDIO_CH_5 ADC12INCH_5
#define REF_VOLT ADC12SREF_1
#define ENB_CONV ADC12ENC
#define START_CONV ADC12SC
void adc_init()
{
halLcdClearScreen();
AUDIO_PORT_OUT |= MIC_INPUT_PIN; //P6.5 OUTPUT HIGH
AUDIO_PORT_DIR &= ~MIC_PWD_PIN; //SET MIC PWD INPUT DIRECTION
AUDIO_PORT_SEL |= MIC_INPUT_PIN; //SELECT PREIPHERAL SIGNSL TO PIN
ADC12CTL0 |= SAM_HLD_TM + ADC_ON + MULTI_SAM_MODE ; //Tsample = 16 clock cycle in sampling period :64MICROSECOND
//ADC CORE ENABLE
ADC12CTL0 |= ADC_REF_ON + ADC_REF_VOLT + ADC12OVIE; //Refrence generator voltage : 2.5V
ADC12CTL1 |= CONV_MODE + CLK_SRC_SMCLK + CLK_DIV + SMP_HLD_SRC + SHP; // Repeated single channel conversion mode
//smclk -clock source
//Clock divider : /5
// sample and hold time source select - adc
//sample-and-hold pulse-mode select - SAMPLING TIMER
ADC12CTL2 = ADC12RES_0; // Select 8-bit resolution
ADC12MCTL0|= AUDIO_CH_5 + IN_REF_VOLT ; // A5 Channel Selected
ADC12IE = 0X01;
ADC12CTL0 |= ENB_CONV + START_CONV ;
}//end of adc main
void adc_conversion()
{
if(adc_flag)
{
adc_mem_audio = ADC12MEM0;
audio_receive_buf[0] = adc_mem_audio >> 8;
audio_receive_buf[1] = adc_mem_audio & 0X00FF;
audio_receive_buf[2] = '\0';
halUsbSendString(audio_receive_buf,3);
adc_flag = 0;
}
}
pls tell me what i have to change in it..