Help on ADC channels

Hi,
I use a MCBSTM32E evaluation board, which is composed of an STM32F103ZET6 MCU, and I loaded the measure example provided by Keil. It works perfectly, but I want to add another variable resistor on PC13 which is the channel 13 of ADC1. The onboard variable resistor is connected to channel 14.
Thus I configured the ADC to work with two channels (13 & 14), the DMA to have a buffersize of 2 and created an int ADC_ConvertedValue2 that should contain the second conversion result. I configured the channels like underneath : ADC_RegularChannelConfig(ADC1, ADC_Channel_14, 1, ADC_SampleTime_55Cycles5); ADC_RegularChannelConfig(ADC1, ADC_Channel_13, 2, ADC_SampleTime_55Cycles5);

My result is that each conversion result is store on the same variable (ADC_ConvertedValue) and the second one has nothing. I dont know how to get the value of the second conversion in the EOC interruption routine. Can I still use this interruption and do i have to use a DMA one ? I'm a bit confused about how ADC channels really works and neither the datasheet nor the FWLib helped me.
Thanks in advance for any hint.
Gary

Parents
  • I don't know your specific processor, but I would guess that your DMA module have a flag that you need to set to activate the destination increment, i.e. that it steps forward the destination address for each transfer.

    The DMA unit normally needs one flag for source increment and one for destination increment, to handle the cases for the source/destination is meory (should increment) or is the data register of an I/O device (should not increment).

Reply
  • I don't know your specific processor, but I would guess that your DMA module have a flag that you need to set to activate the destination increment, i.e. that it steps forward the destination address for each transfer.

    The DMA unit normally needs one flag for source increment and one for destination increment, to handle the cases for the source/destination is meory (should increment) or is the data register of an I/O device (should not increment).

Children
More questions in this forum