RTC on PIC24H

General discussion on mikroPascal PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

RTC on PIC24H

#1 Post by jpc » 07 Jan 2011 11:03

i am trying to get the RTC working on a PIC24HJ128gp202, for some reason i do not get this clock ticking.
I have a 32.768 kHz resonator connected between the SOSCI and SOSCO pins and initialise as follows

Code: Select all

  nvmkey := $55;          
  nvmkey := $AA;
  rtcwren_bit := 1;              //  enable writing to  rcfgcal
  rcfgcal := %1010000000000000;  // enable the RTC
  rtcval := 0;                   // set seconds/minutes to zero
  lposcen_bit := 1;              // enable the LP-oscillator
i must miss something as the clock does not start ticking. If i do not clear rtcval i can see random values on powering up.
I already played with initializing the concerned TRIS bits but no luck so far. for what it is worth i do not see any activity with a scope on the oscillator.
I am running this PIC from the internal osc with PLL, for that reason disabled the primary oscillator in the project-config.
Did anyone here get this working? I am aware of rather dramatic issue's with this RTC in the errata but still could use it to some level.
Au royaume des aveugles, les borgnes sont rois.

Post Reply

Return to “mikroPascal PRO for dsPIC30/33 and PIC24 General”