cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F207 sample 1 ch ADC

Barbie
Associate II
Posted on December 24, 2012 at 12:41

Can I sample dedicate 1 channel without the need to put it in the scan list as the first and write Number of ch to scan 1?

As I see it it is impossible.

Regards

bar.

#stm32f207-adc-1-ch-sample
5 REPLIES 5
raptorhal2
Lead
Posted on December 24, 2012 at 17:51

Tough to answer without knowing what state the ADC peripheral registers are in before the sample. For the reset state, see 10.13.2 and 10.13.3 of the F2 Reference manual, then change what you need for the sample.

Cheers, Hal

Barbie
Associate II
Posted on December 25, 2012 at 14:02

Thanks Cheers.

The state before was scan at regular mode 8 ch. Then I need to sample a new channel (which wasn't at the scan) 1 time. As I see it now I need to write this new channel as the first one in the sequence reg. and write sample 1 ch. only. After that I need to set back the sequence reg for the previews condition (in scan mode )and write back the number of channels to scan. This is look a little bit over head. I look for a command that let me sample 1 ch. written imminently.  Is there any setup for that?

Regards

Bar.

zzdz2
Associate II
Posted on December 25, 2012 at 15:51

Can you use injected channel?

Barbie
Associate II
Posted on December 26, 2012 at 08:47

But even so . Some of the features are common to both (regulare and inject). Like Scan , Continues. SO even if I use teh inject channel I have so set the scan, cont and set back at the end.

Is there anther method just to make 1 setting for regulate with scan enable and 1 for inject no scan and each one trigger at its time without need to change setting every time I move between them?

Bar.

zzdz2
Associate II
Posted on December 26, 2012 at 11:51

I thought it works like you need but I haven't used it yet so I'm not sure.

Quote from ref. manual:

Triggered injection

To use triggered injection, the JAUTO bit must be cleared in the ADC_CR1 register.

1.   Start the conversion of a group of regular channels either by external trigger or by

     setting the SWSTART bit in the ADC_CR2 register.

2.   If an external injected trigger occurs or if the JSWSTART bit is set during the

     conversion of a regular group of channels, the current conversion is reset and the

     injected channel sequence switches to Scan-once mode.

3.   Then, the regular conversion of the regular group of channels is resumed from the last

     interrupted regular conversion.

     If a regular event occurs during an injected conversion, the injected conversion is not