Shop OBEX P1 Docs P2 Docs Learn Events
QuickStart Rev. A - serial comm. — Parallax Forums

QuickStart Rev. A - serial comm.

In my character terminal project, I use QuickStart + Human Interface boards.
I use FullDuplexSerial object to provide serial communication port for my home brew computer, which currently has RS-232 based I/O.
I use different set of pins instead of P30/31 as I want to keep my serial port interface separate from Propeller programming interface:
SerialTx_pin = 5
SerialRx_pin = 7
Since my home brew computer which I will connect this character terminal to has a RS-232 interface, I had to build an interface on Propeller side.
I didn't have any MAX 232 or 233, so I looked on the internet for possible solutions.
I first tested this circuit, which I found in several places as recommended interface from Propeller to external serial port:
SerialToPropeller.jpg
I connected Tx/Rx pins to P5 and P7 on Propeller and I left the /RES unconnected as I am not using this interface for programming the chip.
However I could not make this interface work and I don't know why. I tried connecting to a serial port of a PC and to my home brew computer.
I tried lower transmission speeds, replacing the parts (suspecting that transistors or resistors were at fault), tried disconnecting the Rx to DTR circuit completely, but all to no avail.
Sometimes when I set the Baud rate to a different (wrong) value, I would get garbage from the interface. I added debug code and it seems that all that I was getting from serial port was $FF.
I finally had a success with resistors only circuit:
RS-232 RXD <--------------220R-----------< PROP TXD
RS-232 TXD >------|--------100K----------> PROP RXD
                 10K
                  |
                 GND
With the circuit above I noticed immediate improvement, although I have to use low transmission speed of 2,400 baud only since the received from serial port characters skip with higher speeds. This I think is the problem with programming on Propeller side, so I don't blame it on hardware, but I wonder why the transistors based circuit didn't work at all?

Comments

  • If I remember correctly, I had the same problems with that circuit in one of the first attempts to use the propeller, and ended with using a modified version:

    serial-port.png

    I can't remember the details, what puzzled me most was that 4.7k resistor between Rx and DTR, so I changed that part.
    I'm using it to program the propeller every day without problems, I even designed a PCB for it if you want.

    Hope it helps.
    829 x 533 - 9K
  • I tried your version, macca. Unfortunately it never worked. Perhaps it works well for programming the chip, but doesn't work for me with FullDuplexSerial driver.
  • AribaAriba Posts: 2,690
    Why do you not just use your resistor-only circuit?

    I see no improvement with the Transistors, they really only work as inverters wih 3.3V level, and that can be done by inverting the signals in FullDuplexSerial driver.

    The original Transistor circuit did some level conversion to +3.3 / -5..12V if you can set DTR to a negative voltage (needs a special driver on PC). But most PCs don't need negative voltages to detect a Low (Threshold is mostly at ~1.4V).

    Andy
  • jmgjmg Posts: 15,173
    macca wrote: »
    I can't remember the details, what puzzled me most was that 4.7k resistor between Rx and DTR, so I changed that part.
    The formal RS232 Spec needs a negative voltage on the RX pin, which is why the 'cheap kludges' often borrow negative bias from DTR or RTS
    makarcz wrote: »
    However I could not make this interface work and I don't know why. I tried connecting to a serial port of a PC and to my home brew computer.

    You should be able to test each way separately.

    The RS232_TX to P1_RX is the simplest, so try that first, eg toggle a LED when an expected char is seen.
    Next, use a terminal to manually change DTR or RTS, and you can use a diode to both DTR and RTS, and check P1_TX to RS232_RX.


  • Ariba wrote: »
    Why do you not just use your resistor-only circuit?

    I actually did and it worked.
Sign In or Register to comment.