View Full Version : Serial Out On HWB To MAX/MSP on a Mac

04-11-2007, 01:19 AM
Which pins on Homework boards send serial out? We need to send serial to MAX/MSP for an art installation and we know we can make serial cable to do it, but can you specify using the onboard serial connector as the output? Thanks.

04-11-2007, 01:42 AM
If you do: SEROUT 16, 16468, ["Hi there", 13]

It should come out the onboard serial connector, like to your PC. However, you should be aware that the on-board DB-9 connector does use the incoming TX signal voltage to generate it's outgoing RX signal -- so everything sent on TX will be echoed out RX by the hardware.

Otherwise, for about $12 you can get a DB-9 with MAX232 on it for an inexpensive adapter, and use any two other pins on the Homework board.

Mike Green
04-11-2007, 01:49 AM
You can use the onboard serial connector with a couple of restrictions that may not affect you: 1) Anything sent to the Homework board will be echoed back to the source (PC/Mac). 2) When the serial port is opened, the Homework board will probably reset. This is caused by the DTR line being asserted and is how the programming is done. You could make a special serial cable with only RX, TX and Ground which would prevent this from happening. 3) The programming (and debug) port is "pin" 16 and is limited to 9600 Baud only.

Look at the description of the DEBUG and DEBUGIN statements in the PBasic manual. As mentioned, you can also use the SERIN/SEROUT statements with pin # 16 and 9600 Baud only.

You can use any of the other I/O pins with SERIN/SEROUT, but you'd need a TTL to serial converter. Most of the time, you could just use a resistor as described in the PBasic manual in the sections on the SERIN/SEROUT statements.