Re: Providing a clock/time to the PIC - minghui1984 - Mar 30 10:59:08 2008
--- In o...@yahoogroups.com, Ian Drennan
wrote:
>
> 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?
> >
> >
> I would think the oRTC object would be best suited for your
purpose. It
> is an object that maintains a real-time clock. It's been a few
years
> since I last played with this object but I do remember that it was
> accurate to about 2 sec in a 24 hour period.
> Also it will lose its current state when power to the oopic is
interrupted.
>
> Good luck
>
> Ian
>
Thanks Ian, i will look into that. What if my power is not continous?
anyone else got any other ideas?
One more question. I saw on the archive message that its not possible
to implement inverse trigo functions, but is there any way i could
solve inverse functions?
THanks once again
Minghui
------------------------------------

(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )
Re: Providing a clock/time to the PIC - rtstofer - Mar 30 13:28:18 2008
--- In o...@yahoogroups.com, "minghui1984"
wrote:
> Thanks Ian, i will look into that. What if my power is not continous?
> anyone else got any other ideas?
>
Try http://www.sparkfun.com/commerce/product_info.php?products_id=99
If you add this to the local I2C bus, you might as well add that
floating point co-processor at the same time.
Richard
------------------------------------

(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )Re: Providing a clock/time to the PIC - bimityedye - Mar 31 19:40:04 2008
--- In o...@yahoogroups.com, "rtstofer"
wrote:
>
> --- In o...@yahoogroups.com, "minghui1984" wrote:
>
> > Thanks Ian, i will look into that. What if my power is not
continous?
> > anyone else got any other ideas?
> > Try http://www.sparkfun.com/commerce/product_info.php?products_id=99
>
> If you add this to the local I2C bus, you might as well add that
> floating point co-processor at the same time.
>
> Richard
>
Hi Rich
Just took your advice and ordered one of the coprocessors. After
looking at the datasheet about interfacing with the OOPIC I'm still
confused about communicating with it (coprocessor). Can you give me a
sample code that would demonstrate how to do this?
------------------------------------

(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )Re: Providing a clock/time to the PIC - rtstofer - Mar 31 20:29:25 2008
--- In o...@yahoogroups.com, "bimityedye"
wrote:
>
> --- In o...@yahoogroups.com, "rtstofer" wrote:
> >
> > --- In o...@yahoogroups.com, "minghui1984" wrote:
> >
> > > Thanks Ian, i will look into that. What if my power is not
> continous?
> > > anyone else got any other ideas?
> > >
> >
> > Try http://www.sparkfun.com/commerce/product_info.php?
products_id=99
> >
> > If you add this to the local I2C bus, you might as well add that
> > floating point co-processor at the same time.
> >
> > Richard
> >
> Hi Rich
> Just took your advice and ordered one of the coprocessors.
After
> looking at the datasheet about interfacing with the OOPIC I'm still
> confused about communicating with it (coprocessor). Can you give me
a
> sample code that would demonstrate how to do this?
>
The factory provides a BUNCH of OOPic code at
http://www.micromegacorp.com/oopic.html
The simple example (that does nothing) is umfpu-serial.osc. It
provides the entire framework for an application without actually
doing anything. You insert your own code - perhaps something trivial
like add a couple of numbers and send the result to the serial port
as a string. There are many other LCD examples that will provide
guidance.
There is also a reference guide specific to the OOPic
http://www.micromegacorp.com/downloads/documentation/uMFPU-V3_1%
20OOPic.pdf The guide also provides tutorials.
Alas, I haven't bought the chip... I don't have an application for
it at this time.
Richard
------------------------------------

(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )