Skip to main content
tpeng.1
Associate III
April 13, 2022
Question

Configure STM32F072 PC15 as input port

  • April 13, 2022
  • 4 replies
  • 1428 views

I try to configure STM32F072 PC15 as input I/O using STM32F0xx Standard Peripherals Firmware Library, but not successful.

Ask for help.

Tim

This topic has been closed for replies.

4 replies

Peter BENSCH
Technical Moderator
April 13, 2022

Have you looked at the examples in the SPL?

How did you try to initialise the GPIO?

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.
TDK
April 13, 2022

PC15 may have RTC/LSE functionality that needs disabled. Show your code.

0693W00000LxsH3QAJ.png

"If you feel a post has answered your question, please click ""Accept as Solution""."
tpeng.1
tpeng.1Author
Associate III
April 14, 2022

Hi Peter and TDK,

Thank your reply.

Where is the examples in the SPL (SPI)? In STM32F0xx_StdPeriph_Lib_V1.5.0/../STM32F0xx_StdPeriph_Examples?

0693W00000Lxvx2QAB.pngHere is my code:  

RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE);

PWR_BackupAccessCmd( ENABLE );

RCC_LSEConfig( RCC_LSE_OFF );

GpioDriverInit(GpioC,GpioPin15,GpioInput);

Br,

Tim

waclawek.jan
Super User
April 14, 2022

Why do you think you cannot set the pin? Maybe it's a hardware problem.

> PWR_BackupAccessCmd( ENABLE );

You need to enable PWR clock in RCC first.

To test, you can do this all directly in registers in debugger, don't need to write any code.

JW