to synchronize rs232 signal
Johnnyfumi
Posts: 14
Hy, i'm sorry if my questions is always so lowly, but i'm just a beginner. So i'm trying· to realize a rs232 interface between propeller and pc. i'm using "FullDuplexSerial" (library) but i think there are some synchronization problem. This is a sample of my code:
······
····· Con
··········· p = $2
·······Obj
··········· fullduplex : "FullDuplexSerial"
·······Pub main
··········· fullduplex.start(0,1,1,9600)
··········· fullduplex.tx(p)
in this way i read on my pc (i open a com port whit java program) two items ( "0" and "2" or if p = $7 i read "0" and "7" ) but·i don't undestand why. Maybe there are some synchronization problem but i don't know how can i solve it. Maybe i have to set in different way any parameters in my code or in "FullDuplexSerial" but i don' know witch can i change.
thank you all
Johnny
······
····· Con
··········· p = $2
·······Obj
··········· fullduplex : "FullDuplexSerial"
·······Pub main
··········· fullduplex.start(0,1,1,9600)
··········· fullduplex.tx(p)
in this way i read on my pc (i open a com port whit java program) two items ( "0" and "2" or if p = $7 i read "0" and "7" ) but·i don't undestand why. Maybe there are some synchronization problem but i don't know how can i solve it. Maybe i have to set in different way any parameters in my code or in "FullDuplexSerial" but i don' know witch can i change.
thank you all
Johnny
Comments
Do you want the mode to invert the transmit line, but not the receive line? Do you understand what these parameter values mean?
How do you have the Propeller and PC connected?
J
Have you tried sending characters $41 to $59 for A to Z ? This may help identify your problem.
first thank you guy for you support, but i think my problem is not about java applet's interpretation. If i send a single value,·hex or binary it's not important, i read two values and it's biggest problem then interpretation problem [noparse];)[/noparse]
If a send value "%110" i read "0" and "5" on my java terminal. So i think that maybe there is a synchronizzation fault that split my value in two part; is it possible?
J
1 ) rxpin = 0
2) txpin = 1
3) mode = 0
4) baudrate = 9600
Whit method tx(variable) in fullduplex library i send a single word p = "%110" such fullduplex.tx(p) . So i use two different program "hyperterminal" (microsoft) and "Terminal" and i read always two words "00" and "07" so i'm sure that the problem is the fullduplex library. That's my only belivable conclusion [noparse];)[/noparse]
thanks for you patience
Johnny
If your program stops itself after trying to send the %110 value, the actual transmission of the value may not have completed. FullDuplexSerial is buffered. At 9600 Baud, it will take about a millisecond to actually send the character. If your program ends first, the I/O pin will be reset to input mode and the MAX232 or MAX3232 may be just transmitting noise pulses.
Post Edited (Mike Green) : 5/11/2008 4:07:56 PM GMT
i send you my simplest program
CON
p = %111
OBJ
fullduplex : "fullduplex"
Pub Main
fullduplex.start(0,1,0,9600)
repeat 4
fullduplex.tx(p)
and i send you also the result of "Terminal" <00 07 07 07>
if i start 3 times consecutively this program ao "Terminal" i read <00 07 07 07 00 00 07 07 07 07 00 07 07 07 07>
I'm really desperate but i don't understand..
thank you very very much and sorry for my insistence...
my mail address is:
alessandro.amadorsen@hotmail.it
You are sending unprintable characters ($07) and so it depends on software what it will do. This is masking your real problem.