cancel
Showing results for 
Search instead for 
Did you mean: 

Configure STM32F072 PC15 as input port

tpeng.1
Associate III

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

Ask for help.

Tim

4 REPLIES 4
Peter BENSCH
ST Employee

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
Guru

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
Associate III

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

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