Trouble while trying the " tx , rx function"
KevinKK
Posts: 27
Hi
I write·my problem as below
I'v tried the " tx , rx function" using·the following·three Serial Objects. However, i still always fail to communicate between PC and Propeller. We do this test by using Propeller Education Kit (stock :#32305).
Would anyone help to tell me how to debug ?
(1)"Simple_Serial"
· My testing Result:
·· rx , tx function in "Simple_Seria"l doesnt' work
(2)"FullDuplexSerial"
· My testing Result:
·· use tx function :· propeller to PC is correct, PC recevied 1 , 2 , and 3
·· use rx function :· PC to propeller is incorrect, data is incorrect ,I got 0,0,0
(3)"Extended_FDSerial"
·My testing Result:
· situation is as (2),above
The Testing code is here:
CON
· _clkmode····· = xtal1 + pll16x······················· ' use crystal x 16
· _xinfreq····· = 5_000_000···························· ' external xtal is 5 MHz······
VAR
· byte x
· long· Stack[noparse][[/noparse]30]
OBJ
· rs232Obj:· "FullDuplexSerial"· '"Extended_FDSerial"·· '"Simple_Serial"
PUB Main
· dira[noparse][[/noparse]16]:=1····················· 'output
· outa[noparse][[/noparse]16]:=1····················· 'high
· rs232Obj.start(31,30,0,115_200)· 'for "FullDuplexSerial","Extended_FDSerial"
· 'rs232Obj.start(31,30,115_200)··· 'only for "Simple_Serial"
· rs232Obj.Tx(1)
· rs232Obj.Tx(2)
· rs232Obj.Tx(3)
·
· repeat
···· x:=rs232Obj.Rx
···· rs232Obj.Tx(x)
· repeat
Post Edited (KevinKK) : 3/14/2007 5:23:17 PM GMT
I write·my problem as below
I'v tried the " tx , rx function" using·the following·three Serial Objects. However, i still always fail to communicate between PC and Propeller. We do this test by using Propeller Education Kit (stock :#32305).
Would anyone help to tell me how to debug ?
(1)"Simple_Serial"
· My testing Result:
·· rx , tx function in "Simple_Seria"l doesnt' work
(2)"FullDuplexSerial"
· My testing Result:
·· use tx function :· propeller to PC is correct, PC recevied 1 , 2 , and 3
·· use rx function :· PC to propeller is incorrect, data is incorrect ,I got 0,0,0
(3)"Extended_FDSerial"
·My testing Result:
· situation is as (2),above
The Testing code is here:
CON
· _clkmode····· = xtal1 + pll16x······················· ' use crystal x 16
· _xinfreq····· = 5_000_000···························· ' external xtal is 5 MHz······
VAR
· byte x
· long· Stack[noparse][[/noparse]30]
OBJ
· rs232Obj:· "FullDuplexSerial"· '"Extended_FDSerial"·· '"Simple_Serial"
PUB Main
· dira[noparse][[/noparse]16]:=1····················· 'output
· outa[noparse][[/noparse]16]:=1····················· 'high
· rs232Obj.start(31,30,0,115_200)· 'for "FullDuplexSerial","Extended_FDSerial"
· 'rs232Obj.start(31,30,115_200)··· 'only for "Simple_Serial"
· rs232Obj.Tx(1)
· rs232Obj.Tx(2)
· rs232Obj.Tx(3)
·
· repeat
···· x:=rs232Obj.Rx
···· rs232Obj.Tx(x)
· repeat
Post Edited (KevinKK) : 3/14/2007 5:23:17 PM GMT
Comments
2) Simple_Serial does not work over 19,200 Baud. Please read the comments at the beginning of any object you use for such information.
3) FullDuplexSerial (and Extended_FDSerial which uses it for I/O) has been tested at 115.2KBaud. I believe it has been tested at 230KBaud as well and appears to work. That said, small differences in clock rates between the PC and the Propeller can cause problems at those speeds. I assume you're using the PropPlug with the Propeller Education Kit which is a USB to serial converter. That introduces yet another layer of timing. I suggest you start with lower speeds first, perhaps 19.2KBaud or 38.4KB and see what happens, then increase the Baud stepwise to see what happens
I've been using 38,400 baud on my 2-Prop and it works great.
An external interface and Prop1-to-Prop2 each for communications.
Yes, Mike advice is good; get it going at slower rate, then work to higher speed.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Harley Shanko
h.a.s. designn