This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

R(eal) T(ime) C(lock) procedure

Hi to all.
I am trying to view through ASC0 the actual time of the RTC on my XC16x board (XC164CS microcontroller). I need a procedure to capture all values of both timer registers. (RTC_RTCH and RTC_RTCL)
The RTC initialization is as follows:

        SYSCON0_RTCCM  =  0;           // enable access to control bits

        ///  -----------------------------------------------------------------------
        ///  Configuration of the RTC Counter:
        ///  -----------------------------------------------------------------------
        ///  - RTC input frequency is 345,600 kHz
        ///  - the input clock is divided by factor 8
        ///  - counter is started after initialization

        while((RTC_CON & 0x8000) == 0x0000);      // wait until access is possible
        RTC_CON        =  0x0002;      // load RTC control register

        ///  - overflow period on T14:  1,0000 [s]
        ///  - overflow period on CNT0: 1,0000 [s]
        ///  - overflow period on CNT1: 1,0000 [min]
        ///  - overflow period on CNT2: 1,0000 [h]
        ///  - overflow period on CNT3: 1,0000 [days]

        RTC_T14REL     =  0x5740;      // load T14 count/reload register
        RTC_RTCL       =  0x13FF;      // load RTC low register
        RTC_RELL       =  0x13FF;      // load RTC reload low register
        RTC_RTCH       =  0xFA04;      // load RTC high register
        RTC_RELH       =  0xFA04;      // load RTC reload high register

        ///  -----------------------------------------------------------------------
        ///  Configuration of the used RTC Interrupts:
        ///  -----------------------------------------------------------------------
        ///  RTC service request node configuration:
        ///  - RTC interrupt priority level (ILVL) = 15
        ///  - RTC interrupt group level (GLVL) = 1
        ///  - RTC group priority extension (GPX) = 0

        RTC_IC         =  0x007D;

        ///  Use PEC channel 5 for RTC INT:
        ///  - normal interrupt
        ///  - pointers are not modified
        ///  - transfer a word
        ///  - service End of PEC interrrupt by a EOP interrupt node is disabled

        PECC5          =  0x0000;      // load PECC5 control register


        RTC_ISNC       =  0x0155;      // load RTC interrupt sub node register

        RTC_CON_RUN    =  1;           // starts the counter
} //  End of function RTC_vInit


Thanks :)

0