cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure Two channel ADC Technique in STM32F413ZH Controller ?

RJANA.2
Associate III

If I vary any one channel Input through POT, it is reflecting in another ADC Channel also... can anyone help me regarding this ?

14 REPLIES 14
Georgy Moshkin
Senior II

If second channel is unconnected (floating), try to connect it to GND or to second POT. On some evaluation boards pins are connected to external ICs, and it may look like connecting two pins through a large valued resistor. Provide more details to get more help. Is it a custom board or some kit, how ADC is configured? Need some source code, IOC file, or screenshots of STM32CubeIDE ADC configuration.

Disappointed with crowdfunding projects? Make a lasting, meaningful impact as a Tech Sponsor instead: Visit TechSponsor.io to Start Your Journey!
RJANA.2
Associate III

0693W00000FCyigQAD.png

ADC_ChannelConfTypeDef sConfig = {0};

/** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. */

sConfig.Channel = ADC_CHANNEL_12;

HAL_ADC_Start(&hadc1);

HAL_ADC_PollForConversion(&hadc1, 10);

Pressure = HAL_ADC_GetValue(&hadc1);

HAL_ADC_Stop(&hadc1);

Code for reference @Georgy Moshkin​ 

Image is also attached below

I assume that

ADC_CHANNEL_15 - connected to POT

ADC_CHANNEL_12 - floating (not connected).

You need to connect ADC_CHANNEL_12 to some voltage potential, for example GND or VCC, probably through a resistor to ensure there is no short circuit if ADC accidentally configured as output.

I recall similar behavior. On some MCUs if you use multiple channels of single ADCs, then you can observe signal from adjacent ADC pin if other ADC pin is open (not connected to anything).

Disappointed with crowdfunding projects? Make a lasting, meaningful impact as a Tech Sponsor instead: Visit TechSponsor.io to Start Your Journey!

If I connect another channel to GND there is overflow current in Whole BOARD, So can you suggest another possibility @Georgy Moshkin​ 

As far as i know this should not happen on ADC inputs. What board do you use? Some boards have erroneous markings, ensure it is correct pin. Probably ADC is configured wrong, or something else is connected to this pin on PCB, or you used wrong pin.

Disappointed with crowdfunding projects? Make a lasting, meaningful impact as a Tech Sponsor instead: Visit TechSponsor.io to Start Your Journey!

This controller pins selection is little bit confusing, Even I tried with all possibilities given in data sheet..

There are two pins for single channel ony, Even tried but no positive response

for more infor refer below image ; STM32F413ZH Tx Nucleo

@Georgy Moshkin​ 0693W00000FCzUkQAL.png

Any_Suggestions_on_this?

Please check UM1974 manual Table 12. Solder bridges:

0693W00000FD5KvQAL.jpgFrom your image it seems that you use following pins for ADC:

PC2 ADC123_IN12

PC5 ADC1_IN15 - this pin connected to ethernet PHY using solder bridge SB181.

Solder bridge must be removed if you want to use this pin as ADC input on PC5. Note other solder bridges too.

Disappointed with crowdfunding projects? Make a lasting, meaningful impact as a Tech Sponsor instead: Visit TechSponsor.io to Start Your Journey!