AnsweredAssumed Answered

STM32F407VG: ADC+DMA+USART

Question asked by Engineering Student91 on Nov 27, 2017
Latest reply on Nov 28, 2017 by T J

Dear all,

 

I am trying to acquire analog signal and sample it through ADC (12 bit) at a rate of 8KHz and stream the data through USART.

 

 /* USARTx configured as follows:
  - BaudRate = 921600 baud
  - Word Length = 8 Bits
  - One Stop Bit
  - No parity
  - Hardware flow control disabled (RTS and CTS signals)
  - Receive and transmit enabled
 */
 USART_InitStructure.USART_BaudRate = 921600;
 USART_InitStructure.USART_WordLength = USART_WordLength_8b;
 USART_InitStructure.USART_StopBits = USART_StopBits_1;
 USART_InitStructure.USART_Parity = USART_Parity_No;
 USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
 USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
 /* USART initialization */
 USART_Init(USART2, &USART_InitStructure);
 /* Enable USART */
 USART_Cmd(USART2, ENABLE);
I have tried increasing the BaudRate to the maximum possible value, yet, I miss the samples at such a high sampling rate.
How do I fix this? Kindly give me some suggestions.
Thanks.

Outcomes