Page 1 of 1

RTC Interrupt

Posted: Sun May 26, 2013 9:01 pm
by mervinm
Hi ,

I am to developing a project using the 16F877A connected to a D1307 to provide time and date information. I want to run a routine (to control a couple of stepper motors etc.), which will start at a specific time of day from Monday to Sunday, execute and stop at a specific time. I want to configure the start time and end time per day on any specific day. For times when the !6F877A is not executing the routine, it will basically be idle and just display the time on the LCD (if possible, to save power).

I'm not sure exactly how to implement this; do I have to constantly read time information from the D1307 and compare it to START_TIME. If equal, execute the routine, then stop. Thereafter start comparing times from the D1307 to the next configured START_TIME and so on. Is there a simpler method using an interrupt or something similar.

Thanks.

Re: RTC Interrupt

Posted: Sun May 26, 2013 9:29 pm
by kersing
I moved this question to a more appropriate forum. The tips & tricks forum is for sharing your tips and tricks, not for questions.

If you are a flowcode 4 or 5 user, please register for the appropriate forum using the links below.

Re: RTC Interrupt

Posted: Sun May 26, 2013 10:09 pm
by acestu
Hi Mervin,

I did a project on here which in the end used a pic device and DS1307 via I2C for time and date, it was the work of Enamul , maybe the code might help you, if you do a forum search for "24hour Timer RTC" you will find it...

Hope this helps
Acestu

Re: RTC Interrupt

Posted: Mon May 27, 2013 4:12 pm
by mervinm
Hi Acestu,

Thanks for the response. I will search for it.

Mervin

Re: RTC Interrupt

Posted: Wed May 29, 2013 6:41 pm
by acestu
Hi Mervin,

Look at the end of this thread and you will find Enamul has posted a daylight saving time version of an RTC date and time clock on a pic16f877A

http://www.matrixmultimedia.com/mmforum ... =29&t=8607


Hope this helps :D
Acestu

Re: RTC Interrupt

Posted: Sun Jun 02, 2013 7:20 pm
by mervinm
Guys,

Sorry if this is posted in the wrong forum. I could not find a link to post a new message under Flowcode 5 forum.

I connected up the DS1307 as per the following discussion:
http://www.matrixmultimedia.com/mmforum ... rtc#p46788

I am managing to download the code to the 16F887A and I get the LCD displaying "DS1307 programmed", but when I do a read, I just get zero's displayed for the date. I am not sure if the DS1307 is actually being programmed. How can test if the pic is actually communicating with the DS1307.
DS1307 is connected to PORTC, LCD to PORTB. I am running the DS1307 RTC Programmer code by John, and using his read routine to read from the DS1307. I am also running the Keypad version of the code by Enamul and getting the same result.

I am using the DT-26 oscillator. Is this the correct one for the RTC? Can somebody perhaps suggest the correct oscillator to use (part number).

Thanks.

Re: RTC Interrupt

Posted: Sun Jun 02, 2013 8:01 pm
by dazz
Hi Mervinm
Follow the link in my sig to sign up for the v5 forums

Regards
Dazz

Re: RTC Interrupt

Posted: Sun Jun 02, 2013 9:10 pm
by mervinm
Dazz, thanks. I have registered on the Flowcode v5 forum. I will post my previous message there.