[PD] comport & Arduino

rolfm at dds.nl rolfm at dds.nl
Fri Sep 4 11:51:56 CEST 2015


(probably, to formulate the right clear question, would be answering it.)

IOhannes wrote:
<so the only remaining question is whether both peers have spare cycles
to actually handle all data that arrives.>

the serial port of the Arduino has a max. data rate of 115200 bits/sec.
[comport] input & output is in bytes of 8 bits.
over the line 1 stopbit is added.
that comes down to almost 13 bytes/msec.

in Pd [comport] can be fed 'instantaneously' with a bunch of bytes.
am i right in my understanding that [comport] takes care of the  
handling of these bytes according with the speed of the connection,
and on the Pd side all should be well, as long there is no stack overflow.


@Alexandros:

13 bytes/msec is not a lot.

the patch in the Arduino has a 'duty-cycle' of 20 msec to feed the motors.
in this time 4 AnalogReads  are sent to Pd, and from Pd are sent the  
changed values for the motors (up to 8) and some digital pins.

i'm afraid that extending the communication with sending back an  
acknowledge, waiting for the acknowledge and eventualy resending the  
missed message, is just not possible with this bitrate.

rolf



More information about the Pd-list mailing list