Skip to main content
NAndreadakis
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:

  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.

This topic has been closed for replies.
Best answer by NAndreadakis

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:

2 replies

waclawek.jan
Super User
January 18, 2022

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
NAndreadakisAuthorBest answer
Associate II
January 19, 2022

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: