Thursday, August 16, 2007

[piclist] RTCC won't increment on PIC24F

I'm trying to use the RTCC on a 24FJ64GA004 with the C30 compiler and
can't get the RTCC to increment, my test code is like this:

rtccTime Time; //typedef that contains the time
RtccInitClock(); //turn on clock source
RtccWrOn(); //enable RTCC peripheral
mRtccOn(); //switch on the RTCC

while(TRUE)
{
mRtccWaitSync();
RtccReadTime(&Time);
sprintf(s,"%:%i:%i",(int)Time.f.min, (int)Time.f.hour,
(int)Time.f.sec);
UpdateLCDline1(s);
}

All I get is a constant "59:52:48" on my LCD display, i.e. the seconds
don't tick over.
Yes, my secondary 32.768KHz oscillator is working fine as I can run my
application from it no problem.
I know I probably have to convert the BCD encoded value to int before
displaying, but I would have expected the display to tick over at least.
I added the mRtccOn() command in addition to what the example shows,
but it makes no difference.
Any ideas?

Thaks
Dave.

__._,_.___
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
Recent Activity
Visit Your Group
Yahoo! News

Sexual Health

Get important

sex health news

Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Sitebuilder

Build a web site

quickly & easily

with Sitebuilder.

.

__,_._,___

No comments: