COM Port Question
bingo
Posts: 10
in Propeller 1
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?
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
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.
My physical interface is a Prop Plug for the Programming port and a Silicon Labs USB to TTL device for the other port.
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.
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.
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?
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)
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
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
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.
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