jolino said:Hi, you must keep in mind that you have to implement a gregorian calendar in software to have 365 and 366 days/year to know if the current February month have 28 or 29 days.
You can do it using some different methodes.
For instance, as you know the year 2000 it was one leap year.
So, 2004, 2008, 2012 are leap years.
If your PIC calendar starts in 2000, is very easy to know if a specific year is or not the leap year.
Example: you can write a table with this years from 2000 to 2100 that results in 25 values; 0x00, 0x04, 0x08, 0x12...
Whenever he will be 28 of February, before passing to 1 of April, we go to see if the year is leap, by comparing the present year with the table.
IF the result TRUE, the next day must be 29 ELSE must be April 1.
Another way is take current year value and subtract sucessively 4 until the result equal to zero or negative (result with bit 7 equal to 1).
IF equal to ZERO the year is 366 days ELSE is 365.
All this can be done in assembly.
Concerning jumping two or three days I think that your ideia is correct.
I hope this helps
Regards
jolino said:Hi markelectro,
1st my apologizes for a little mistake when i refer 1 April, in fact the right is 1 March.
- Back to the original question, if i understand you right, your clock is already running, including day change pulses.
- You just need one circuit to add additional pulses in the months that have less than 31 days, right?
Imagining that you use one pic to do the job without leap year.
The pic must be syncronized with mechanics clock. I mean, the Day and Month in the Mechanic clock and in the Pic, must be the same.
This is because the pic must know in which months must generate additional pulses after follow (counting) the day change electro-mechanic pulses.
If this is what you want, i can help you writting a small piece of software to it and hardware design too, but just after you confirm this specifications to avoid working on something that serves to nothing.
Regards Jolino
jolino said:Hi picasm,
Let me tell you that, if this project was mine, i did not have doubts in choosing your solution.
Regards,
Jolino
Sorry, i understand your point of view.Original: markelectro
I am at a very novice level of Electronics
jolino said:Hi markelectro,
Sorry, i understand your point of view.
I don't know how is the electric circuit and with what voltage works.
If we can see it, really helps.
So, we can start with an optocoupler to read the day change pulse, one PIC12F629 (8pin) and one mini-relay to by-pass the pulse switch (integrated in your device).
Probably your clock have a power supply, can you tell us which voltage he have?
I don't know yet if you have any tool to program the pic.
Certainly the winpicprog that i see on of the moderator personal page, works.
Regards,
Jolino
Original: markelectro
At the moment I have a trianing program for Pic programming and this can be found at-
https://brunningsoftware.co.uk/index.htm
I have all three courses.
jolino said:Hi markelectro,
Very sorry, i have been very busy lately, so i don't see your message.
jolino said:Back to the original question and after read all messages again...
The suggested circuit, can be more simplified if your supply will be DC.
If is the case, is important also know if the (-) is connected directly to one of the coil points and if the (+) connects to the other coil point, intercepted by the electro-mechanic switch (the one that generate the day pulse).
In this case we can remove the four 1N4148 and substitute the relay by two transistores (BC547&BC327) and a few resistors.
jolino said:In the circuit, you can see one key and one Led.
This is need to tell the PIC in wich day and month is your callendar.
If you haven't this, the PIC it will never know when it must generate the appropriate pulses , right?
So, you can config this throught the key with the Led help.
I can tell you that i have a lot of circuits running like this.
jolino said:Software:
Is no use to lose time before you decide if this is the solution or not.
I'm absolutely secure that this hardware will work.
When and if you decide about the electronic solution, then we can talk about software.
jolino said:However i wait that you have trained some exercises in c that had certainly come with the tool that you acquired.
jolino said:Regards,
Jolino
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?