RTCC Issues PIC18F67J90


+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2014
    Posts
    2

    Default RTCC Issues PIC18F67J90

    I'm trying to use the RTCC in the PIC18F67J90 with an external 32 KHz watch crystal. I've probed the crystal with my scope and shown that the timer is running it, but for some reason the RTCC refuses to increment. I've also printed the timer1 values, it seems to be counting, but still the RTCC doesn't increment. Also I don't get a pulse output on the RTCC pin (pin 8 on this chip).

    Config:
    Code:
    #CONFIG    CONFIG OSC = HS
        CONFIG LPT1OSC = OFF
        CONFIG CP0 = OFF
        CONFIG WDTEN = OFF
        CONFIG XINST = OFF
        CONFIG T1DIG = OFF
        CONFIG IESO = OFF
        CONFIG FCMEN = OFF
        CONFIG WDTPS = 512
        CONFIG RTCSOSC = T1OSCREF
        CONFIG STVREN = ON
    #ENDCONFIG
    Initialization:
    Code:
    initRTCC:   	RTCCFG 	= %10000100
    	T1CON	= %10001001
    	PADCFG1 = %00000010
    	EECON2 = $55
    	EECON2 = $AA
    	RTCCFG.5 = 0
    Readout Code:
    Code:
    readRTC:
        RTCCFG.1 = 1 : RTCCFG.0 = 1
        DEBUG "RTCPRT = ", DEC RTCCFG.1, DEC RTCCFG.0, "  ", "H: ", DEC RTCVALH, "  L:", DEC RTCVALL,10,13
        DEBUG "RTCPRT = ", DEC RTCCFG.1, DEC RTCCFG.0, "  ", "H: ", DEC RTCVALH, "  L:", DEC RTCVALL,10,13
        DEBUG "RTCPRT = ", DEC RTCCFG.1, DEC RTCCFG.0, "  ", "H: ", DEC RTCVALH, "  L:", DEC RTCVALL,10,13
        DEBUG "RTCPRT = ", DEC RTCCFG.1, DEC RTCCFG.0, "  ", "H: ", DEC RTCVALH, "  L:", DEC RTCVALL,10,13
        DEBUG "Timer1: ", DEC TMR1H, ",", DEC TMR1L,10,13
        DEBUG "RTC Reads: ", STR hour, ":", STR minute, ":", STR sec,10,13,10,13
        pause 2000
        goto readRTC
    Output:
    Code:
    RTCPRT = 11  H: 0  L:0
    RTCPRT = 10  H: 0  L:0
    RTCPRT = 01  H: 0  L:0
    RTCPRT = 00  H: 0  L:0
    Timer1: 77,102
    RTC Reads: ::
    
    
    RTCPRT = 11  H: 0  L:0
    RTCPRT = 10  H: 0  L:0
    RTCPRT = 01  H: 0  L:0
    RTCPRT = 00  H: 0  L:0
    Timer1: 66,103
    RTC Reads: ::
    I've been beating my head against this for hours, does anyone have any insight?

    Thanks,
    Walter

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default Re: RTCC Issues PIC18F67J90

    Your line RTCCFG = %10000100 isn't enabling the RTCC module ...
    The RTCWREN bit must be set before you can set the Enable bit (RTCCFG.7).

    Code:
    	EECON2 = $55
    	EECON2 = $AA    ; Unlock
    	RTCCFG.5 = 1    ; Enable Writes
    	RTCCFG.7 = 1    ; Enable RTCC module
    	EECON2 = $55
    	EECON2 = $AA
    	RTCCFG.5 = 0    ; Disable Writes
    DT

  3. #3
    Join Date
    May 2014
    Posts
    2

    Default Re: RTCC Issues PIC18F67J90

    doh! Sure enough, it's ticking right along now. I didn't realize that register was locked too! Thanks a million!

Similar Threads

  1. 18f26j53 rtcc
    By fowardbias in forum General
    Replies: 0
    Last Post: - 10th March 2013, 16:34
  2. Rtcc
    By Gerd in forum General
    Replies: 4
    Last Post: - 5th November 2012, 21:15
  3. Mcp79410 rtcc
    By keymuu in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th July 2012, 04:36
  4. 18F devices RTCC Interrupt
    By readitaloud in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th July 2011, 09:39
  5. Support for RTCC
    By fowardbias in forum PBP Wish List
    Replies: 0
    Last Post: - 28th April 2011, 15:49

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts