cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F1 PC14 and PC15 don't be output ?

özkan örnek
Associate II
Posted on February 21, 2018 at 13:01

Hi;

I have a problem.

I want to be output pins PC14 and PC 15, so make the registers PWR -> CR = 0x00000100, RCC-> BDCR = 0x00000000. 

probably  LSE ocillator isn't off. 

thim my code :

#include 'stm32f10x.h'

#include 'stm32f10x_gpio.h'

#include 'stm32f10x_rcc.h'

int main(void){

PWR -> CR = 0x00000100;

RCC-> BDCR = 0x00000000.;

RCC_APB2PeriphClockCmd(RCC_APB2Perirh_GPIOC, ENABLE);

GPIO_InitTypeDef control;

control.GPIO_Pin = GPIO_Pin_14 | GPIO_Pin_15;

control.GPIO_Mode = GPIO_Mode_Out_PP;

control.GPIO_Speed = GPIO_Speed_2MHz;

GPIO_Init(GPIOC, &control);

   

   while(1){

         

         GPIO_SetBits(GPIOC, GPIO_Pin_15);

         

 GPIO_SetBits(GPIOC, GPIO_Pin_14);

      }

}

How can do this ?

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
özkan örnek
Associate II
Posted on February 22, 2018 at 14:17

I solved my problem. I made a mistake in one bit 

BKP_RTCCR's register. 

Thank you so much redwire and all friend.

View solution in original post

5 REPLIES 5
Posted on February 21, 2018 at 14:00

I found only such limitations but have no experience with this:

When the backup domain is supplied by VDD (analog switch connected to VDD), the

following functions are available:

• PC14 and PC15 can be used as either GPIO or LSE pins

• PC13 can be used as GPIO, TAMPER pin, RTC Calibration Clock, RTC Alarm or second output (refer to Section 6: Backup registers (BKP))

Note: Due to the fact that the switch only sinks a limited amount of current (3 mA), the use of GPIOs PC13 to PC15 in output mode is restricted: the speed has to be limited to 2 MHz with a maximum load of 30 pF and these IOs must not be used as a current source (e.g. to drive a LED).

When the backup domain is supplied by VBAT (analog switch connected to VBAT because VDD is not present), the following functions are available:

• PC14 and PC15 can be used as LSE pins only

• PC13 can be used as TAMPER pin, RTC Alarm or Second output (refer to

Section 6.4.2: RTC clock calibration register (BKP_RTCCR)).
özkan örnek
Associate II
Posted on February 21, 2018 at 14:25

I saw this subjects in user manuel but don't choose.  even sothank yo your helpfull Bogdan Golab.

Bill Dempsey
Senior
Posted on February 22, 2018 at 06:11

I think your question has been answered but just in case you are looking for more info.  There is no real issue with using PC14/15 as GPIO as long as you don't want to use the RTC with VBAT as stated above.  My advice would be to use the CubeMX software to attempt this configuration and then optimize the code as required.

özkan örnek
Associate II
Posted on February 22, 2018 at 14:17

I solved my problem. I made a mistake in one bit 

BKP_RTCCR's register. 

Thank you so much redwire and all friend.

MBelk
Associate II

I have the same situation, what I'm doing wrong? 

 PWR_CR |= (uint32_t)PWR_CR_DBP;

  RCC_BDCR = (uint32_t)0;

  BKP_CR = (uint32_t)0;

  BKP_RTCCR = (uint32_t)0;

  BKP_CSR = (uint32_t)0;

  RCC_BDCR |= (uint32_t)RCC_BDCR_BDRST;

  gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO14 | GPIO15);

  GPIOC_BSRR |= GPIO14 | GPIO15;