cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L011K4 - Configuring PC14 and PC15 as GPIO outputs?

ZRatt.1
Associate II

From the STM32L011K4 datasheet, it appears PC14 and PC15 can be used as GPIO outputs as long as OSC32 is not used. Has anyone else done this before? I'd like to drive two LEDs at 3.3V, trying to make a simple sample program to confirm if this is possible now.

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

Yes, on the STM32L011K4 you can use the RCC_OSC32_xx pins as an alternative as GPIO as with any other pin. Of course, the LSE is then no longer available and you have to select a different clock source (HSE, HSI, MSI).

But it is also possible to drive two LEDs with one pin only, if you connect one LED towards VDD and the other towards GND. The GPIO can drive the same current to either VDD or GND and disabling the pin (e.g. by changing from GPIO_Out to GPIO_In) would turn off both LEDs. The only restriction: only one LED can be switched on at a time.

Good luck!

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Peter BENSCH
ST Employee

Yes, on the STM32L011K4 you can use the RCC_OSC32_xx pins as an alternative as GPIO as with any other pin. Of course, the LSE is then no longer available and you have to select a different clock source (HSE, HSI, MSI).

But it is also possible to drive two LEDs with one pin only, if you connect one LED towards VDD and the other towards GND. The GPIO can drive the same current to either VDD or GND and disabling the pin (e.g. by changing from GPIO_Out to GPIO_In) would turn off both LEDs. The only restriction: only one LED can be switched on at a time.

Good luck!

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Uwe Bonnes
Principal III

I just wanted to remaind ZRatt on the current source restrictions on PC13..15, but devices w/o battery pin do not have this restriction. Right?

Thanks Uwe - Where can I find more information on this current limit? I checked the attached datasheet but couldn't find info.

The only point to keep in mind: PC14 is a pin of type FT (5V tolerant), while PC15 is of type TC (standard 3.3V CMOS I/O).

There is no specific current limit at both of them, as long as you stay within the max ratings you can sink or source up to ±8 mA, and sink or

source up to ±15 mA with the non-standard VOL/VOH specifications. Both the max ratings and diagrams with the voltage drop vs. pin current can be found in section 6.3.13 of the datasheet.

Regards

Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.