Question
STM32F407VG: ADC+DMA+USART
Posted on November 27, 2017 at 17:47
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.
