cancel
Showing results for 
Search instead for 
Did you mean: 

COMP1 input pin change from PB4 to PB2 after init not working. STM32LWE5CCU6

NAndreadakis
Associate III

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:

  1. Read the COMP1->CSR after the pin change and the return value is correct
  2. Make sure that both pins are set to Analog input
  3. Make a independent test to both pins to make sure that work.
  4. The oscillations are correct using oscilloscope.
  5. 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.

1 ACCEPTED SOLUTION

Accepted Solutions
NAndreadakis
Associate III

Hello @Community member​ , thanks for your response.

You where right the PB2 pin looked soldered but after a second reflow is now ok!!!

:smiling_face_with_smiling_eyes:

View solution in original post

2 REPLIES 2

Is the signal actully present on the pin, when you observe it directly on the pin using oscilloscope? (Read: isn't there a bad solder joint? Isn't there some jumper/part which disconnets the signal's source from given pin?)

Are both pins set to Analog in GPIO?

JW

NAndreadakis
Associate III

Hello @Community member​ , thanks for your response.

You where right the PB2 pin looked soldered but after a second reflow is now ok!!!

:smiling_face_with_smiling_eyes: