2024-04-14 12:19 PM
Hello,
I am having trouble in getting PC14 and PC15 working as GPIOs on the STM32F401. The reference manual says that "The LSE oscillator pins OSC32_IN and OSC32_OUT can be used as general-purpose PC14 and PC15 I/Os, respectively, when the LSE oscillator is off.". However I still cannot use them as GPIOs, despite disabling LSE. I am aware of the current limit and the backup power domain. In my design Vbat is connected directly to Vdd and I enabled the backup power domain in RCC. Is there some special mode that they need to operate?
My design uses external 24kohm pullup resistors on these pins, because I read in the manual that they can only sink current.
Currently, my init code does (in the following order):
In this case toggling the GPIOC makes all pins but PC[13-15] change state. Is there something I am missing?
According to the datasheet woding all that RTC code should not be necesary because the LSE is disabled by default
Does anyone have a code example (CubeMX or Libopencm3) which shows how to control these pins?
Best Regards
KL
Solved! Go to Solution.
2024-04-15 02:55 AM
Hi @kla
If you need to use PC13, PC14 and PC15 as GPIOs output with VBAT connected to VDD there is a Power switch in VBAT domain that limit the sinks current to 3mA.
So, the usage of PC13 to PC15 is restricted with maximum speed 2MHz and an external maximum load 30pF.
Check the RM0368 Rev 5 5.1 Power supplies section.
In your case, I do not understand why your are enabling power domain and access to RTC registers?
You just have to configure PC13 to PC15 in GPIO Output with GPIO_SPEED_FREQ_LOW (2MHz)
I share with you a CubeIDE project that does this. Can you check please?
Let me know if it helps you?
Best regards.
Romain,
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-04-15 02:55 AM
Hi @kla
If you need to use PC13, PC14 and PC15 as GPIOs output with VBAT connected to VDD there is a Power switch in VBAT domain that limit the sinks current to 3mA.
So, the usage of PC13 to PC15 is restricted with maximum speed 2MHz and an external maximum load 30pF.
Check the RM0368 Rev 5 5.1 Power supplies section.
In your case, I do not understand why your are enabling power domain and access to RTC registers?
You just have to configure PC13 to PC15 in GPIO Output with GPIO_SPEED_FREQ_LOW (2MHz)
I share with you a CubeIDE project that does this. Can you check please?
Let me know if it helps you?
Best regards.
Romain,
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-04-15 05:55 AM
Thank you @RomainR., using your Cube example I was able to implement it in my code!
My initial attempts at disabling the RTC and so on were my misunderstanding and trying to get something to work.