From: http://bbs.ednchina.com/BLOG_ARTICLE_225912.HTM
Each ADC module of stm32 can switch to different input channels and perform conversion through an internal analog multi-channel switch. Stm32 is particularly added to multiple group conversion modes. After the program is configured, It can automatically sample and convert multiple analog channels one by one.
There are two ways to divide the conversion group: rule Channel group and injection Channel group. Generally, up to 16 channels can be arranged in the rule Channel group, and up to four channels can be arranged in the injection Channel group.
When performing rule Channel group scan conversion, you can enable the conversion of injection channel groups if any exception occurs.
An inappropriate analogy is that the conversion of rule Channel groups is like the normal execution of programs, while the conversion of injection channel groups is like an interrupt processing program other than normal execution of programs.
Another example is not necessarily used:
If you have five temperature probes in your yard and three temperature probes in the room, you need to monitor the outdoor temperature at all times, but occasionally you want to check the room temperature; therefore, you can use the rule Channel group to scan 5 outdoor probes cyclically and display the adconversion result. When you want to view the indoor temperature, use a button to start the injection conversion group (3 Indoor probes) the indoor temperature is temporarily displayed. When you open this button, the system will return to the rule Channel group to continue detecting the outdoor temperature.
From the system design, the process of measuring and displaying the indoor temperature interrupts the process of measuring and displaying the outdoor temperature. However, different conversion groups can be set in the initialization phase in programming, the system does not need to change the configuration of the cyclic conversion during operation, so that the two tasks do not interfere with each other and fail over quickly. You can imagine that if there is no rule group or injection group division, when you press the button, you need to configure the ad loop scan Channel again, then, after the cast button, configure the ad loop scan Channel again.
--------------
Because of the slow speed, the above example does not fully reflect the advantages of this distinction (Rule group and injection group). However, in the industrial application field, many detection and monitoring probes need to be processed quickly, in this way, the adconversion group will simplify the program for event processing and speed up event processing.