2018-03-02 03:26 AM
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-configuration2018-03-02 04:50 AM
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.
2018-03-02 05:56 AM
,
,
I might have posted other examples, but we're digging back a while
,2018-03-21 04:13 PM
Thanks a lot, Clive. It was helpful. Thank you for the examples.
Regards.