About the difficulty of the ad, I really do not understand the first to save it

Source: Internet
Author: User

Http://www.netfoucs.com/article/laoniu_c/84282.html

1.stm32 ad conversions, you can organize conversion tasks into two groups: Rule groups and injection groups. A series of transformations in any order on any number of channels constitutes a group conversion. For example, the conversion can be completed in the following order: Channel 3, Channel 8, Channel 2, Channel 2, Channel 0, Channel 2, Channel 2, channel 15. When you perform a rule Channel Group Scan transformation, you can enable the conversion of the injected channel group if there is exception handling. It is possible to blur the conversion of an injected group into an ad-converted interrupt, where the conversion of the rule Channel Group is normal, whereas the conversion of the injected group breaks the conversion of the rule group when the conversion condition of the injected group is met. If the rule transformation is already running, in order to ensure synchronization after the injection conversion, all ADC (primary and slave) rule transitions are stopped and synchronized at the end of the injection conversion. There are external triggering options for both rule and injection transformations, and DMA requests are generated during the rule channel conversion, while the injection conversion has no DMA request and requires the data to be saved in a query or interrupt mode.


2. Rule group: This mode is activated by setting the Discen bit on the ADC_CR1 register. It can be used to perform a short sequence of n-Times conversions (N<=8), which is part of the conversion sequence selected by the ADC_SQRX register. The value n is given by the discnum[2:0] bit of the ADC_CR1 register. An external trigger signal can start the next round of n conversions described in the ADC_SQRX register until all transitions in this sequence are complete. The total sequence length is defined by the ADC_SQR1 Register's l[3:0]. Example: n=3, converted Channel = 0, 1, 2, 3, 6, 7, 9, 10 The first trigger: the sequence of conversions is 0, 1, 2 the second trigger: the sequence of conversions is 3, 6, 7 The third trigger: the sequence of conversions is 9, 10, and the EOC event is triggered the fourth time: sequence 0, 1, 2, and so on ;
Injection group: This mode is activated by setting the Jdiscen bit of the ADC_CR1 register. After an external trigger event, the mode converts the sequence selected in the ADC_JSQR register, one at a time, in the order of the channels. An external trigger signal can initiate the conversion of the next channel sequence selected by the ADC_JSQR register until all transitions in the sequence are complete. The total sequence length is defined by the jl[1:0] bit of the ADC_JSQR register. Example: n=1, converted Channel = 1, 2, 3 first trigger: Channel 1 is converted second trigger: Channel 2 is converted to the third trigger: Channel 3 is converted, and the EOC and JEOC events are generated for the fourth time: Channel 1 is converted, and so on.

Operating mode of the 3.stm32 ADC:
One-time conversion mode: Once the conversion is stopped;
Continuous conversion Mode: Once the conversion is completed, the next conversion begins;
Scan mode: Scan a set of analog channels;
Break mode: Every time a trigger is fired, n channels in the sequence are converted.


4. Because the values of the regular channel conversions are stored in a single data register, DMA is required when converting multiple rule channels, which avoids losing data that is already stored in the ADC_DR register. The DMA request is generated only at the end of the conversion of the rule channel, and the transformed data is transferred from the ADC_DR register to the user-specified destination address.
Note: Only ADC1 and ADC3 have DMA capabilities. The data converted by ADC2 can be transmitted using the DMA function of the ADC1 via the dual ADC mode.


5. Dual ADC mode
(1) Synchronous injection mode: This mode converts an injection channel group. The externally triggered injection group multi-switch (jextsel[2:0 by the ADC1_CR2 register) from the ADC1, which also provides synchronous triggering for ADC2.
Note that the:  do not convert the same channel on 2 ADCs (two ADCs do not overlap on the same channel at the sampling time).
(2) Synchronization rule mode: This mode is executed on the Rule Channel group. The externally triggered rule group multi-switch (extsel[2:0 by the ADC1_CR2 Register) from ADC1, which also provides synchronous triggering for ADC2.
(3) Fast crossover mode: This mode applies only to rule channel groups (usually one channel). External triggering of a regular channel multi-switch from ADC1. After an external trigger is generated:
A.adc2 starts immediately and
B.ADC1 starts after 7 ADC clock cycles are delayed
Note: The maximum allowable sampling time is <7 adcclk cycles, avoiding the overlap of two sample cycles when ADC1 and ADC2 convert the same channel.
(4) Slow Cross mode: This mode applies only to rule channel groups (only one channel). External triggering of a regular channel multi-switch from ADC1. After an external trigger is generated:
A.adc2 starts immediately and
B.ADC1 starts after 14 ADC clock cycles are delayed
C. After the second 14 ADC cycle is delayed, the ADC2 starts again, so it loops.
(5) Alternating trigger mode: This mode only applies to injection channel groups. The external trigger source is an injection channel multi-switch from the ADC1.
A. When the first trigger is generated, all the injected group channels on the ADC1 are converted.
B. When the second trigger arrives, all the injected group channels on the ADC2 are converted.
C. So loop ... &NBSP;
(6) Standalone mode: In this mode, dual ADC synchronization does not work, and each ADC interface works independently.
(7) Mixed rule/injection synchronization mode: The Rule Group Synchronization transformation can be interrupted to initiate a synchronous transformation of the injected group.
(8) Mixed synchronization rule + alternating trigger mode: The Rule Group Synchronization transformation can be interrupted to initiate an injection group alternating trigger transformation. Shows a rule that the synchronous transition is interrupted by an alternating trigger.
(9) Mixed synchronous injection + Crossover mode: An injection event can interrupt a cross-conversion. In this case, the cross-conversion is interrupted, the injection conversion is initiated, and the cross-conversion is resumed at the end of the injection sequence conversion.

About the difficulty of the ad, I really do not understand the first to save it (go)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.