RTC Interrupt

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
mervinm
Flowcode v5 User
Posts: 21
Joined: Thu Oct 30, 2008 4:01 pm
Been thanked: 3 times

RTC Interrupt

Post 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.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: RTC Interrupt

Post 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.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: RTC Interrupt

Post 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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

mervinm
Flowcode v5 User
Posts: 21
Joined: Thu Oct 30, 2008 4:01 pm
Been thanked: 3 times

Re: RTC Interrupt

Post by mervinm »

Hi Acestu,

Thanks for the response. I will search for it.

Mervin

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: RTC Interrupt

Post 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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

mervinm
Flowcode v5 User
Posts: 21
Joined: Thu Oct 30, 2008 4:01 pm
Been thanked: 3 times

Re: RTC Interrupt

Post 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.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: RTC Interrupt

Post by dazz »

Hi Mervinm
Follow the link in my sig to sign up for the v5 forums

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

mervinm
Flowcode v5 User
Posts: 21
Joined: Thu Oct 30, 2008 4:01 pm
Been thanked: 3 times

Re: RTC Interrupt

Post by mervinm »

Dazz, thanks. I have registered on the Flowcode v5 forum. I will post my previous message there.

Post Reply