CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

#use i2c with DS1338

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
BruceS Anderson



Joined: 31 Oct 2014
Posts: 3
Location: Scotland

View user's profile Send private message

#use i2c with DS1338
PostPosted: Fri Nov 21, 2014 9:51 am     Reply with quote

I am using the driver for the DS1338 RTC with a PIC18F66K22 and force-sw setup as I do not have any spare serial ports.

I am using latest MplabX.

The code compiles but seems to hang or take a long time to perform any function such as rtc_get_date().

Is there any way of debugging the CCS embedded functions?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 21, 2014 9:56 am     Reply with quote

Run this program on it. See if it finds the ds1338 chip.
http://www.ccsinfo.com/forum/viewtopic.php?t=49713
Ttelmah



Joined: 11 Mar 2010
Posts: 19346

View user's profile Send private message

PostPosted: Fri Nov 21, 2014 10:01 am     Reply with quote

and as a further comment, the internal functions are just as much there are anything else. You can step them in the program memory window as easily as anything else.

However, if you change the line near the top of the processor include file:

#nolist

Just 'remming' it out as:

//#nolist

Then the assembler will be visible in the listing file as well. Makes debugging a lot easier.

PCM_programmers I2C scanning program (that he has pointed you to), should be a 'standard' tool as the first place to go with any I2C problem. No point in trying to debug the functions, if the chip is not responding correctly....
temtronic



Joined: 01 Jul 2010
Posts: 9164
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Nov 21, 2014 10:16 am     Reply with quote

hmmm is the whole program 'slow' ? If so, did you compiler in 'debug' mode ? Needs to be compiled in 'release' mode to have the PIC run right.

Other possibilities include having 'debug' enabled, maybe even having WDT enabled ?

Wrong 'clock' speed ? Does the PIC run the '1Hz LED' program right ?

hth
jay
BruceS Anderson



Joined: 31 Oct 2014
Posts: 3
Location: Scotland

View user's profile Send private message

solved
PostPosted: Mon Nov 24, 2014 5:58 am     Reply with quote

Hi I have found the fault - I did not have the pull-ups on the 2 control lines.
Now works correctly.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group