This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Tuesday, April 1, 2008

Re: [oopic] Re: Providing a clock/time to the PIC

There are microstepping stepper motor controllers that you can use with
the ooPIC - although the ooPIC doesn't do FP math, you can't move a
stepper a fractional step either, it's all discrete so there are dodges
that can be used to simulate fractions. Lookup tables are the best bet,
you can set your resolution there.

DLC

minghui1984 wrote:
> Thanks all for the replies. More stuff learnt with every post. I just
> realised that oopic does not support double or float numbers? hmm
> this is because my application deals with controlling a stepper motor
> to move a solar tracker, not quite the usual applications that ppl
> use the oopic for. So i didn't realised when i ordered, how would i
> store a values from the calculations and calculate inverse. One more
> problem is i realised that only single step movement is possible for
> the stepper function. >.<
>
> Guess i have to make do, the oopic simple interfacing allows me to do
> the prototype that demostrates my solar tracking. Hmm perhaps i would
> list it as future improvement.
>
> Perhaps i would be able to explore more of this when i am finished
> with my deadline for the project. hehe
>
> Cheers,
> minghui
>
> --- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...>
> wrote:
>
>> The oRTC can make this a little simpler, but you'll still have some
>> 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
>
>
>
>
>
>

--
------------------------------------------------------
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:

http://docs.yahoo.com/info/terms/

No comments: