Shop OBEX P1 Docs P2 Docs Learn Events
COM Port Question — Parallax Forums

COM Port Question

Hello Anyone,

I can communicate with the Propeller from a terminal program on COM6 using:

OBJ
Serial : "FullDuplexSerial"
PUB Main
Serial.Start(31,30,0,115200) 'Programming port

However, if I try communicating with the Propeller from the same terminmal on COM7 using:

OBJ
Serial : "FullDuplexSerial"
PUB Main
Serial.Start(22,23,0,115200) ' Some other port

I get nothing. Why not?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2021-01-05 23:06
    Are you sure you've got the 22 and 23 in the right order? And what kind of physical interface are you using between the Prop and your computer?

    -Phil
  • Hello Phil,

    Yes, i'm sure of the pin order. Tried it both ways.

    I am using the terminal program Termie to interface with the Propeller, howerer I have also tried other terminals with the same negative result.
  • Sorry Phil,
    My physical interface is a Prop Plug for the Programming port and a Silicon Labs USB to TTL device for the other port.
  • bob_g4bbybob_g4bby Posts: 412
    edited 2021-01-06 11:06
    Do you know if both physical interface and driver works?

    If both Prop Plug and Silicon Labs device produce 3.3v logic signals, could you temporarily wire them back to back? The using two terminal emulator programs, check you can send characters from one to the other both ways. If you can, then reintroduce the propeller.
  • Cluso99Cluso99 Posts: 18,069
    edited 2021-01-06 16:18
    bob_g4bby wrote: »
    Do you know if both physical interface and driver works?

    If both Prop Plug and Silicon Labs device produce 3.3v logic signals, could you temporarily wire them back to back? The using two terminal emulator programs, check you can send characters from one to the other both ways. If you can, then reintroduce the propeller.

    Or you could just connect the TX to RX and verify you get characters echoed on the terminal program.

    Another way is to connect P62 (tx out from prop) also to the rx on the silabs board and you should see the output on both terminals.
  • Hello bob,
    Thanks for your help. I tried your suggestion but the prop plug does not output 3.3V. Also, the Prop Plug is on COM6 while the Silicon Labs device is on COM7, so I cannot get two terminal programs to communicate back to back on the same port.
  • bob_g4bbybob_g4bby Posts: 412
    edited 2021-01-07 08:55
    3.3v high signals on Rx and Tx - check your Silicon Labs device datasheet. If it outputs 5v high signals you'll fry any 3.3v logic level device connected to it. Set two terminal programs running, one on COM6, the other on COM7.

    Then - Cluso's suggestion is the simplest - to check that your converters are working, before adding the propeller into the mix. Disconnect the propeller from the converters. Link the transmit line to the receive line on one of the converters and set up the terminal program on the corresponding COM port. Makes sure local echo is turned off. Typing characters on the keyboard should then appear on the screen, showing the converter, driver and terminal program are set up correctly. This is called a 'local loopback test'. Repeat this with the other converter with it's Tx and Rx linked, using exactly the same baud, parity, stop bits and so on, so now you know the converters are both in good health. Remove the Tx-Rx links and reintroduce the propeller between them, being careful about signal direction, converter Tx connects to propeller Rx, converter Tx connects to converter Rx. If no data flows, it's then highly likely to be a problem in the propeller code, you know the external stuff is working.

    Dim, foggy morning in locked-down SW U.K. today. This retired engineer has plenty of fun things to do with a propeller and ham radio, though. Never stop learning, eh?
  • Hello Bob,
    I tried your suggestions using two terminals with the Tx and Rx lines connected correctly between them. It worked fine. Numbers could be sent back and forth.

    Following is a little better description of my problem. Would you please look at my code and see what I am doing wrong.

    If I run the program through the programming port (COM6) it works fine. It flashes the LED and returns the value.
    If I run the program through the USB (COM7) it will flash the LED, but does not return the value. I would like to use the COM7 port.

    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    OBJ
    FD : "FullDuplexSerial"
    FD2 : "FullDuplexSerial"
    VAR
    byte x
    PUB Main
    FD.Start(31,30,0,115200) 'Prop Plug COM6
    FD2.Start(22,23,0,115200) 'Silicon Labs USB to TTL COM7
    dira[24]~~
    repeat
    x := FD2.Rx
    outa[24]~~
    waitcnt(clkfreq + cnt)
    outa[24]~
    FD2.Tx(x)
  • Cluso99Cluso99 Posts: 18,069
    edited 2021-01-07 22:01
    I cannot see anything wrong with the code.
    When posting code, use the code tags so that your indentation remains intact. This means put
    [ code ]
    Code here
    [ /code ]
    but you need to remove the spaces I put inside the square brackets

    Try commenting out using the first com port, and just send a character every second without reading by
      repeat
        FD2.tx(“a”)
        waitcnt(clkfreq + CNT)
    
  • Hello Cluso99,

    Thanks for the formatting tips.

    I tried your suggestion of commenting out the first COM port and just sending FD2.tx(“a”) every second, but i get no response in the terminal. Did you happen to try the test?

    bingo
  • Cluso99Cluso99 Posts: 18,069
    Try this. Note most is commented out but I know it works.
    If this works with the propplug, then try it using different pins and your silabs board.

    There is an fdx.stop so it only goes out once. You might want to put a repeat statement in there, or a delay before the message.
  • Hi Cluso99,

    I tried your Do Nothing program and it works fine through the Prop Plug on COM6, but I get nothing on the terminal Through COM7, the Silicon Graphics USB.

    The Silicon Graphics USB is working fine for me otherwise.

    bingo
  • Sorry Cluso99, I forgot to change the pins. When I hooked up to two different pins the program worked fine on COM7. I guess that solves my problem. I should sleep well tonight. Thanks much for your help, and thanks to bob_g4bby in the UK. I'm a retired engineer too but, Mining not electrical or computer.
  • Good to hear you fixed it.
  • Cluso99Cluso99 Posts: 18,069
    Excellent news. Now you should be able to find why your original program doesn’t run.
Sign In or Register to comment.