Posted on May 07, 2015 at 19:19
I am using 2 ADCs with DMA in simultaneous mode and sending data over usb. Here is the code:
#include ''main.h''
const uint16_t BUFFER_SIZE = 400;
volatile uint16_t ADCConvertedValues [BUFFER_SIZE];
volatil...
Posted on May 07, 2015 at 22:04I think I found the problem - I was using a blocking function usb_vcp_getc() in the main loop. Enabling an interrupt and processing data received from usb inside the interrupt seems to have solved the issue.
Posted on May 07, 2015 at 20:03
Thanks, Clive. I enabled the interrupt when DMA transfer is complete:
static
void
NVIC_Config() {
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_InitStructure.NVIC_IRQChannel = DMA2_Stream0_IRQn;
NVIC_Init...
Posted on May 04, 2015 at 02:19
DMA_InitStructure.DMA_BufferSize =
sizeof
(ADCBuffer);
//buffersize
It should be
sizeof(ADCBuffer) / sizeof(ADCBuffer[0])