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 CCS Technical Support

Ds1302 alarm

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



Joined: 25 Apr 2011
Posts: 297

View user's profile Send private message

Ds1302 alarm
PostPosted: Sat Dec 29, 2012 12:48 pm     Reply with quote

Dear all, unfortunately after the design I noticed that the chip for the rtc are ds1302. These chips have no alarms so I need to make software alarms. Can someone explain how can I achieve this ?
temtronic



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

View user's profile Send private message

PostPosted: Sat Dec 29, 2012 2:20 pm     Reply with quote

comment
probably a few ways to do it ,depending on the PIC type and what 'alarm times' you need...

step one...save the 'alarm times' into RAM or EEPROM or hardcode into program memory. it's up to you to decides where to put them.

step two...in 'main' have a simple if(current_time==alarm_time){do this} type of code....

there are several examples on this forum and in the examples folder that
CCS supplies...
..also look at any DS RTC with alarms to see how they setup to do it..

how 'fancy' the code becomes depends on you as only you know you want it to work! In my energy control systems I only need a byte to store any 'alarm time',you'll probably need more..

hth
jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Dec 29, 2012 3:43 pm     Reply with quote

This thread has a discussion of how to set and detect an alarm from an
RTC chip that doesn't have built-in alarm registers:
http://www.ccsinfo.com/forum/viewtopic.php?t=33706
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