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

[oopic] Re: Strange serial operations

> That code is far too slow to keep up with 9600 bps data. It can be
> improved, but it'll still drop characters:

That's what I was suspecting. I don't think I can set the other
peripheral to a lower baud rate. That being said, it may support
hardware flow control. I'll try to figure that out.

> BTW, very nice indenting; it's a refreshing change.

Ummm, thanks.... looking back it seems as though the indents only show
up during the message composition stage.


------------------------------------

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/

Re: [oopic] Strange serial operations

At 11:05 AM 4/1/2008, Matt Elias wrote:
> Do
> If Serial.Received = 1 Then
> LED.State.Invert
> buffer.Value=Serial.Value
> buffer.Location=buffer.Location+1
> LED.State.Invert
> End If

That code is far too slow to keep up with 9600 bps data. It can be
improved, but it'll still drop characters:

do
while serial.received then
buffer = serial
buffer.location = buffer.location + 1
end while


If oBuffer has an increment method, try using it.

At 9600 bps, you can send 960 characters per second. In that time,
the OOPic can execute about 350 lines of user source code. You do the math...

Is there any way to reduce the data rate to 1200 bps?

BTW, very nice indenting; it's a refreshing change.

> If In=1 Then
> Wait Until In=0
> LED.State.Invert
> buffer.Location=0
> For i = 1 To 20
> Serial.Value=buffer.Value
> buffer.Location=buffer.Location+1
> Next i
> buffer.Location=0
> For i = 0 To 30
> buffer.Value=i+48
> buffer.Location=buffer.Location+1
> Next i
> buffer.Location=0
> LED.State.Invert
> End If
> Loop
>End Sub

------------------------------------

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/

[oopic] Re: reading a high speed D-wave pulse from a compass

Got a link to the datasheet?

Richard


--- In oopic@yahoogroups.com, "jerry_baccari" <jerry_baccari@...>
wrote:
>
> Hello,
> I'm trying to read the output of a digicourse compass. The output
is a
> formatted d-wave operating at about 50Mhz. The format of the D-wave
> consists of short spikes for each degree of heading. So if the
compass
> is pointing 1 degree before north there are 359 peaks.
> I'm using a OOPIC B2 so the oCycleTimeH or the oPulseTimeH are not
> available to me.
> I've tried the oCounter2H and the value continually increases until
it
> resets. So I'm thinking that some sort of timing object is needed
to
> sync it with the pulse. Is this possible or are there other methods
I
> can use.
>
> Thanks in advance,
> Jerry
>

------------------------------------

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/

[oopic] reading a high speed D-wave pulse from a compass

Hello,
I'm trying to read the output of a digicourse compass. The output is a
formatted d-wave operating at about 50Mhz. The format of the D-wave
consists of short spikes for each degree of heading. So if the compass
is pointing 1 degree before north there are 359 peaks.
I'm using a OOPIC B2 so the oCycleTimeH or the oPulseTimeH are not
available to me.
I've tried the oCounter2H and the value continually increases until it
resets. So I'm thinking that some sort of timing object is needed to
sync it with the pulse. Is this possible or are there other methods I
can use.

Thanks in advance,
Jerry


------------------------------------

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/

Re: [oopic] Strange serial operations

I am using type S, ver B.2.2+. If I send data serially to the OOPic from
my PC, it all seems to work fine. The manual for the load cell display
that I am using states that "Data from MSG (Mars Scale Display) is
always terminated by CR." In Hyperterminal, that CR causes a line feed
and a character return. Is that messing with the OOPic? You'll see that
I "clear" the buffer with a series of ascii values before I send the
scale display's data to the oopic to help determine what's going on.
Sometimes the returned buffer values include a character return,
sometimes it also has a line feed but never both at the same time and
never the complete "kg" or "lb" unit.

ooPIC.Snode=1
Dim Serial As New oSerialPort
Dim In As New oDIO1 'input to trigger serial output
Dim LED As New oDIO1
Dim buffer As New oBuffer(30)
Dim i As Byte

Sub Main()
In.IOLine=26
In.Direction=cvInput
LED.IOLine=25
LED.Direction=cvOutput

Serial.Baud = cv9600
Serial.Operate = cvTrue

buffer.Location=0
For i = 0 To 30
buffer.Value=i+48
buffer.Location=buffer.Location+1 'buffer does not automatically
advance, in contradiction to online manual
Next i
buffer.Location=0

Do
If Serial.Received = 1 Then
LED.State.Invert
buffer.Value=Serial.Value
buffer.Location=buffer.Location+1
LED.State.Invert
End If

If In=1 Then
Wait Until In=0
LED.State.Invert
buffer.Location=0
For i = 1 To 20
Serial.Value=buffer.Value
buffer.Location=buffer.Location+1
Next i
buffer.Location=0
For i = 0 To 30
buffer.Value=i+48
buffer.Location=buffer.Location+1
Next i
buffer.Location=0
LED.State.Invert
End If
Loop
End Sub


ooPIC Tech Support wrote:
>
> What type of ooPIC are you using? Can you post some code?
>
> thanks,
> DLC
>
> m_elias wrote:
> > I'm using a TTL to RS232 converter to communicate with a load cell
> > scale Display. Sending commands to the Display works as expected but
> > receiving has some unexpected results. I can successfully communicate
> > with both OOPic and Display from my PC without any hardware control,
> > which is how I have the OOPic to Display setup. I am using the
> > oSerialPort object and my program copies the serial.value to
> > buffer.value as soon as the serial.received goes high. An example of
> > the value that is being sent to the OOPic from the Display is within
> > the quotes, " 0.355 kg" followed by a crlf. The leading
> > spaces/blanks and the numbers seem to consistently make it, but only 1
> > trailing space follows with a couple random characters, often either
> > ascii value 223 or 164. I can't see any reason why it should be a
> > buffer overrun. There is nothing else going on at the same time.
> > Anyone have any suggestions/experience with the OOPic's serial UART?
> >
> >
> > ------------------------------------
> >
> > 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/

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

--- In oopic@yahoogroups.com, "bimityedye" <bimityedye@...> wrote:
>
> --- In oopic@yahoogroups.com, "rtstofer" <rstofer@> wrote:
> >
> > --- In oopic@yahoogroups.com, "bimityedye" <bimityedye@> wrote:
> > >
> > > --- In oopic@yahoogroups.com, "rtstofer" <rstofer@> wrote:
> > > >
> > > > --- In oopic@yahoogroups.com, "minghui1984" <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
> >
> Thanks Rich
> That's just what I was lookin' for. I overlooked that zip file the
> first time around. Another great item on that web site is the
> breakout boards for the surface mount chips-to-dual in-line chips.
> Finding a great looking chip and realizing it was only available in
> surface mount was always dissapointing to me. Thanks again!
> Dave W.
>

I was lazy when I posted the original link. There is a DIP version
http://www.sparkfun.com/commerce/product_info.php?products_id=8129

I sometimes use DIP versions for breadboarding but I have pretty much
migrated to surface mount for anything I build. There are pros and
cons to surface mount but now that I can solder the various packages
(not as hard as I first thought), I prefer the higher density and the
possibility of having most of the bottom layer available for a ground
plane.

Richard

------------------------------------

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/

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

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

<*> 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/