cancel
Showing results for 
Search instead for 
Did you mean: 

I Can´t disable RTC512Hz signal

acer
Associate II
Posted on April 14, 2015 at 17:03

How can I disable RTC 512Hz signal and return PC13 as I/O ??

I programed the PC13 as ''GPIO_AF_RTC_50Hz''  to calibrate the 512Hz signal of internal RTC, but now I cant disable it to use PC13 as I/O, The STM32F205 doesn´t disable  512Hz and reprogram to I/O

My routine to program as 512Hz is :

GPIO_PinAFConfig (GPIOC, GPIO_PinSource13, GPIO_AF_RTC_50Hz);  //  GPIO_AF_RTC_AF1  Alternate Function RTC_AF1 (Calibrar RTC com saida em PC13 = 512 Hz)

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;  

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;

  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

  GPIO_InitStructure.GPIO_PuPd  = GPIO_PuPd_DOWN;

  GPIO_Init(GPIOC, &GPIO_InitStructure);

My routine to reprogram as I/O is below:

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13; 

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;

GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

GPIO_InitStructure.GPIO_PuPd  = GPIO_PuPd_DOWN;

GPIO_Init(GPIOC, &GPIO_InitStructure);

2 REPLIES 2
Posted on April 14, 2015 at 17:13

Can't say I've messed with it. But be aware PC13 is in the low power domain, the drive on this pin is very weak compared to other GPIO

Try changing this to a different AF setting, and make sure the GPIOC clock is enabled.

  GPIO_PinAFConfig (GPIOC, GPIO_PinSource13, GPIO_AF_RTC_50Hz); 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 14, 2015 at 17:29

Read ''Selection of RTC_AF1 and RTC_AF2 alternate functions'' in RM0033. You have set COE bit in RTC_CR, so clear it.

Note, that RTC registers are write protected, read ''RTC register write protection'' chapter and follow the description there to unlock.

You can do all this directly writing to respective registers in the debugger.

Alternatively, remove VBAT and VDD (shorting if there are significant capacitances), or perform the RTC reset (described in ''Resetting the RTC'').

JW