[PD] writing to the serial port with [comport]

Thomas Ouellet Fredericks iamonthebeach at gmail.com
Wed Apr 26 00:25:06 CEST 2006


I have successfully written on the serial port to the Arduino board
from PD . Some tips:
- connect the board before running PD (or the comport external)
- close the Arduino IDE before running PD
- is their a security/permission issue where you can read the
(usb-serial) driver and not write it?
- are you using the USB version of the Arduino board?
- setting comport with the proper settings?
- do you get any error messages once you start comport?

Tom


On 4/25/06, Hans-Christoph Steiner <hans at eds.org> wrote:
>
> On Apr 25, 2006, at 5:54 PM, Hans-Christoph Steiner wrote:
>
> >
> > On Apr 25, 2006, at 4:23 PM, Mathieu Bouchard wrote:
> >
> >> On Mon, 24 Apr 2006, Hans-Christoph Steiner wrote:
> >>
> >>> I am trying to write data from Pd to Arduino.  Has anyone used
> >>> [comport]
> >>> to write out serial data before?  Any example patches?  I can
> >>> only get
> >>> TX_OVERRUNS errors.
> >>
> >> If CTS/RTS pins aren't connected properly then the computer's UART
> >> might
> >> be supposing that the device is not there and so it will
> >> accumulate data
> >> until the buffer overflows, a situation which gets trapped and
> >> becomes a
> >> TX_OVERRUNS.
> >
> > No data ever gets thru when writing to the serial port, and on
> > reading works fine as it is.  So I don't think CTS/RTS is
> > required.  Its not used on GNU/Linux or Mac OS X.
>
> I am pretty sure I have found the problem:
>
> #ifdef WIN2000
>                   0,
> #else
>                   FILE_FLAG_OVERLAPPED,
> #endif
>
> By default, this object is compiled with the FILE_FLAG_OVERLAPPED
> mode, which enables asynchronous writing to the serial port.  But
> none of the Windows code is written to use the OVERLAPPED struct,
> which is required when in async mode.  Therefore, no data gets written.
>
> But there is a exceedingly simple solution: remove the WIN2000 hack
> all together and just use with sync mode, which is what the code is
> doing anyway.  But I don't have a Windows machine to test this on
> right now, any volunteers?
>
> .hc
>
> ________________________________________________________________________
> ____
>
> "Computer science is no more related to the computer than astronomy
> is related to the telescope."
>                                                           -Edsger
> Dykstra
>
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>




More information about the Pd-list mailing list