http://www.st.com/web/en/resource/technical/document/reference_manual/DM00094349.pdf
Then, a question:
Bits 6:4 >>> 3bits settings,
0000 >>> 4bits settings
which is correct?
////////////
Bits 6:4 COMP2INMSEL[2:0]: Comparator 2 inverting input selection
These bits allows to select the source connected to the inverting input of the comparator 2.
0000: 1/4 of Vrefint
0001: 1/2 of Vrefint
0010: 3/4 of Vrefint
0011: Vrefint
0100: PA4 or DAC1_CH1 output if enabled
0110: PA2
Remaining combinations: reserved.
415/1077
DocID025202 Rev 4
//////////
I read all of STM32F302MR8T6 manual to use STM32F302 nucleo.
There is no detail to use analog comparators in a chip.
How to write the software without hardware description?
Functional overview the comparators in STM32F302x6 STM32F302x8
21/135 DocID025147 Rev 3
- Three fast rail-to-rail analog comparators with analog supply from 2.0 to 3.6 V
The STM32F302x6/8 devices embed up to three ultra-fast rail-to-rail comparators which offer the features below:
Programmable internal or external reference voltage
Selectable output polarity.
The reference voltage can be one of the following:
External I/O
DAC output
Internal reference voltage or submultiple (1/4, 1/2, 3/4).
Refer to Table 26: Embedded internal reference voltage
for the value and precision of the internal reference voltage.
All comparators can wake up from STOP mode, and also generate interrupts and breaks for the timers.
Takao
Is there a way to use a comparator on a analog in without continuously sampling with the ADC? Can I program an analog in level that triggers an interrupt?