cancel
Showing results for 
Search instead for 
Did you mean: 

ADC Configuration modes for stm32F103 mcu (stm32f10x SPL)

Posted on March 02, 2018 at 12:26

Hi, 

it's my first time configuring and working with st adc peripheral. I'm using SPL libraries. 

Reading examples and datasheet there is some words and concepts that I've missunderstood.

In ex: 

If I want to use until 6 adc channels from de same adc and using scan mode. After setting the init structure I can see that this function is often used for every channel configuration: 

void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime);

If I go to the header function into the spl lib you can find that Rank is:

'The rank in the regular group sequencer. This parameter must be between 1 to 16.'

I was though that it must be the ordering value into the sequence associated with that channel. But I think that probably I'm wrong.

Could somebody answer which is exactly the meaning of rank arg?

Thanks in advance.

#multichannel-adc #rank #stm32f10x-spl #regular-scan-mode #stm32f103 #adc-configuration
3 REPLIES 3
Posted on March 02, 2018 at 13:50

Yes, the Rank is an order in the scan sequence. You could get the same ADC channel in your list more than once.

The ADC should scan via DMA into an array. You should do the ADC calibration prior to enabling DMA.

Use DMA in circular mode, managing a ping-pong buffer via HT and TC DMA interrupts.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on March 02, 2018 at 13:56

 ,

 ,

I might have posted other examples, but we're digging back a while

 ,
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on March 22, 2018 at 00:13

Thanks a lot, Clive. It was helpful. Thank you for the examples.

Regards.