Other Parts Discussed in Thread: SYSBIOS
Hello,
my current project is a low-power system which read data from several sensors and send these data trhough RF. Now, my goal is to wake up my system every 10 minutes, acquire all needed data and at last send these ones to a reciever.
I want to use the RTC. What I found is this:
RTC has three different channels which work in specifics way (0 only in compare mode, 1 in capture mode and 2 in continous compare mode). I suppose that channel 2 is what I need but I am not capable of set RTC for this behaviour.
Right now I am able to do as follow:
void RTCInit(){
/*Disable and Reset RTC*/
AONRTCDisable();
AONRTCReset();
/*Clear event for and clear pending interrupt*/
AONRTCEventClear(AON_RTC_CH0);
IntPendClear(INT_AON_RTC_COMB);
// Enable compare channel 0
AONRTCCombinedEventConfig(AON_RTC_CH0);
/* Set the compare value for the given channel*/
AONRTCCompareValueSet(AON_RTC_CH0,0x00020000); // timing example
/*Clear event for and clear pending interrupt*/
AONRTCEventClear(AON_RTC_CH0);
IntPendClear(INT_AON_RTC_COMB);
/*Enable RTC_CH0 and RTC*/
AONRTCChannelEnable(AON_RTC_CH0);
AONRTCEnable();
}
And in my loop I call every time RTCInit().
This works but it is not good at all because it resets RTC every time. Moreover, this routine uses channel 0 and not channel 2 as I said before, if the settings are switched from channle 0 to channel 2 nothing happens.
Do you have any ideas for this issue? Moreover, how can I read the timing value of RTC?
best regards,
Vincenzo