cancel
Showing results for 
Search instead for 
Did you mean: 

ADC with Dual Regular simultaneous mode on STM32CubeF4

suppakit
Associate II
Posted on September 09, 2014 at 11:52

I implemented the ADC with Dual Regular simultaneous mode on the STM32CubeF4 library. I have problem on the initialization, seem it does not correctly. I tried to read Vref on the ADC1 and the ADC value on the ADC3 (Channel 9 and 14).

Can anyone help me about this?  May be give me the example about that.

Thank you very much.

PS. I implement them on STM32F437II.
6 REPLIES 6
raptorhal2
Lead
Posted on September 09, 2014 at 22:04

Dual regular simultaneous mode is available only for ADC 1 and ADC 2. See Section 13.9.2 in the Reference Manual.

Cheers, Hal

suppakit
Associate II
Posted on September 10, 2014 at 07:11

Hi Hal,

Thank you very much for answer me.

So, Do we have any way to read Vref on the ADC1 and the ADC value on the ADC3 (Channel 9 and 14)? 

I need to use the Vref to calculate an accurate ADC.

Posted on September 10, 2014 at 14:28

Wouldn't VRef be 0xFFF whatever voltage is was?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
suppakit
Associate II
Posted on September 10, 2014 at 17:29

Vref is mean the internal voltage reference. Sorry to make you confuse.

Posted on September 10, 2014 at 17:54

VREFINT is available on ADC1_IN17

Dual mode would use ADC1 and ADC2

You're going to have to use ADC3 in scan mode to read your two channels. You can use ADC1 to measure the VREFINT point, and apply that to ADC2 and ADC3 values, as they share the same design and silicon process (ie assume identical performance)
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 11, 2014 at 13:58

HiK. Suppakit,

Previous comment is correct, but even if you cannot do simultaneous conversion with ADC1-ADC3 hardware link, you can still use them in parallel.

Please find attached an example running on STM32F4 Discovery board:

  • ADC1 and ADC3 work in single mode
  • ADC1 and ADC3 share the same trigger (Timer TRGO)

    this is equivalent to pseudo multimode simultaneous
  • ADC1 and ADC3 have their results transferred automatically by DMA

At each trigger event: ADC1 converts Vrefint, ADC3 converts channel 10 then channel 11

LED on board is turned on when the ADC conversion sequence is completed

Note: ADC trigger settings: This example allows selecting ADC trigger by timer or by software:

  • default setting: ADC trigger by timer: setting defined by constant ''ADC_TRIG_TIMER''. Both ADC are triggered by TIM2 (frequency 1Hz by default, can be changed with constant ''TIMER_FREQUENCY_HZ'')
  • alternate setting: ADC trigger by software setting defined by constant ''ADC_TRIG_SW''.
From your configuration, we have replaced ADC3 channels 9 (pin PF3) and 14 (pin PF4) by ADC3 channels 10 (pin PC0) and 11 (pin PC1) to have these pins available on STM32F4 Discovery board.

Regards.

________________

Attachments :

Example_ADC1_ADC3_several_channels_STM32F4-Discovery.7z : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1M0&d=%2Fa%2F0X0000000bln%2F1JdEfl6HYjRE6_aiAYEDzCruuE8ZESXy9h10CoG4ZFM&asPdf=false