2020-12-15 08:08 PM
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.
Solved! Go to Solution.
2020-12-15 11:39 PM
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
2020-12-15 11:39 PM
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
2020-12-17 03:40 AM
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?
2020-12-17 07:01 AM
2020-12-21 07:32 AM
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