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

Re: [oopic] Re: Strange serial operations

At 02:47 PM 4/1/2008, m_elias wrote:
>Even with only this,
>
> Do
> If Serial.Received Then
> buffer=Serial
> buffer.Location = buffer.Location+1
> End If
> Loop
>
>it still loses anything after 13 characters (total of 16 being sent).
>It doesn't look like my load cell display can actually use any
>hardware control. Its pin 7 & 8 are jumpered internally. Is there any
>possible work around?

There are many things you can do. How many of those 16 characters do you need?

I'm a bit rushed, so bear with me...

Since you know the OOPic isn't keeping up with the datastream, once
serial.received is set, you can stop checking it, since it will
always be set until you've read every character. So you can help
yourself by skipping the test; you can also do loop unrolling:

do
if serial.received then
buffer = serial
buffer.location = buffer.location + 1 // 1st character handled
buffer = serial
buffer.location = buffer.location + 1 // 2nd character handled
buffer = serial
buffer.location = buffer.location + 1 // 3rd character handled
...
buffer = serial
buffer.location = buffer.location + 1 // 16th character handled
endif


If that code is too fast, I'm sure you can figure out how to waste a
bit of time at selected points.


...Andy

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

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: