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, January 8, 2008

[oopic] Re: Program Resetting Upon Completion of Stepper Motor Script

--- In oopic@yahoogroups.com, "turgrid" <turgrid@...> wrote:
>


Besides what Dennis said, you should also be using a large value
reservoir cap to compensate for the inductance of the battery leads.

http://www.4qdtec.com/pwm-01.html#cap


- dan michaels
www.oricomtech.com
--- OOBOT40 Boards ---
=========================


> Yes, both the motor and oopic are on same power supply. Thanks for
> your reply.
>
> --- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@>
wrote:
> >
> > It sounds like as soon as you turn things on your power bus tanks
and
> > the ooPIC resets, which turns the power off allowing the ooPIC to
turn
> > back on. Are you running the motor on the same power supply as
the
> > ooPIC logic?
> >
> > DLC
> >
> > turgrid wrote:
> > > Hello,
> > >
> > > I am working with oopic-r c1.x+ and compiler 6.1.1. The h-
bridge
> > > we're using is the L298 and is wired correctly as per the data
sheet
> > > with ground and +5v for the oopic and the L298 both coming from
the
> > > same battery source. The following snippet of code is
> > > looping--resetting the oopic upon execution of the last line.
The
> > > behavior happens during similar scripts as well.
> > >
> > > code:
> > >
> > > oStepper stepper = New oStepper;
> > >
> > > Void Main(Void) {
> > > ooPIC.Delay = 500;
> > > stepper.IOPack = 3;
> > > stepper.Phasing = 1;
> > > stepper.Mode = 0;
> > > stepper.Rate = 124;
> > > stepper.Value = 800;
> > >
> > > stepper.Operate = 1
> > > }
> > >
> > > In this sample case, the stepper travels 800 steps and restarts
and
> > > travels another 800 steps and restarts, etc.
> > >
> > > Why is it doing this and how can I stop it from resetting?
Thanks in
> > > advance.
> > >
> > >
> > >
> > >
> > >
> > >
> > > 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/

Re: [oopic] Program Resetting Upon Completion of Stepper Motor Script

When connecting any electromechanical devices (relays, motors etc.) to a circuit it is always a good bet that they will generate spikes and noise back into the circuit driving them. The best bet is to use a separate power supply. You will still have noise feeding back on the control pin to the microprocessor. It is best to make sure that you use the proper bypass capacitors to help filter the noise out. I believe most relay circuits also employ reverse diodes to shunt any reverse spike voltages.

Take a look at the following article for a good explanation of this.

http://www.seattlerobotics.org/encoder/jun97/basics.html

Hop this is of some help, Wayne..

ooPIC Tech Support <dennis.clark@oopic.com> wrote: It sounds like as soon as you turn things on your power bus tanks and
the ooPIC resets, which turns the power off allowing the ooPIC to turn
back on. Are you running the motor on the same power supply as the
ooPIC logic?

DLC

turgrid wrote:
> Hello,
>
> I am working with oopic-r c1.x+ and compiler 6.1.1. The h-bridge
> we're using is the L298 and is wired correctly as per the data sheet
> with ground and +5v for the oopic and the L298 both coming from the
> same battery source. The following snippet of code is
> looping--resetting the oopic upon execution of the last line. The
> behavior happens during similar scripts as well.
>
> code:
>
> oStepper stepper = New oStepper;
>
> Void Main(Void) {
> ooPIC.Delay = 500;
> stepper.IOPack = 3;
> stepper.Phasing = 1;
> stepper.Mode = 0;
> stepper.Rate = 124;
> stepper.Value = 800;
>
> stepper.Operate = 1
> }
>
> In this sample case, the stepper travels 800 steps and restarts and
> travels another 800 steps and restarts, etc.
>
> Why is it doing this and how can I stop it from resetting? Thanks in
> advance.
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>

--
------------------------------------------------------
Dennis Clark ooPIC Tech Support
www.oopic.com

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




---------------------------------
Never miss a thing. Make Yahoo your homepage.

[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: Program Resetting Upon Completion of Stepper Motor Script

Yes, both the motor and oopic are on same power supply. Thanks for
your reply.

--- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...> wrote:
>
> It sounds like as soon as you turn things on your power bus tanks and
> the ooPIC resets, which turns the power off allowing the ooPIC to turn
> back on. Are you running the motor on the same power supply as the
> ooPIC logic?
>
> DLC
>
> turgrid wrote:
> > Hello,
> >
> > I am working with oopic-r c1.x+ and compiler 6.1.1. The h-bridge
> > we're using is the L298 and is wired correctly as per the data sheet
> > with ground and +5v for the oopic and the L298 both coming from the
> > same battery source. The following snippet of code is
> > looping--resetting the oopic upon execution of the last line. The
> > behavior happens during similar scripts as well.
> >
> > code:
> >
> > oStepper stepper = New oStepper;
> >
> > Void Main(Void) {
> > ooPIC.Delay = 500;
> > stepper.IOPack = 3;
> > stepper.Phasing = 1;
> > stepper.Mode = 0;
> > stepper.Rate = 124;
> > stepper.Value = 800;
> >
> > stepper.Operate = 1
> > }
> >
> > In this sample case, the stepper travels 800 steps and restarts and
> > travels another 800 steps and restarts, etc.
> >
> > Why is it doing this and how can I stop it from resetting? Thanks in
> > advance.
> >
> >
> >
> >
> >
> >
> > 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/

Monday, January 7, 2008

Re: [oopic] Problem with events.

Adding to what Richard notes: you have to declare objects globally,
check out the oEvent[x] manual pages. An event will ONLY trigger when
the .Operate line moves from logic 'low' to logic 'high'. It will not
re-trigger until it is moved low and then high again. You don't say how
you have wired your inputs so I don't know what your values are going to
be. If you are using a button in the usual way then it will be normally
logic high and go low when the button is pressed. This means that the
oWire.invertout will need to be set to cvTrue to reverse the logic of
that signal.

DLC

aravind_2917 wrote:
> Iam trying to execute a piece of code whever serial data is recieved
> over the Serial port...I have oopic-R c.1.1+ firmware...till now i
> have not been successful with any event driven program..can u please
> tell me whats wrong with the following code...
>
> Delay=2000;
> oEvent ev=New oEvent;
> oSerialPort sp=New oSerialPort;
> Void main(Void){
> Delay=2000;
>
> oLED l=New oLED;
> oWire w=New oWire;
> oWire w2=New oWire;
>
>
> ev.Operate=0 // initially to make sure ev.operate=0
> l.IOLine=5;
> sp.Operate=1;
>
> w.Input.Link(sp.Received);
> w.Output.Link(l.Operate);//trying to switch on an in built led
> w.Operate=cvTrue;
>
> w2.Input.Link(sp.Received);
> w2.Output1.Link(ev.Operate);
> w2.Operate=cvTrue;
>
> }
>
> Void ev_Code(){ //this code is not being executed
> oLED l3=New oLED;
> l3.IOLine=7;
> l3.TurnOn;
> oInt i=New oInt;
> While(sp.Received!=0){ //trying to read from sp buffer
> i=sp.Value; //till sp.recieved is set to 0.
> }
> }
>
> someone give me a code with which i can test whether events are
> working on my board...OOPIC-R c.1.1+
>
> Thank you
>
>
>
>
> 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/

Re: [oopic] Interpreting serial data.

Are you sending ASCII characters in both directions? You simply use a
"case" or "switch" construct to compare with the data being sent to the
ooPIC. There are literally thousands of examples showing this kind of
simple control structures. You need to write down specifically what you
want to do and organize how you want to do it. Do you have much
experience with programming? If not it will be to your benefit to check
out some books or C or BASIC programming to learn how to use those types
of constructs.

Welcome to embedded programming! :)

DLC

aravind_2917 wrote:
> hello,
>
> Iam trying to communicate with oopic from my mobile over the serial
> port using bluetooth dongle...everything is working fine...i can make
> out that data is being transmitted to the oopic and oopic is receiving
> the data...
>
> Iam sending single character from the mobile...like 's' for example...i
> can even send a single byte from the mobile..
>
> Now,how do i interpret the data received by OOPIC...am using
> oSerialPort object...
>
> oSerailPort sp=new oSerialPort;
> sp.Operate=1;
>
> i want to compare the values received ,with predefined values and carry
> out other tasks accordingly...like ,start a motor if 's' is
> received..stop the motor if 't' is received...How do i do that?..what
> are the conversions and comparisions involved?
>
>
>
>
>
> 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/

Re: [oopic] Program Resetting Upon Completion of Stepper Motor Script

It sounds like as soon as you turn things on your power bus tanks and
the ooPIC resets, which turns the power off allowing the ooPIC to turn
back on. Are you running the motor on the same power supply as the
ooPIC logic?

DLC

turgrid wrote:
> Hello,
>
> I am working with oopic-r c1.x+ and compiler 6.1.1. The h-bridge
> we're using is the L298 and is wired correctly as per the data sheet
> with ground and +5v for the oopic and the L298 both coming from the
> same battery source. The following snippet of code is
> looping--resetting the oopic upon execution of the last line. The
> behavior happens during similar scripts as well.
>
> code:
>
> oStepper stepper = New oStepper;
>
> Void Main(Void) {
> ooPIC.Delay = 500;
> stepper.IOPack = 3;
> stepper.Phasing = 1;
> stepper.Mode = 0;
> stepper.Rate = 124;
> stepper.Value = 800;
>
> stepper.Operate = 1
> }
>
> In this sample case, the stepper travels 800 steps and restarts and
> travels another 800 steps and restarts, etc.
>
> Why is it doing this and how can I stop it from resetting? Thanks in
> advance.
>
>
>
>
>
>
> 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: Problem with events.

--- In oopic@yahoogroups.com, "aravind_2917" <aravind_2917@...> wrote:
>
> Iam trying to execute a piece of code whever serial data is recieved
> over the Serial port...I have oopic-R c.1.1+ firmware...till now i
> have not been successful with any event driven program..can u please
> tell me whats wrong with the following code...
>
> Delay=2000;
> oEvent ev=New oEvent;
> oSerialPort sp=New oSerialPort;
> Void main(Void){
> Delay=2000;
>
> oLED l=New oLED;
> oWire w=New oWire;
> oWire w2=New oWire;
>
>
> ev.Operate=0 // initially to make sure ev.operate=0
> l.IOLine=5;
> sp.Operate=1;
>
> w.Input.Link(sp.Received);
> w.Output.Link(l.Operate);//trying to switch on an in built led
> w.Operate=cvTrue;
>
> w2.Input.Link(sp.Received);
> w2.Output1.Link(ev.Operate);
> w2.Operate=cvTrue;
>
> }
>
> Void ev_Code(){ //this code is not being executed
> oLED l3=New oLED;
> l3.IOLine=7;
> l3.TurnOn;
> oInt i=New oInt;
> While(sp.Received!=0){ //trying to read from sp buffer
> i=sp.Value; //till sp.recieved is set to 0.
> }
> }
>
> someone give me a code with which i can test whether events are
> working on my board...OOPIC-R c.1.1+
>
> Thank you
>

You can find a lot of sample code in one of the OOPic subdirectories.
You can also find small examples for each object in the on-line
documentation.

In the meantime, you can't allocate objects within functions. They
must all be global. Look through the samples.

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/