2015-11-12 05:29 AM
Hi Community
I have an issue with the Real Time Clock of the SPC560D. My application try to read the RTC.RTCCNT register. Every time during the read process the program pointer goes to 0x0000000E0, therefor it points to nothing -.-I think it is a basically problem, because the same issue occurs, if the RTC get configured.
Programm Code:
int
main(
void
) {
componentsInit();
uint32_t test = RTC.RTCCNT.R;
componentsInit();
}
The access to the timer structure STM works very well, but I have any read or write access to the RTC variable.
Has anybody some experience with it, or is there a solution out there ;D
best regards
Philipp
#rtc2015-11-12 06:21 AM
Hello Philipp ,
You should enable the PCTL 91 cf Table 70 in the RM. halSPCSetPeripheralClockMode(91, SPC5_ME_PCTL_RUN(2) | SPC5_ME_PCTL_LP(2)); Why there are 2 componentsInit() ? Best regards Erwan2015-11-12 06:44 AM
Hi Erwan
Thank you for your fast fix. It helped me a lot. Yes, the second componentInit(); was a fast debugging solution and makes nosense in the program :D kind regards Philipp2015-12-14 07:16 AM
Hi Community
Overview:
Low Power Mode: StandbyBoard: SPC560D DiscoveryHas anyone some experience with the RTC wakeup? My application should wake up after some time. It is a non-periodic wakeup so I will use the RTCVal register and not the API functionality. Sometimes I get a wakeup from the RTC and sometimes not.
In my opinion it is strange behavior, because the RTC wakeup occurs only if there is another wakeup before.
I think there is an issue with the initialization, but I tried all combinations of the RTCC Register and the WRER Register.
kind regards
Philipp
2015-12-15 05:03 AM
Hello philipp ,
RTC should be mapped on WKPU1 (IRQ 46) Did you try to enable ROVEN ? Counter Roll Over Wakeup/Interrupt Enable The ROVREN bit enables wakeup and interrupt requests when the RTC has rolled over from 0xFFFF_FFFF to 0x0000_0000. The RTCIE bit must also be set in order to generate an interrupt from a counter rollover. 1 RTC rollover wakeup/interrupt enabled 0 RTC rollover wakeup/interrupt disabled Best regards Erwan2015-12-15 05:47 AM
Hi Erwan,
Thank you for your reply. I found the issue, the SIRC source must be active during standby AND to store this configuration a new mode transition must be done otherwise it will not workOnly a comment in the hal_lld.c gives a hint to this behavior. Thank you for your supportPS: I hope these additional information will be added in the documentationkind regards Philipp2015-12-16 01:16 AM
Hello Philipp ,
In fact , it is logical to use SIRC clock for the RTC Periph in STANDBY Mode. i have found this information in chap1 : DM00074056_LOW_POWER_MODE_SPC564Bxx_SPC56ECxx.pdf This mode is intended as follows: • As an extreme low-power mode with everything powered down apart from the necessary circuitry to allow device wakeup and eventually a RTC/API (real time clock) implementation • To be used by software to remain in the lowest power consumption state with no requirement to wake up quickly. SIRC for RTC has the lowest consumption in STANDBY Mode Best regards Erwan ________________ Attachments : DM00074056_LOW_POWER_MODE_SPC564Bxx_SPC56ECxx.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0PU&d=%2Fa%2F0X0000000bZi%2FR9UzHfes.VeiQaycy1ijQYy0mo.QQ4DZUsPBcmpGLdk&asPdf=false2015-12-16 01:29 AM
Hi Erwan
Thank you for your reply. I think there is misunderstanding :D One requirement for my application is extreme low power consumption. So it like to use the SIRC. It is only possible to use the SIRC if the Standby bit of the SIRC control register is set. The missing information for me was that a mode transition is required after setting this bit. Otherwise the SIRC is still not available.So only a comment in the hal_lld.c gives me a hint that a mode transition is required.
kind regards
Philipp