600V3Phase
Junior Member level 3
Hello,
I am using a PIC32 uC and on board space is critical. I have created a timer Interupt routine which constantly increments an extern variable. The count this variable holds is the number of 4 ms time slices.
Therefore I am able to count the time slices and decern seconds, minutes, hours etc...
My question is, I now need to make a calendar time clock. In other words for example lets say that I need something to turn on at 10:00am and turns off at 5pm on Mondays, Wednesday's and Sunday's.
So I am thinking that I can simply tick off 24 hours per day and x amount of days per month at 12 months a year and then compare my values to the desired time schedule described above. And for the day light savings time I check for (October/April) months to adjust the time 1 hour back/front. And for the leap year I add a day every 4 years for the month of February.
Now I am thinking of programming this myself from scratch in the uC as I don't think this will be too difficult. What do you guys think? Is there much more to this? Do you guys think its worth the trouble to do it myself or go with one of em external RTC chips that hold the calendar data (but in consequence will take up room on my board)?
Thanks all for your feedback !
I am using a PIC32 uC and on board space is critical. I have created a timer Interupt routine which constantly increments an extern variable. The count this variable holds is the number of 4 ms time slices.
Therefore I am able to count the time slices and decern seconds, minutes, hours etc...
My question is, I now need to make a calendar time clock. In other words for example lets say that I need something to turn on at 10:00am and turns off at 5pm on Mondays, Wednesday's and Sunday's.
So I am thinking that I can simply tick off 24 hours per day and x amount of days per month at 12 months a year and then compare my values to the desired time schedule described above. And for the day light savings time I check for (October/April) months to adjust the time 1 hour back/front. And for the leap year I add a day every 4 years for the month of February.
Now I am thinking of programming this myself from scratch in the uC as I don't think this will be too difficult. What do you guys think? Is there much more to this? Do you guys think its worth the trouble to do it myself or go with one of em external RTC chips that hold the calendar data (but in consequence will take up room on my board)?
Thanks all for your feedback !
Last edited: