2024-02-12 03:44 AM - last edited on 2024-02-12 03:57 AM by SofLit
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?
2024-02-12 03:47 AM
Check the source files, is the GPIO set up correctly?
PS: </> this is for displaying source code
2024-02-12 03:54 AM
I make the settings in the cube, and the pc13 pin is automatically configured to RTC_OUT_ALARM. Or is something else required?
2024-02-12 04:32 AM
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 do
2024-02-12 07:51 AM
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.
2024-02-12 08:24 AM
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.
2024-02-12 08:40 AM - edited 2024-02-12 08:42 AM
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.
2024-02-12 08:53 AM
Also did you connect VBAT to VDD? PC13 is supplied from VBAT if VDD is lost.
2024-02-12 09:12 AM
The output is configured as push-pull. Vbat and VDD are different sources and are not related to each other.
2024-02-12 10:24 AM
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