STM32 PC14 PC15

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
User avatar
Meekdai
Posts: 45
Joined: Mon Jan 29, 2018 12:45 pm

STM32 PC14 PC15

Post by Meekdai » Tue Apr 17, 2018 3:13 am

Hello!

I do not need to use the crystal 32.768KHZ, I would like to use GPIO port PC14 and PC15, what should I do?
I have solved the hardware and how the software needs to be handled.

Thanks!

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: STM32 PC14 PC15

Post by dhylands » Tue Apr 17, 2018 3:54 am

I think you'd need to add the 2 pins to pins.csv for your board. You'd also need to remove the oscillator and loading caps, and disable the LSE.

I think you need to set MICROPY_HW_RTC_USE_LSE to 0: https://github.com/micropython/micropyt ... oard.h#L23

User avatar
Meekdai
Posts: 45
Joined: Mon Jan 29, 2018 12:45 pm

Re: STM32 PC14 PC15

Post by Meekdai » Tue Apr 17, 2018 9:17 am

dhylands wrote:
Tue Apr 17, 2018 3:54 am
I think you'd need to add the 2 pins to pins.csv for your board. You'd also need to remove the oscillator and loading caps, and disable the LSE.

I think you need to set MICROPY_HW_RTC_USE_LSE to 0: https://github.com/micropython/micropyt ... oard.h#L23
I am modifying the mpconfigboard.h file as follows

Code: Select all

#define MICROPY_HW_ENABLE_RTC       (0)
#define MICROPY_HW_RTC_USE_LSE      (0)
And the pins.csv file as follows

Code: Select all

C14,PC14
C15,PC15
Here is my code on REPL:

Code: Select all

from pyb import Pin
p_out = Pin('C14', Pin.OUT_PP)
p_out.high()
It works, thanks!

Post Reply