Click to See Complete Forum and Search --> : Serial port programming
Scyla
February 24th, 2003, 10:39 AM
Hello, i have a problem programming mu serial port:
my code works in one of my machines, but in the other, when i try to receive, i get something like :
$GPGGAAAAAAAA,,,,,,12222222.222222222222,,,,,,5555555555,,,
So,i thought maybe it could be the DCB structure parameters, but i played with them and i didn't get better.
Please, di u have any idea? thanks in advance
Scyla
mwilliamson
February 24th, 2003, 01:21 PM
Sounds like a parity problem to me. Most newer UARTs will automatically change the settings for you, if you specify the wrong settings for a device. However, older ones do not. So you should use the correct settings for your device always!
KingTermite
February 24th, 2003, 01:32 PM
Check you are running same baud rates on both machines.
Long shot, but if machines are different architectures, check endianness.
Scyla
February 25th, 2003, 01:16 AM
Hello ,thanks for ur answers.
I tried the code with 2 machines: In one of them it works perfect, and the settings are :
Baudrate : 9600
StopBits : 1
Parity : NOPARITY
RTS_CONTROL_ENABLE (i also tried HANDSHAKE)
DTR_CONTROL_ENABLE (here the same)
and at the other machine i maintained the same settings and i got that problem.
And i have no idea of what else to try. Do u think i must set any other serial parameter?
the pc board i think it's not old, it's new.The first machine has an old board. the second machine hasan architecture a little bit different, it has a syncronization card in it , to syncronize devices. I thought that could be the problem, cause the gps inside card, has a signal conected to the synchro card, but not, because i tried with an external gps and the result is the same.
Any more idea?
Thanks again
KingTermite
February 25th, 2003, 11:41 AM
Do you have access to an RS232 bus analyzer? You can really see what's on the lines that way.
Also, make sure you have rebooted the machine that is failing. Sometimes you can get something hosed up in the OS and need to reboot to get everything good and cleared out again.
mwilliamson
February 25th, 2003, 03:12 PM
Hyperterminal is somewhat reliable at detecting com settings too.
Scyla
February 26th, 2003, 01:05 AM
Good mornning,
yesterday night i tried again, and it worked. Maybe the machine had to be reboot, because it worked.
An analizer would be the best way to study the RS232 but i hadn't any right now.
Now i receive well all the data. Thank you to all.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.