Shop OBEX P1 Docs P2 Docs Learn Events
P2 programming using real COM port? — Parallax Forums

P2 programming using real COM port?

TonyB_TonyB_ Posts: 2,179
edited 2020-02-29 15:12 in Propeller 2
I can't use virtual COM ports under Windows due to XP failure and reversion to 98SE but my PC does have a physical COM1 port. Is it possible to program the P2 by connecting a RS232 to USB cable between COM1 and P2 EvalB PC-USB sockets?

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-02-29 12:53
    I can't make any sense of what you want to do or why.

    Why are you on XP and what do you mean failure and reversion?

    Surely you're not thinking that you can also use a USB to RS232 cable in reverse? The USB serial chip is expecting a USB host to talk to it, not another USB serial that is also expecting a USB host too.

    Anyway, if XP is having problems, just load up Linux on your old PC instead and breath new life into it. A lot of us are using Linux all the time and for P2 development.
  • TonyB_ wrote: »
    I can't use virtual COM ports under Windows due to XP failure and reversion to 98SE but my PC does have a physical COM1 port. Is it possible to program the P2 by connecting a RS232 to USB cable between COM1 and P2 EvalB PC-USB sockets?

    This Parallax product MIGHT work with Win98:
    https://www.parallax.com/product/28030

    FTDI has a driver for Windows98:
    https://www.ftdichip.com/Drivers/VCP.htm
  • TonyB_TonyB_ Posts: 2,179
    edited 2020-02-29 14:17
    Simplest way to use a real COM port to program the P2?

    Note to Moderator
    Could you please remove and RS232 to USB cable from thread title?
    I can't edit the title, nor text of first post. Instead a new post appears.
  • TonyB_ wrote: »
    Simplest way to use a real COM port to program the P2?

    Note to Moderator
    Could you please remove and RS232 to USB cable from thread title?
    I can't edit the title, nor text of first post. Instead a new post appears.

    ModEdit.. Done
  • Help you with an OS released back in 1998? Itself OBSOLETE by 2001. If you're that destitute we could pull some funds together or donate equipment to help you out? Nobody should be forced to use 22 year old PC equipment.
  • evanhevanh Posts: 15,916
    edited 2020-02-29 17:29
    Easiest solution is definitely try getting a Win98 VCP driver.

    Otherwise you're up for some components and soldering. Would need a line transceiver chip attached to P62 and P63. A piece of Vero board Ha!, there is a nice little "protoboard" that comes with the accessory kit for plugging into the accessory headers and used to mount components. Ideal for this. Also need to add a two pin header to the DTR holes next to the P56-P63 accessory header of the revB/C Eval Board.

    A suitable transceiver would be MAX3232 in DIP package. It needs a few support caps to boost up from 3.3 V or 5.0 V supply.
  • cgraceycgracey Posts: 14,155
    edited 2020-02-29 17:36
    You would just need to convert the -5V/+5V TX signal from the PC to +3.3V/0V and feed it into P63 on the P2. Then, take P62 and convert its 3.3V/0V output to -5V/+5V and feed that into the PC's RX input. Lastly, couple the PC's DTR signal via a 100nf cap into RESn on the P2. That will make the electrical interface. If you get that done, I will make an addition to pnut.exe, where you can select 115.2k baud.
  • jmgjmg Posts: 15,173
    As above, if you have a physical museum COM1 port, you need to convert the +/- 12V signals from that to 3v3 TTL

    You may have some boards already with RS232-TTL chips, & Digikey show a sparkfun breakout board for the MAX3232 BOB-11189 $6
    You should level translate all signals, TX,RX,DTR from the +/- 12V <-> 3v3
    The COM port may not be limited to 115200, but that's a reasonable place to start from.
  • jmg wrote: »
    museum COM1 port

    Many brand new motherboards you can buy today actually still have at least one COM port, but usually only on a pin header (then again, some old boards (big DIN keyboard socket!) only had those, either).


  • jmg wrote: »
    As above, if you have a physical museum COM1 port, you need to convert the +/- 12V signals from that to 3v3 TTL

    You may have some boards already with RS232-TTL chips, & Digikey show a sparkfun breakout board for the MAX3232 BOB-11189 $6
    You should level translate all signals, TX,RX,DTR from the +/- 12V <-> 3v3
    The COM port may not be limited to 115200, but that's a reasonable place to start from.

    The Parallax unit mention above does that.
  • Thanks for the replies. My Meniere's symptoms make it hard to think straight at the moment.
  • TonyB_TonyB_ Posts: 2,179
    edited 2020-03-01 11:09
    Installing Linux is a possible option, as mentioned, but I know nothing about that. The preferred option is to keep using Windows (yes, out of date but more than good enough for writing PASM programs).

    From web searches, most RS232 to 3.3V converters only translate RX and TX. I think these should work as DTR not compulsory?

    Some converters run at 115.2K max, others perhaps more. My COM1 supports 115.2K, 230.4K, 460.8K and 921.6K, as reported in Port Settings. Either 115.2K or 230.4K would be acceptable.

  • Publison wrote: »
    jmg wrote: »
    As above, if you have a physical museum COM1 port, you need to convert the +/- 12V signals from that to 3v3 TTL

    You may have some boards already with RS232-TTL chips, & Digikey show a sparkfun breakout board for the MAX3232 BOB-11189 $6
    You should level translate all signals, TX,RX,DTR from the +/- 12V <-> 3v3
    The COM port may not be limited to 115200, but that's a reasonable place to start from.

    The Parallax unit mention above does that.

    I think the Parallax one and others available won't work in this case because they are meant for the PC socket to be USB, whereas for me it is a real COM port.
  • evanhevanh Posts: 15,916
    edited 2020-03-01 11:20
    Hope that Meniere isn't permanent. It sounds down right sickening.

    TonyB_ wrote: »
    From web searches, most RS232 to 3.3V converters only translate RX and TX. I think these should work as DTR not compulsory?
    Not having DTR wired up would be frustrating. Particularly if you ever want to switch between comport and SD or EEPROM booting.

    There's plenty of these chips that have two or more drivers/receivers each way. The MAX3232 is one. And you can get it as DIP packaging too, this will make building your own adapter a little easier.

    The parts count isn't large, and it runs off the Eval Board power so not complicated to use either.

  • TonyB_TonyB_ Posts: 2,179
    edited 2020-03-01 12:21
    evanh wrote: »
    Hope that Meniere isn't permanent. It sounds down right sickening.
    I've had Meniere's for a long time, probably since birth. It was OK until it got worse about 10 years ago, then it almost disappeared 5 years ago, but got worse again last autumn.
    evanh wrote: »
    TonyB_ wrote: »
    From web searches, most RS232 to 3.3V converters only translate RX and TX. I think these should work as DTR not compulsory?
    Not having DTR wired up would be frustrating. Particularly if you ever want to switch between comport and SD or EEPROM booting.

    There's plenty of these chips that have two or more drivers/receivers each way. The MAX3232 is one. And you can get it as DIP packaging too, this will make building your own adapter a little easier.

    The parts count isn't large, and it runs off the Eval Board power so not complicated to use either.
    How much could fit on the Protoboard? I'd be grateful if you could investigate, Evan.
  • evanhevanh Posts: 15,916
    edited 2020-03-01 13:21
    TonyB_ wrote: »
    How much could fit on the Protoboard? I'd be grateful if you could investigate, Evan.
    I only have the separately available larger protoboard. The mini wasn't in the first accessory kits. Either should work if you already have one. Let me know.
  • jmgjmg Posts: 15,173
    edited 2020-03-02 04:35
    TonyB_ wrote: »
    From web searches, most RS232 to 3.3V converters only translate RX and TX. I think these should work as DTR not compulsory?
    The sparkfun one I mentioned above, has dual buffers each way, so it can also manage a single handshake pair.
    TonyB_ wrote: »
    Some converters run at 115.2K max, others perhaps more. My COM1 supports 115.2K, 230.4K, 460.8K and 921.6K, as reported in Port Settings. Either 115.2K or 230.4K would be acceptable.
    Did you try terminal connect and send at 921.6k ? & Check loopback and waveforms


    TI Spec a MAX3232 at 250k, and they also mention a SN75C3232E. SN65C3232E, for 1Mbd (and also SP3222EUEY ST3237EBPR spec 1MBd )
    If your PC manages 1MBd, it may pay to seek out one of the faster x3232 parts ?

    Addit: these are cheap, but modest speed.
    https://www.electrodragon.com/product/mini-usb-rs232-convert-board/
  • Cluso99Cluso99 Posts: 18,069
    IIRC there was a Parallax schematic for using a COM RS232 port to the P1 using 3 transistors. Unfortunately I don't have a link.
  • jmgjmg Posts: 15,173
    Cluso99 wrote: »
    IIRC there was a Parallax schematic for using a COM RS232 port to the P1 using 3 transistors. Unfortunately I don't have a link.

    This is simple, but assumes a 0V drive is seen as low, and uses DTR to give the high.
    https://openwrt.org/_media/media/doc/hardware/serial/ttl_to_rs2320kf.jpg

    This one
    https://www.avrfreaks.net/sites/default/files/2tr.gif
    uses diodes to derive a negative TX bias, and is configured for a 5V rail.

    Those designs are not likely to manage 1Mbd
  • TonyB_TonyB_ Posts: 2,179
    edited 2020-03-04 10:41
    The Polulu 23201a serial adapter supports DTR and all the other 9-pin signals. Max data rate is 250kbps.
    https://www.pololu.com/product/126

    I couldn't find a UK supplier yesterday so I bought a cheaper fully assembled adapter with just RX and TX. If using that proves to be tedious, I'll try again to find the Polulu partial kit and solder the header strip pointing up.
  • evanhevanh Posts: 15,916
    edited 2020-03-04 13:10
    Oh, such a long time since I last thought about this! I'd forgotten all about DTE (Data Terminal Equipment) vs DCE (Data Communications Equipment). That's intended for DTE, ie: DTR is facing out to the D connector, not in to the prop2.

    You'll need a DTE to DTE RS232 cable, aka cross-over, aka null-modem. And then also when wiring the prop2: TX swaps with RX, DTR swaps with DSR, and RTS swaps with CTS.

  • TonyB_TonyB_ Posts: 2,179
    edited 2020-03-05 12:10
    evanh wrote: »
    Oh, such a long time since I last thought about this! I'd forgotten all about DTE (Data Terminal Equipment) vs DCE (Data Communications Equipment). That's intended for DTE, ie: DTR is facing out to the D connector, not in to the prop2.

    You'll need a DTE to DTE RS232 cable, aka cross-over, aka null-modem. And then also when wiring the prop2: TX swaps with RX, DTR swaps with DSR, and RTS swaps with CTS.

    The signal names printed on the Polulu 23201a board refer to the D connector / PC end. However, I bought a cheaper alternative with only RX, TX, GND and VCC. I also bought a male-to-female 9-pin serial cable and lots of jumper wires. No DTR capability, though.
  • evanhevanh Posts: 15,916
    Male-to-Female is no guarantee of matching cable type. Chances are the cable is a straight-through, DTE to DCE, rather than a cross-over, DTE to DTE, cable. Whether that is suited or not depends on whether the adapter is intended as a DCE or DTE.

  • Cluso99Cluso99 Posts: 18,069
    edited 2020-03-05 02:00
    A bit of history...

    DTE is the terminal end and should be a Male DB25.
    DCE is the modem end and should be a Female DB25.

    But, the micro-computers muddied the waters and so did some video terminals. Then even the IBM PC managed to muddy it further using the DB25F for the parallel printer port. By the time the DB9 came into being, the DB25 M & F connectors had been so misused the DB9 was anyones guess although IIRC IBM did define and use the DB9M for the PC (ie a terminal).

    Now, a typical crossover cable to go from terminal to terminal without modems, for async, and DB25 (never memorised the DB9 pinouts). The following is from memory...
    TXD #2 --> RXD #3
    RXD #3 <-- TXD #2
    GND #7 <-> GND #7
    optional...
    DTR #20 --> DSR #6
    DSR #6 <-- DTR #20
    where hardware flow control was used, you also need these..
    RTS #5 = CTS #6 --> DCD #8
    DCD #8 <-- RTS #4 = CTS #5

    In synchronous we had clock (DTE inputs) on #15 & #17. Quite often a mainframe would output clocks on #12 IIRC.
    Also ring indicator was on #21 IIRC.

    I still have crossover cables that I made over 40 years ago :(
  • msrobotsmsrobots Posts: 3,709
    edited 2020-03-05 02:36
    Moving boxes from my old office into my new mancave I stumbled upon one of those gender-changers, still connected to a programming cable of my long dead psion…

    Nice one, with LED for status and all of that.

    Not sure if it still works, have not tried yet, but my trusted PPDB has a MAX232.

    Mike
  • Cluso99Cluso99 Posts: 18,069
    I had a Y cable that split out the RXD & TXD pins to a pair of connectors to go to a pair of comms ports on a laptop or PC. Back then, I wrote a monitor program in Turbo Pascal. Was a great comms debugging tool.
  • TorTor Posts: 2,010
    DE9, not DB9.. A/B/C/D/E defines the size/format of the metal shielding around the pins. The one used for the 9-pin serial plug is E, so the connector is called DE9. "B" is the size used for the 25-pin one.
  • kwinnkwinn Posts: 8,697
    Cluso99 wrote: »
    A bit of history.......

    But, the micro-computers muddied the waters and so did some video terminals. Then even the IBM PC managed to muddy it further using the DB25F for the parallel printer port. By the time the DB9 came into being, the DB25 M & F connectors had been so misused the DB9 was anyones guess although IIRC IBM did define and use the DB9M for the PC (ie a terminal)..........


    I still have crossover cables that I made over 40 years ago :(

    Those waters were pretty muddy even before the micro-computers came along. I was installing and servicing minicomputers with multiple serial terminals in the 70's and got so frustrated with figuring out what signals were required and which of the 25 pins they were on. In the end I ended up with about a dozen 25 pin to 9 pin adapters and a 9 conductor cable to connect any adapter to any other adapter. Pin 5 was ground, pins 1-4 on each end crossed over to pins 6-9 on the other end. Made setup and troubleshooting so much easier.
  • Tor wrote: »
    DE9, not DB9.. A/B/C/D/E defines the size/format of the metal shielding around the pins. The one used for the 9-pin serial plug is E, so the connector is called DE9. "B" is the size used for the 25-pin one.

    So you're the other one!
    When I tried to educate someone on that fact, I was told that there were only two people left in the world who cared about that distinction.

    It's like RJ45 (wrong) vs 8P8C (correct) for network cables. So many people accept the widespread misuse, and the inertia becomes too much.
  • I've used the attached circuit, which came from the forums years ago. Don't know what the maximum speed would be.
Sign In or Register to comment.