[Black STM32F407VET6] Pin map

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
User avatar
Posts: 453
Joined: Mon Jun 15, 2015 8:03 am

Re: [Black STM32F407VET6] Pin map

Post by mcauser » Wed Jul 17, 2019 7:25 am

User LEDs D2 and D3 have their anodes connected to Vcc (3V3) and their cathodes to Port A pins through 510R resistors.
https://github.com/mcauser/BLACK_F407VE ... matics.pdf

Pins PA6 and PA7 illuminate the LEDs when driven low.
LED_D2 is mapped to PA6
LED_D3 is mapped to PA7
RED_LED is also mapped to PA6
https://github.com/mcauser/BLACK_F407VE ... r/pins.csv

D1 is the always-on power LED and is connected between vcc and gnd through another 510R.

I added MICROPY_HW_LED1 to the board definition, so that they could be used with pyb.LED
These two should handle the active low configuration of the LEDs.
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_low(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_high(pin))
https://github.com/mcauser/BLACK_F407VE ... ard.h#L119

I haven't touched this in a while, but this should work:

Code: Select all

>>> from pyb import LED
>>> led = LED(1) # 1=D2, 2=D3
>>> led.on()
>>> led.off()
Same same:

Code: Select all

pin_a6 = machine.Pin('A6') ... pin_a6(0)

Post Reply