accuracy issues. Look at the oTimer options which include the ability
to put a 32.7KHz crystal on an IOline and get a real RTC signal for the
oTimer output. However, you'd have to write your own functions to
decode it, it will be closer to correct for time for a longer time.
Note, to keep the RTC in proper sync you cannot interrupt power to it.
DLC
minghui1984 wrote:
> Hi guys, i got a question. As i am dealing with solar tracking
> device, i would like to be able to feedback the time to the PIC. i
> look through the object list and found several options that i could
> use. Thought i just ask if there is any shorter way of doing it.
>
> What i need:
> Implementing a "clock" by using counters, using the execution cycle
> and frequency of the PIC (in this case ooPIC is 20MHz). I would
>
> counter_sec++;
> if counter_sec == 60
> {
> counter_min++;
> counter_sec = 0; 'resetting it back to 0
> }
> if counter_min == 60
> {
> counter_hrs++;
> counter_min = 0; 'resetting it back to 0
> }
>
> if counter_hrs == 24
> {
> day++;
> counter_hrs =0; 'resetting it back to 0
> }
>
> Loop
>
> My question is will this code work?
> how do i make this function keep on running outside the main function
> Is this a good way of "telling" the time? Cos my device is a
> standalone kind so no PC/Laptops will be connected once its configured
>
> In the object list, there are oTimer, oCounter, oClock, are these
> suited for the purpose? I looked thru the example, but i dun quite
> get it. >.<
>
> Anyone got any hints to how i might make this thing work?
>
> Thanks once again
> Minghui
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
>
--
------------------------------------------------------
Dennis Clark ooPIC Tech Support
www.oopic.com
------------------------------------------------------
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment