Skip to main content
Associate II
February 12, 2024
Question

STM32H7 RTC Alarm OUT

  • February 12, 2024
  • 6 replies
  • 3443 views

Hi,

I'm trying to get an alarm signal on an external contact (PC13). In the program everything works as it should and the interrupt occurs, but nothing changes on the external contact. What did I miss?Screenshot_8.png

 

 

 
 
 
 
 
This topic has been closed for replies.

6 replies

LCE
Principal II
February 12, 2024

Check the source files, is the GPIO set up correctly?

PS: </> this is for displaying source code

Denys_TAuthor
Associate II
February 12, 2024

I make the settings in the cube, and the pc13 pin is automatically configured to RTC_OUT_ALARM. Or is something else required?

Denys_TAuthor
Associate II
February 12, 2024

I switched the signal output to PB2 and still nothing changes, the interrupt is triggered but nothing is output to the external pin. I don’t know what to doScreenshot_10.png

LCE
Principal II
February 12, 2024

Sorry, I don't know about the Cube settings.

Sooner or later you have to check the source code that is created anyway, so why not start now? ;)

So check all the C code for RTC and GPIO setup, check the HAL functions and which registers are set (-> reference manual).

At least the interrupt triggers, so if nothing else works you could toggle that pin in the ISR.

Denys_TAuthor
Associate II
February 12, 2024

Through trial and error, I found out that the signal goes to this pin in a situation where if I set the alarm and turn off the power (VDD), only Vbat remains, then everything works and the voltage appears on PC13. If VDD remains, then only the interrupt is triggered and pc13 is not. I need the alarm signal output to turn on the LDO, so this situation suits me, but it still works somehow strangely. The RTC and alarm settings have been checked more than once, there are no problems.

mƎALLEm
Technical Moderator
February 12, 2024

Hello,

What about the bit value of RTC_ALARM_TYPE in RTC_OR register? is it configured in Open drain mode (value 0)? in that case you will not see anything on the pin.

SofLit_0-1707755903551.png

 

"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."
mƎALLEm
Technical Moderator
February 12, 2024

Also did you connect VBAT to VDD? PC13 is supplied from VBAT if VDD is lost.

"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."
Denys_TAuthor
Associate II
February 12, 2024

The output is configured as push-pull. Vbat and VDD are different sources and are not related to each other.Screenshot_11.png

waclawek.jan
Super User
February 12, 2024

How do you observe the pin?

Did you try to set it to GPIO Output (without setting it to RTC alarm - you may need to reset the backup domain if you have it powered from battery) and toggle, to see if your connections are OK?

Read out and check/post all related RTC registers content, see GPIOs controlled by the RTC subchapter of RTC chapter in RM.

JW

Denys_TAuthor
Associate II
February 12, 2024

An oscilloscope is connected to pin PC13. Perhaps I don’t understand something, I set up an alarm clock in the cube and want to receive an alarm on the PC13 pin. I enabled interrupts and am just waiting for an event on the PC13 pin. And as I already wrote, there is nothing on the oscilloscope, and an interruption occurs. The situation changes if I set an alarm and turn off VDD, then when the alarm goes off, voltage appears on the PC13 pin and remains until I apply VDD again.CR.pngISR.pnggpio_c.png

Denys_TAuthor
Associate II
February 12, 2024

 

All necessary bits are set

OSEL = 01             ALARM A  

RTC_OUT_RMP = 0       NO REMAP (PC13 OUT )

RTC_ALARM_TYPE =1      PP MODE .  

But whether it should work in active mode, this table does not say anything about this.RTC_FUNCTION.png

 

I also checked the HAL_PWR_EnterSTOPMode and recorded a pulse of about 20us duration

waclawek.jan
Super User
February 13, 2024

I don't see any reason why wouldn't alarm output work in Active mode of processor.

At this point you may want to contact ST directly, through FAE or web support form.

JW