Tuesday, April 1, 2008

Re: [oopic] Re: Strange serial operations

If you can use hardware flow control that would be best. The ooPIC
doesn't prioritize serial operations and often bytes are lost. Also,
you can't VC the serial port (sadly). However, you can use hardware
flow control with the oSerialL objects that I've used that to good effect.

DLC

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?
>
> Matt
>
>
>
>> 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
>
>
>
>
>
>

--
------------------------------------------------------
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:

Post a Comment