[Help]How to configure PA15 PC13 PC14 PC15 as inputs on Libmaple core

Post here all questions related to LibMaple core if you can't find a relevant section!
Post Reply
HIDDEN
Posts: 4
Joined: Fri Dec 20, 2019 5:04 am

[Help]How to configure PA15 PC13 PC14 PC15 as inputs on Libmaple core

Post by HIDDEN »

I am having some problems to configure these pins as inputs because they share other predefined functions at boot.

In the case of PA15 I have disabled the JTAG function so that it isn't used as JTDI. When I try to use it as input, it remains in activated state all the time. Doesn't matter if I set it as a floating, pull-up or pull-down input. Other JTAG pins as PB3 or PB4 work correctly.

PC13, PC14 and PC15 pins do act as inputs as they change state but they do in a strange way, toggling constantly as if they were connected to a clock that was causing this behavior.

I am using a blue pill, so I don't know if this behavior is due to the interference of the 32.768 Khz oscillator connected between PC14 and PC15 or LSE is not properly disabled. Do I need to desolder this oscillator to use the inputs correctly?

I would be grateful if someone who has managed to handle these pins correctly guides me on how to correctly configure the use of these pins as GPIO if possible for Libmaple core.
Last edited by HIDDEN on Sat Jan 04, 2020 11:46 pm, edited 1 time in total.
ag123
Posts: 1668
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

Re: How to configure PA15 PC13 PC14 PC15 as inputs on Libmaple core

Post by ag123 »

for the blue pill there is a on board 32k crystal, so it feeds at 32khz. more commonly. it is useful for rtc as the lse
connect a coin cell at vbat, and the rtc keep running for months
https://www.aliexpress.com/wholesale?ca ... maple+mini
the maple mini boards are those that do not have the 32khz crystal and caps soldered, but those pins
still have the oscillatory circuits as it is intended for that purpose
it may still be possible to use it with the 32khz signals for input, just that the processing'd be more complicated than simply reading a pin
e.g. to try to minus lse signals etc
User avatar
Pito
Posts: 94
Joined: Tue Dec 24, 2019 1:53 pm

Re: [Help]How to configure PA15 PC13 PC14 PC15 as inputs on Libmaple core

Post by Pito »

Those pins have some limitation - speed and fanout (they are weaker).
It was discussed how to enable them on the old forum many times.
https://stm32duinoforum.com/forum/index_php.html

I think the pins with 32kHz resonator should work when oscillator disabled. Mind there are capacitors to the ground, and, between the pins (the resonator) thus they may interfere each other.
Pukao Hats Cleaning Services Ltd.
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: [Help]How to configure PA15 PC13 PC14 PC15 as inputs on Libmaple core

Post by stevestrong »

As @ag123 said, there is a crystal on PC14/15, so you will most probably not be able to use them as input, unless you remove the crystal.
On PC13 there is a LED tied to 3.3V via a resistor, so you have to have a small signal impedance if you want to use it as input. Or remove the LED.
PA15 should work as input if you call in setup:

Code: Select all

disableDebugPorts();
HIDDEN
Posts: 4
Joined: Fri Dec 20, 2019 5:04 am

Re: [Help]How to configure PA15 PC13 PC14 PC15 as inputs on Libmaple core

Post by HIDDEN »

Thank you very much for the answers. I will try to desolder the crystal to verify that the inputs work correctly. As for PA15, I have set up as stevestrong says, but for some reason it still doesn't work as input. Keep investigating.
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: [Help]How to configure PA15 PC13 PC14 PC15 as inputs on Libmaple core

Post by stevestrong »

Post a simple sketch which shows that PA15 does not work as (digital) input.
Post Reply

Return to “General discussion”