2014-01-22 09:12 PM
2014-01-23 12:02 AM
> DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word; //DMA_PeripheralDataSize_Word;
> DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Word; //DMA_MemoryDataSize_word This is oveflowing the buffer, as its elements are uint16_t. JW2014-01-24 01:39 AM
2014-01-24 01:59 AM
> Thanks for reply.but I have a doubt ADC_CDR is a 32 bit and I have configured as
> DMA_Mode_2 , What is DMA_Mode_2? >which will make available ADC_CDR[0 to 15] ADC1 converted value and the ADC_CDR[16 to 31] ADC2 converted value. Okay, then either make the buffer use 32-bit values __IO uint32_t ADCDualConvertedValues[BUFFERSIZE]; or leave the buffer as it is and make the DMA transfer half the number of items DMA_InitStructure.DMA_BufferSize = BUFFERSIZE/2;> moreover I have also tried with half word but after debegging I am seeing value like
> ADCDualConvertedValues[0] 3012 Suppose to be ADC1 converted value, > ADCDualConvertedValues[1] 3220 Suppose to be ADC2 converted value, No, if you set the peripheral size in DMA controller to 16-bit, it will always read the lower part of ADC_CDR register, i.e. always the ADC1 converted value. JW2014-01-24 02:20 AM
2014-01-24 02:33 AM
> So how should I configure so that both the channels should be read at same time interval without overflowing.
As I wrote above: Okay, then either make the buffer use 32-bit values __IO uint32_t ADCDualConvertedValues[BUFFERSIZE]; or leave the buffer as it is and make the DMA transfer half the number of items DMA_InitStructure.DMA_BufferSize = BUFFERSIZE/2; JW PS. Don't post below the line, it hides your message as if it was a quote.2014-01-24 02:49 AM
2014-01-24 02:55 AM
2014-01-24 03:17 AM
> One more thing do you think that iir filter operation will complete till my next half buffer is full
This is something you want to determine yourself. See e.g. Clive's post in https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FDuration%20of%20FLOAT%20operations&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=3544 JW2014-01-24 03:25 AM
ok.Thanks a lot.