cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-Channel ADC Read Example

Justin1
Senior

I am trying to perform a multi-channel ADC read from the Nucleo-F091RC board and having difficulties, see attached for my efforts. I observe floating read values for all channels, see attached for description & example -

Attached Debug Info:

  • 'main.c' - main routine from project
  • 'TestKit_ADCDebug - project.zip' - the project
  • 'demo generation notes.txt' - detailed debug description
  • 'Debug Read Example.png' - example debug result

How can I make this successful? What is the issue here?

6 REPLIES 6
S.Ma
Principal

When installing STM32F0 cube libraries, you'll find projets examples for F0 and one folder shall be ADC.

Get started or windiff your project with closest matching example.

If the ADC input pins are not connected to anything, try to connect it to GND or VDD and see if the values are changing from min to max (0x000 to 0xFFF if 12 bit right shifted ADC)

Currently some examples are not generated from CubeMX (they don't have *.ioc project file in the sample folder). If the example works in debug mode, take a snapshot of the ADC and DMA register settings if you'd like to move to MX later.

Justin1
Senior

Hi Kic-Epic,

 Thank you for your thoughts, I think this is a good approach. I have opened the 'ADC_Sequencer' example, how can I apply an analog voltage to 'ADCx_CHANNELa' and observe the measured result? I have disabled "WAVEFORM_VOLTAGE_GENERATION_FOR_TEST" and am currently observing floating values

Firmware Config:

  • ADC_Sequencer (STM32Cube_FW_F0_V1.9.0)
  • Disabled 'WAVEFORM_VOLTAGE_GENERATION_FOR_TEST' (main.h:55)

Hardware Config:

  • NUCLEO-F091RC (STM32F091RC)
  • Analog Voltage applied to CN7.32 (1.5V, PA4)

Result:

  • Voltage application not working, appears the Nucleo is driving pin to 0.0V

I have tried a multitude of other things and done much research, what is up here, how can I apply a voltage and measure the result? Why is this so hard?

Thanks,

 Justin

Justin1
Senior

I have created a new reference project following all provided instruction and reference, see below -

This works fine for one channel but not multiple. I think we are close here, see readme.txt or the reflog for more detail.

Question:

  • How can I get this new, simple reference demo to do multiple channels?
Justin1
Senior

Hi,

 We have tried unsuccessfully to get your ADC Sequencer in operation, trying multiple different approaches and ideas. Much effort has been invested here and was not expected, can you please point us to a working example for successful multi-channel ADC reads?

The existing CubeMX_F0 example, 'ADC_Sequencer' (v1.9.0), does not work when extended to multiple external ADC IO channels. This was not expected, where can we find a working reference?

 Our team has upcoming deliverable dates and this is required for completion, please let us know how to move forward successfully to getting the ADC Sequencer in operation.

Justin1
Senior

We have achieved successful results now, will post reference example when available

Justin1
Senior

Here is our working example - STM32_ADCRef(#FF11)