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.

Sunday, December 23, 2007

Re: [oopic] Re: Using IO Lines? R to R Board Comm

Don't forget that you can filter using VC's as well. oMath and others
work well for this. Sadly, I have found that oDDELink is anything BUT
real time, it can take a few hundred milliseconds for the data to
transfer - If this is acceptable, go for it. Another way is to put the
data on an oDIO8 with signal pairs between the two ooPIC R boards to
send data back and forth. This is simpler than using oDDELink in that
the cable is easier to make. ;) oDDELink has an issue when two ooPIC R
boards are used, we've never been able to figure this out either, but
they just don't talk unless you do <something> just right with just the
right value of resistors. The oDIO8 bus approach is faster and simpler
to implement. In fact, by using oDIO8 you can probably do the whole
thing with VC's and never run any interpreted code. Since this is a
class I'm not going to give you the answer, but look at these objects:
oDIO8
oDIO1
oBus
oWire
oTimer
oFlipFlop
oCountDown
oChanged

It might just be possible to do it all in VC's. Do some careful state
diagrams.

Have fun,
DLC

rtstofer wrote:
> --- In oopic@yahoogroups.com, "red71956" <kdwyer@...> wrote:
>
>> Question:
>> If I have only one compass (CMPS03) that connects to the I2C bus on an
>> R board, what is the simplest method to ensure a second R board, also
>> connected via I2C, gets the same reading in near realtime? Board 1
>> (with the compass) also has IR rangers that must transfer data.
>> Options include:
>> Only two basic units of information need to be transferred, 'Heading'
>> and 'ObstacleRange'. Use DDELink? Or IO lines? Hardwired to Serial Port?
>>
>
> One thing you CAN'T do is connect the two LOCAL I2C buses together and
> hang the sensors on the resulting single bus. The fact that the
> EEPROMS would be visible to both machines and the resulting collisions
> make that obvious.
>
> oDDELink is probably workable. The host CPU gets the values and
> stuffs them in the shared object. The client CPU sees the values
> immediately thereafter.
>
> The OOPic is almost useless when it comes to serial IO. I think I
> would avoid that approach.
>
>
>
>> Extra credit:
>> Extensive use of Virtual Circuits
>>
>
> Sure, use a timer to trigger an event to read the sensors and stuff
> the results. I haven't looked to see if a timer event can be slow
> enough to be reasonable. Or, a first firing of the event starts the
> sensing operation, a second firing grabs the values and a third firing
> stuffs the results. The advantage to this is that the event code
> doesn't tie up the processor for a long period of time.
>
>
>> Show all work.
>>
>
> The function of my code is ALWAYS obvious to the most casual observer.
> Comments are never needed because any competent person can see what I
> had in mind.
>
> Richard
>
>
>
>
>
> 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: Serial Port....Power...OOPIC-R

--- In oopic@yahoogroups.com, "aravind_2917" <aravind_2917@...> wrote:
>
>
> Thanks a lot for your replies...
>
> Am totally new to all these things. Its a part of btech final year
> project. Can you please tell me what exactly i should do?..step by step
> if u can pls...please bear with me....
> The programming part i can manage..only the hardware part...
>
> In one of the website,ive seen a project in which they used serial
> bluetooth adapter....they said :
>
> "we bridge the CTS/RTS lines and the DCE/DTE lines together. This way
> if the adapter was waiting on a Clear to Send signal before it would
> actually pass the data out of its buffer to the OOPIC, it would fool
> itself by sending its own signal. It worked like a charm! ".
>
> Can you please explain me this...how to do it?...where and how do i
> bridge those lines?
>
> once again thanks a lot.


Get a male and female DB-9 connector. The male end will connect to
the OOPic, the female to the bluetooth dongle.

On the male end, bring out pins 2, 3 and 5 and connect them to the
female end on pins 2, 3 and 5, straight through. This will give you
TXD, RXD and GND.

If you want to power the dongle from pin 9 of the DB9, connect the
power source between pins 9 and 5 of the female connector. Note that
you now have TWO wires to connect to pin 5 if you use a 9V battery (I
would). If you grab power (either 5V or input power) from the OOPic,
you won't need the redundant ground wire on pin 5. Apparently the
dongle can work from 5V. If I wanted to try this, I would take that
+5 from the same pin we are going to use for CTS - see below. There
are a lot of +5V pins on the various headers. Try to use the ones
connected to EP1, EP2, EP3 or EP4. Avoid the others that are
connected to the voltage regulator for the OOPic itself. You can
probably use the power source that feeds the OOPic if it is less than 11V.

Personally, I would go with the separate 9V battery just to get the
voltage up well above minimum and to get it away from the OOPic power
supplies.

On the male connector, jumper pins 7 & 8 RTS/CTS. You could also
jumper pins 4, 6 & 1 (DSR, DTR and CD) but they aren't used by the
dongle. The jumper on pins 7 & 8 should satisfy the dongle.

If you decide you need flow control (and you probably will), remove
the jumper between pins 7 & 8 on the male connector. Select an IOLine
to use for the oSerialPort flow control (IOLineF) and connect it to
the base of a 2n2222 (or any small signal NPN) transistor through a 1k
resistor. Connect the emitter to logic ground and connect a 1k
pull-up resistor between the collector and +5V. All 3 of these
(signal, +5, gnd) are available on the 3 pin header for the IOLine.
Now, connect a wire from the collector to pin 8 (CTS) of the male DB-9
connector. This transistor is required to invert the sense of the CTS
signal. Ordinarily, this would be done with a level shifter.

The OOPic is a DCE device so you want your dongle to be a DTE device
and, by default, it is.

All of the above is a GUESS. I don't have a bluetooth dongle so it is
a certainty that I have never done this. Good luck!

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: Serial Port....Power...OOPIC-R

Thanks a lot for your replies...

Am totally new to all these things. Its a part of btech final year
project. Can you please tell me what exactly i should do?..step by step
if u can pls...please bear with me....
The programming part i can manage..only the hardware part...

In one of the website,ive seen a project in which they used serial
bluetooth adapter....they said :

"we bridge the CTS/RTS lines and the DCE/DTE lines together. This way
if the adapter was waiting on a Clear to Send signal before it would
actually pass the data out of its buffer to the OOPIC, it would fool
itself by sending its own signal. It worked like a charm! ".

Can you please explain me this...how to do it?...where and how do i
bridge those lines?

once again thanks a lot.


--- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...>
wrote:
>
> It does not - You'll have to hack that in yourself, which is a trivial
> process, in fact, it is a very neat solution to get power there.
>
> DLC
>
> aravind_2917 wrote:
> > hello,
> >
> > Am planning to buy a serial bluetooth
adapter(FireFly,www.sparkfun.com)
> > to connect it to the serial port of an oopic-R board.
> >
> > The specifications of serial bluetooth adapter says that the adapter
> > accepts power from PIN 9 OF THE DB serial port if available,or it
should
> > be powered externally.It requires 5 V DC.
> >
> > Will this work with oopic?...Does OOPIC supply power on pin 9 of the
> > serial port?..Its a problem to power the serial adapter externally..
> >
> > so,should i go ahead and buy it?
> >
> > thank you.
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>
> --
> ------------------------------------------------------
> Dennis Clark ooPIC Tech Support
> www.oopic.com
> ------------------------------------------------------
>


Thanks a lot for your replies...

Am totally new to all these things. Its a part of btech final year
project. Can you please tell me what exactly i should do?..step by step
if u can pls...please bear with me....
The programming part i can manage..only the hardware part...

In one of the website,ive seen a project in which they used serial
bluetooth adapter....they said :

"we bridge the CTS/RTS lines and the DCE/DTE lines together. This way
if the adapter was waiting on a Clear to Send signal before it would
actually pass the data out of its buffer to the OOPIC, it would fool
itself by sending its own signal. It worked like a charm! ".

Can you please explain me this...how to do it?...where and how do i
bridge those lines?

once again thanks a lot.

[Non-text portions of this message have been removed]


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: Using IO Lines? R to R Board Comm

--- In oopic@yahoogroups.com, "red71956" <kdwyer@...> wrote:
>
> Question:
> If I have only one compass (CMPS03) that connects to the I2C bus on an
> R board, what is the simplest method to ensure a second R board, also
> connected via I2C, gets the same reading in near realtime? Board 1
> (with the compass) also has IR rangers that must transfer data.
> Options include:
> Only two basic units of information need to be transferred, 'Heading'
> and 'ObstacleRange'. Use DDELink? Or IO lines? Hardwired to Serial Port?

One thing you CAN'T do is connect the two LOCAL I2C buses together and
hang the sensors on the resulting single bus. The fact that the
EEPROMS would be visible to both machines and the resulting collisions
make that obvious.

oDDELink is probably workable. The host CPU gets the values and
stuffs them in the shared object. The client CPU sees the values
immediately thereafter.

The OOPic is almost useless when it comes to serial IO. I think I
would avoid that approach.


> Extra credit:
> Extensive use of Virtual Circuits

Sure, use a timer to trigger an event to read the sensors and stuff
the results. I haven't looked to see if a timer event can be slow
enough to be reasonable. Or, a first firing of the event starts the
sensing operation, a second firing grabs the values and a third firing
stuffs the results. The advantage to this is that the event code
doesn't tie up the processor for a long period of time.

>
> Show all work.

The function of my code is ALWAYS obvious to the most casual observer.
Comments are never needed because any competent person can see what I
had in mind.

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] Using IO Lines? R to R Board Comm

Question:
If I have only one compass (CMPS03) that connects to the I2C bus on an
R board, what is the simplest method to ensure a second R board, also
connected via I2C, gets the same reading in near realtime? Board 1
(with the compass) also has IR rangers that must transfer data.
Options include:
Only two basic units of information need to be transferred, 'Heading'
and 'ObstacleRange'. Use DDELink? Or IO lines? Hardwired to Serial Port?

Extra credit:
Extensive use of Virtual Circuits

Show all work.


(Just kidding.)


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: Help with incoming Serial Communcation from PC to ooPic-R I2c LCD03

LOL I have enough problems trying to make it work, let alone trying
to make it work after 6 months!
But I too restrict the comments in my code, long enough to help
explain/clarify but not iambic pentameter. I make VERY liberal use of
cut-n-paste with all the code snippets I can find (why re-invent the
wheel?) and if they don't have comments I usually add some. My code
is FAR from 'optimal' but I can usually get it to (sort of) work.
That's one of the reasons I like the Oopic - using "BASIC" makes it
easy(er) to read and understand. I know, I'll get up to speed on some
flavor of C, but until then I can use my Oopic anyway!

--- In oopic@yahoogroups.com, "Dennis K. Deckmann" <dkdeckmann@...>
wrote:
>
>
> I do as you, generally fully specify everything so as to leave
myself
> clues in case it is a while before I get back to something...
>
> I also tend to trim off irrevalent stuff from the bottoms of long
> messages...
>
> --- In oopic@yahoogroups.com, "red71956" <kdwyer@> wrote:
> >
> > Is there any reason NOT to use .Value? Does this take more
(compiled)
> > space than not using it?
> > I often use a more verbose mode, heavily commented, especially if
I
> > may not modify it. Weeks, or months later all the extra comments
and
> > such makes it easier to remember what it is I was trying to
> > accomplish.
> >
>



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] Re: SRF02 on an OOpic-R

Thanks again.

All I seem to be getting from any of the locations is '253'

I guess it is not connected as when I send an '81' to loation '0'
the LED on the SRF02 does not flash ( which it should ).

Will keep playing :)

All the best.

Richard
----- Original Message -----
From: "rtstofer" <rstofer@pacbell.net>
To: <oopic@yahoogroups.com>
Sent: Sunday, December 23, 2007 1:25 AM
Subject: [oopic] Re: SRF02 on an OOpic-R


> --- In oopic@yahoogroups.com, "Trikky2" <richard@...> wrote:
>>
>> Hi Richard,
>>
>> Thanks for the reply.
>>
>> Yes it is wired uplike that.
>>
>> Good idea about seeing if I can get the software revision
>> from location 0.
>>
>> I think I'll have to invest in a display ... Should make
>> Debugging easier :)
>>
>> All the best.
>>
>> Richard
>
> Just grab the low byte and use str$() to convert it to ASCII and send
> it out the serial port to the PC using oSerialPort.
>
> Use part of the code for the oSerialPort object.
>
> Somewhere on the menu bar of the IDE, there is a way to get to the
> terminal window. The OOPic output will show up there. You may have
> to click in the window or hit <Enter> - at least I seem to remember
> doing something like that with Ver. 5. I'm not on my WinXP box at the
> moment so I can't really test it.
>
> Richard
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>


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/