cancel
Showing results for 
Search instead for 
Did you mean: 

Good day. Question about STM32L051C8 and PA11-PA12 ports.

???????? ??????_3
Associate II
Posted on December 23, 2016 at 13:32

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.

#stm32l0
2 REPLIES 2
Seb
ST Employee
Posted on December 23, 2016 at 14:13

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!

Posted on December 23, 2016 at 14:59

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.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..