Good day. I use STM32L051C8. And I have a problem with GPIOs PA11 and PA12 in push-pull mode. When I trying set signal in 1, it up on short time and drop back. Other ports works perfect, but I can't understand what with these.
The datasheet does show that PA11 and PA12 are typical GPIO:
PA11 = SPI1_MISO, EVENTOUT, USART1_CTS, COMP1_OUT
PA12 = SPI1_MOSI, EVENTOUT, USART1_RTS_DE, COMP2_OUT
Use debugger to look at your code. After tuning on the PA11 and PA12 ports, put a breakpoint to stop all SW (including interrupt). Then check with oscilloscope or multimeter what happen to the pin.
With so little info, there are many possibilities in mis-managing GPIOs.
The most popular mistakes are:
- The same GPIO are used by 2 different functions, sometime one of them is an interrupt based function
- Using GPIO DR directly instead of using the BSSR register (bit set or bit reset)
- Wrong GPIO pointer useage or activation of an alternate function in some other part of the code
Good luck in your debug!
You'll need to review the pins in the context of your design, if you have things attached to them, or if they are shorted to each other, or other pins.
Retrieving data ...