.-----------------------------------------------------------------------------. | | | Simplistic, low-cost RS232 (+/-12V) to Propeller Chip Interface | | | | Version 1.02 - 2007-09-09 | | | `-----------------------------------------------------------------------------' This information is provided "as is" with no guarantees of suitability or fitness of purpose. Use of this information is entirely at your own risk. The author is not responsible for any consequences of use whatsoever. This interface has been tested on the author's own Propeller Proto Board and found to operate satisfactorily for the author's requirements but it has not been exhaustively tested. .-----------------------------------------------------------------------------. | | | Circuit Diagram ( used on Propeller Proto Board ) | | | `-----------------------------------------------------------------------------' ____ .-------------|____|-----------------.--------------< P9 | 330R | | | | ____ Tri-Colour Led | | .--|____|---|>|--.--|<|---' .---. | | 820R | TX to PC | O |<---' | | ____ RX from PC | O |---------|>|---^----------------|----------.---|____|---> P8 0V | O |----. 1N4148 | | 560K `---' | .|. .|. | | | 390R | | 10K | |_| |_| 0V _|_ _|_ _|_ The 560K limits input current to around 22uA. The 1N4148 blocks negative voltage signals and knocks a little off the incoming voltage. The signal therefore idles at 0V and current only flows when the PC is transmitting. The 820R and 390R current limiting resistors for the LED should be matched to the LED used. The monitoring LED is entirely optional. The design here is a result of layout requirements. The cathode can be connected to 0V and the 390R moved to between the LED and P9. The 820R value may need to be increased to balance LED intensity. This circuit works when connected to my PC using a physical serial port. No guarantees for correct operation on any other PC with component values used. Component values may need to change if used with a USB to serial interface or for input signals other than +/-12V. .-----------------------------------------------------------------------------. | | | Loopback Test Code ( Spin ) - Works up to 14400 baud | | | `-----------------------------------------------------------------------------' CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 PUB LoopBack dira[9]~~ repeat outa[9] := ina[8] Using a terminal emulator, whatever is received on P8 is echoed out on P9. This works at up to 14400 baud. Should work up to 115200 and beyond if rewritten using Assembly Language and run within a Cog. .-----------------------------------------------------------------------------. | | | Links | | | `-----------------------------------------------------------------------------' Please see further discussion at ... http://forums.parallax.com/forums/default.aspx?f=25&m=214812 .-----------------------------------------------------------------------------. | | | Document History | | | `-----------------------------------------------------------------------------' 1.00 2007-09-09 First Public Release 1.01 2007-09-09 Added warranty information 1.02 2007-09-09 Corrected typo's