Bluepill Generic F103C8T6 LED reversed?

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
Post Reply
befiglonia
Posts: 2
Joined: Mon Aug 07, 2017 10:25 am

Bluepill Generic F103C8T6 LED reversed?

Post by befiglonia » Mon Aug 07, 2017 10:31 am

Hi,

i observed that if i run a simple Blink on my Bluepill with STM32duino framework i get a reversed behaviors on the LED.

What i mean is, if i put

digitalWrite(PC13, LOW);

the LED lights up and vice versa.

I checked with a multimeter and indeed, the LED lights up when PC13 is LOW. Is this normal behavior for the onboard LED on generic boards?

On a side note: On a Maple Mini Clone this behaviour is the opposite and in my opinion the more intuitive implementation.
Last edited by befiglonia on Mon Aug 07, 2017 10:40 am, edited 1 time in total.

User avatar
Pito
Posts: 1502
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Bluepill Generic F103C8T6 LED reversed?

Post by Pito » Mon Aug 07, 2017 10:33 am

Some boards have got LED wired against GND (lits while HIGH), some against Vcc (lits while LOW). So it is normal.

Code: Select all

// LED wired against GND
#define LED_ON    HIGH
#define LED_OFF   LOW

// LED wired against Vcc
#define LED_ON    LOW
#define LED_OFF   HIGH
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 6726
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Bluepill Generic F103C8T6 LED reversed?

Post by RogerClark » Mon Aug 07, 2017 10:50 am

Some MCU's more gnd pins than Vcc pins, so the theory behind connecting the LED between Vcc and the pin, is that the current for the LED is spread across more power pins (GND's) on the MCU

However I don't think this is particularly important on the STM32F103

Post Reply