Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

communication between pc and sensor by RS232

Status
Not open for further replies.

itmr

Member level 3
Joined
Nov 5, 2010
Messages
55
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,750
HI ALL
i am trying to get data from sensor that have rs232 output
i connect the rs232 pins to d type 9 pins and then through rs232 to usb adapter to pc.
when i open the hyper terminal i see gibberish signs and not a good data formats.
when i check the voltage level at the transmitting line at the rs232 output from the sensor - i get -5.5v that i think its good because rs232 represent negative voltage level for '1'- am i right?????
when i connect the adapter i measure -1v at the same point, is it sounds good?
although i get worth data at the hyperterminal
does someone have any solution for me?
am i need to use transceiver to "talk " right to the PC?
my be the fault is a the adapter???
my be i need to connect the sensor directly to the RS232 input in the pc chassis?

thanks
 

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
750
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,049
just short circuit the pin 2 and 3 in RS232 in PC and type some thing in hyperterminal (select echo mode). Then if you could see the same letter received then no problem with RS232 to USB convertor.
 
  • Like
Reactions: itmr

    itmr

    points: 2
    Helpful Answer Positive Rating

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
what is the baud rate your sensor supports???? and what is the baud rate set in your hyper-terminal.. instead of adaptor use rs232 cable if possible...

garbage values is an indication of wrong or baudrate mismatch.

keep changing the baudrate of the hyper-terminal and see for which baud rate you get correct output if you dont know the baud rate of the sensor...........

---------- Post added at 12:26 ---------- Previous post was at 12:24 ----------

just short circuit the pin 2 and 3 in RS232 in PC and type some thing in hyperterminal (select echo mode). Then if you could see the same letter received then no problem with RS232 to USB convertor.
if you select echo mode then all the characters will appear even if you dont use any cable or short pins 2 and 3.... better test it.... before giving answer....

---------- Post added at 12:27 ---------- Previous post was at 12:26 ----------

and if data is got on the window then , it has nothing to do with cable.. it means cable is fine and receiving some data if not correct data....
 
  • Like
Reactions: itmr

    itmr

    points: 2
    Helpful Answer Positive Rating

kak111

Advanced Member level 4
Joined
Mar 30, 2011
Messages
1,366
Helped
933
Reputation
1,868
Reaction score
907
Trophy points
1,413
Location
Finland
Activity points
10,942
Have you set the communication parameters for com port.

Settings are required for serial connections used for asynchronous start-stop communication, to select speed, number of data bits per character, parity, and number of stop bits per character.

Serial port - Wikipedia, the free encyclopedia

Regards KAK
 
  • Like
Reactions: itmr

    itmr

    points: 2
    Helpful Answer Positive Rating

itmr

Member level 3
Joined
Nov 5, 2010
Messages
55
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,750
just short circuit the pin 2 and 3 in RS232 in PC and type some thing in hyperterminal (select echo mode). Then if you could see the same letter received then no problem with RS232 to USB convertor.

i tried it and its works good but sometimes the adapter automatically disconnect so i guessed that maybe the problem occurs because of untaching and taching

---------- Post added at 09:39 ---------- Previous post was at 09:28 ----------

i have set it all good (in the hyper terminal) - and the default baud rate of the sensor is 9600 so i set this at the hyper terminal to

i guess that the problem can occurs because Little endian/Big endian....should it?

some knows how should i change it in the hyper terminal?
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
47,960
Helped
14,147
Reputation
28,553
Reaction score
12,833
Trophy points
1,393
Location
Bochum, Germany
Activity points
278,233
when i connect the adapter i measure -1v at the same point, is it sounds good?
A sensor with a regular RS232 driver should have a more "stiff" output level, but it should still work. Even more interesting, does the positive level during character transmission reach the RS232 receiver threshold (at least + 3V). You'll need an oscilloscope to see the waveform clearly. I presume, that RS232 ground (pin 5) us connected properly.

In any case, you need to know the specification of the sensor baudrate and transmission protocol.

i guess that the problem can occurs because Little endian/Big endian....should it?
Unlikely. The term applies to binary data representations. In this case, you won't see readable characters with Hyperterminal at all. As said, you have to get clear about the sensor protocol.
 
  • Like
Reactions: itmr

    itmr

    points: 2
    Helpful Answer Positive Rating

itmr

Member level 3
Joined
Nov 5, 2010
Messages
55
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,750
Thank U all and my problem occurs because someone that works with this sensor decided to work in 38400 bit/sec and once this sensor configured - u must works at the same br to configure it again - this sensor save the last br although u disconnect the power...thats what i missed. - so ckshivaram u right
so i run my design for all the br options and at 38400 it works good.
thank you guys for the advices..
have a good day
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top