2012-06-23 04:47 AM
Hello to everybody,
I am trying everything to be able to use the PC14 and PC15 pins as digital outputs, but I can't get it at all. Obviously I'm not using the LSE.Both pins aer conected to two MOSFET gates respectively, so there is barely power consum (I'm not trying to drive a LED or anything like that)The information found in the documentation is very, very poor and in the forums isn't more useful.I have assumed that the LSE is off once I turn on the uC and just defining the pins as outputs and using the GPIO_SetBits doesn't work.I have assumed that the LSE is on once I turn on the uC. I inicialized APB1_PWR clock. I enabled the RTC access and I disabled the LSE clock security system and I turned off the LSE explicitly.I think I've tried all the likely combinations and I keep on failing. I`m missing something but I dont realize what is it. I hope you could help me. Thanks in advance.Regrads. #stm32l-osc32-gpio-pc14-pc15 #pc13-pc14-pc15-gpio2012-06-23 05:56 AM
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
// GPIO Function lost in STANDBY, PC14,PC15 revert to analog inputs
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14 | GPIO_Pin_14;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_40MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOC, &GPIO_InitStructure);
PWR_RTCAccessCmd(ENABLE); // Enable access to LSE
RCC_LSEConfig(RCC_LSE_OFF); // PC14 PC15 as GPIO
2012-06-25 01:59 AM
Hello Clive,
thank you for answering. I have already configured it in that form, only with the difference of the speed, I did it with 2MHz. Could it be a problem? It keeps on failing.Regards2014-03-13 07:32 AM
We are seeing a similar issue, we can't configure PC14 as an output, was this resolved?
2014-03-13 08:42 AM
We are seeing a similar issue, we can't configure PC14 as an output, was this resolved?
On an L1 part or something else?For the L1 you HAVE to turn the LSE off to take control of the pin.
''The PC14 and PC15 I/Os are only configured as OSC32_IN/OSC32_OUT when the LSE oscillator is on (by setting the LSEON bit in the RCC_CSR register). The LSE oscillator pins OSC32_IN/OSC32_OUT can be used as general-purpose PC14/PC15 I/Os, respectively, when the LSE oscillator is off ( after reset, the LSE oscillator is off ). The LSE has priority over the GPIO function. For more details, refer to Using the OSC32_IN/OSC32_OUT pins as GPIO PC14/PC15 port pins section in the STM32L15xxx reference manual (RM0038).'' For the F1/F2/F4 these pins are in the BACKUP domain, and have lower current (sink/source) specs.
2014-03-13 08:52 AM
STM32F100C8, LSE is off.
2014-03-13 08:56 AM
STM32F100C8, LSE is off.
Would seem a new thread would have been appropriate, with a clear code example about how you're configuring the pin now, and what it's connected too in your board design.2014-03-14 11:19 AM
We found the problem was that the GPIOC clock was not enabled before we wrote to the GPIOC port configuration registers.