Associate II
January 18, 2022
Solved
COMP1 input pin change from PB4 to PB2 after init not working. STM32LWE5CCU6
- January 18, 2022
- 2 replies
- 1333 views
I have two independent oscillations one in PB4 and the other on PB2.
I start the first oscillation on PB4 and comp returns the oscillation picks correct.
After without stop the COMP1 i change the input plus pin from PB4 to PB2. Using MODIFY_REG(COMP1->CSR, COMP_CSR_INPSEL, COMP_INPUT_PLUS_IO2 );
Start the oscillation on PB2 and the comparator never read the oscillation.
What i have already try:
- Read the COMP1->CSR after the pin change and the return value is correct
- Make sure that both pins are set to Analog input
- Make a independent test to both pins to make sure that work.
- The oscillations are correct using oscilloscope.
- Switch off comp, change the pin and switch on again comp.
Is there any hidden locking mechanism? The value of the comparator lock register bit[31] is 0 always in my application.