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.

Monday, October 15, 2007

[oopic] Re: How to use oSerialL for reception of data ?

Hi Dennis,

yes, I've been reading that part of the manual over and over ...
The scary part is where it says : "...while the oSerialL Object is
waiting for incoming serial data, the program flow is stopped".
I don't want the program flow to stop, my program has other tasks to
do while it should receive the serial data in the background (event-
driven).
Is there a way this can be done ?

Thank you,
Patrick

--- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...>
wrote:
>
> The oSerialL objects are what you are after. These are half-duplex
> ports and the serial input especially _requires_ that you use
CTS/RTS
> type flow control with it. From the manual:
>
> 'This program creates two oSerialL
> 'Objects. One is used to receive a
> 'serial signal and the other is used
> 'to send a serial signal.
> 'A oDio1 is used to show that while
> 'the oSerialL Object is waiting
> 'for incoming serial data, the
> 'program flow is stopped.
>
> Dim A As New oSerialL
> Dim B As New oSerialL
> Dim C As New oDIO1
>
> Sub Main()
> C.IOLine = 24
> C.Direction = cvOutput
> B.IOLineS = 23
> B.IOLineF = 18
> B.Baud = cv2400
> A.IOLineS = 22
> A.IOLineF = 16
> A.Baud = cv2400
> Do
> A=B
> C.Invert
> Loop
> End Sub
>
> I have used these at up to 9600 baud successfully with flow
control.
> Sometimes you need to fiddle with the flow control polarity to
match
> what you are talking to.
>
> DLC
>
> patrickcastelein wrote:
> > Dear all,
> >
> > I'm very new to the ooPIC community but I'm already able to do
some
> > really cool event-driven stuff with the ooPIC-C.
> >
> > The last phase in my first project, is to have the ooPIC listen
and
> > talk to a serial port at 9600 bits/sec. The protocol on this port
is
> > half-duplex, so there will be no transmission and reception of
data
> > at the same time.
> >
> > Because I inserted the ooPIC-C in an existing BASIC-Stamp design
of
> > mine, the printed circuit board was already made and the pins for
> > RxD, TxD, DTR and CTS are defined. That made me choose for the
> > oSerialL object in stead of the oSerial or oSerialPort.
> >
> > I am now struggling on how I should write proper code for an
event-
> > driven routine that handles the reception of the data from this
port.
> >
> > Does anyone have some samples of code, showing a small routine
that
> > is able to receive a byte from the oSerialL object and put it in
a 20-
> > byte buffer ? (I count on using the oBuffer20 object for that).
> > How should I make a VC for that ?
> > I cannot find a trigger flag in the oSerialL object that would be
> > able to trigger an event.
> >
> > Thanks for any help !!
> >
> > regards,
> > Patrick.
> >
> >
> >
> >
> > 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: