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

void ds1307_display()
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19216

View user's profile Send private message

PostPosted: Thu Nov 15, 2018 3:30 am     Reply with quote

It won't....

You do realise the clock has to be initialised before it can run?.

The time needs to be set into the chip, and the CH bit (bit 7 of the seconds register), needs to be cleared _before_ the chip will start giving a time. You can't just read it and expect to see a time.
As the chip wakes from 'new', the clock is disabled.

Realistically also, the update rate needs to be a lot slower. 50mSec is not enough loop delay to allow the LCD to draw.

Also the I2C setup should be:
#use I2C(master, I2C1, SLOW = 100000)

Your chip does not support the fast protocol, so needs to use SLOW.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
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