Page 2 of 2

Re: [Black STM32F407VET6] Pin map

Posted: Wed Jul 17, 2019 7:25 am
by mcauser
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

machine.Pin.board.LED_D2.value(0)
machine.Pin('LED_D2').value(0)
machine.Pin('A6').value(0)
pin_a6 = machine.Pin('A6') ... pin_a6(0)