Other Parts Discussed in Thread: SYSCONFIG
Hi,
I have a desing with a cc1352R micro. I'm using the RT, and I have seen that it goes around 1 second faster per hour than it should. I have been searching and I saw that there is a register to be able to adjust the seconds.
This is the code I have put:
HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINC0)=0x0000;
HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINC1)=0x0008;
ulong temporal=0;
temporal=HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINCCTL) ;
if ((temporal & AUX_SYSIF_RTCSUBSECINCCTL_UPD_ACK)==0)
{
temporal|=AUX_SYSIF_RTCSUBSECINCCTL_UPD_REQ;
HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINCCTL)=temporal ;
}
temporal=HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINCCTL) ;
while ((temporal & AUX_SYSIF_RTCSUBSECINCCTL_UPD_ACK)==0)
{
temporal=HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINCCTL) ;
}
temporal&= ~AUX_SYSIF_RTCSUBSECINCCTL_UPD_REQ;
HWREG(AUX_SYSIF_BASE+AUX_SYSIF_O_RTCSUBSECINCCTL)=temporal ;
I have put a breakpoint when this code is finished, and I can see that the register AON_RTC:SUBSECINC has changed, so it seems that the code is ok. But after this is executed nothing else is working, I have a timer for some lightings, and they are not working fine.
If someone could explain what i am doing wrong with the code above...
Thanks!
Sandra