cancel
Showing results for 
Search instead for 
Did you mean: 

ADC + UART

officialkesh
Associate III
Posted on November 25, 2013 at 10:53

Hello everyone ,

 I have connected my ADC source  in STM32F4 - Discovery Board at PC2  pin. I want to  transfer this through UART to PC. I have configured PA9 and PA10 as USART1 TX and RX pin . But I am getting nothing at PC terminal .What could be the problem ?

int main(void)

{

 

  ADC3_CH12_DMA_Config();

  /* Start ADC3 Software Conversion */ 

  ADC_SoftwareStartConv(ADC3);

  init_usart1();

  /* convert the ADC value (from 0 to 0xFFF) to a voltage value (from 0V to 3.3V)*/

        ADC3ConvertedVoltage = ADC3ConvertedValue *3300/0xFFF;

SendAsciiDataToPC(ADC3ConvertedVoltage); 

UartSendData('\n');

    

  }

}

#adc #uart #discovery-board
1 REPLY 1
Posted on November 25, 2013 at 14:01

Apart from being hopelessly incomplete expression of the code, the biggest problem will be that PA9 is not a viable pin for the USART on the STM32F4-Discovery board.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..