Shop OBEX P1 Docs P2 Docs Learn Events
Rs232-485 — Parallax Forums

Rs232-485

JerryEJerryE Posts: 5
edited 2006-07-19 20:44 in General Discussion
Hi All
I am working with a project where i going to use 2 rs232 and one rs485 port on my sx28.
When i check the RS232 output from my PC (with scopemeter) i am clear about the data
sent from value 1-126, after that it change much and the bits is not where i was hoping for.
The settings was the popular 1,8 none parity. How shall i convert the other 127-255?
I can find out this but i hope one of you guys could help me out here. Thanx...

Comments

  • PJMontyPJMonty Posts: 983
    edited 2006-07-14 20:22
    Jerry,

    You don't say what language you are using on the PC, but in the settings to open the serial port, see if there is an option to open it in binary mode. It sounds like you're in ASCII mode and the language is doing some weird stuff with the values past 127.
      Thanks, PeterM
  • JerryEJerryE Posts: 5
    edited 2006-07-14 21:01
    Hi Peter
    I only open a terminal on the pc, and hold down the alt key and put the number (1-255).
    This sending the code to the port and i check with an ocilloscope on the pins. As i say it make sense 1-126 but not 127-255.
    The port is 1,8,n soo i can send 1 byte but the coding is not clear for me after 126. The ascii shall have no matter i think
    because i send any number with alt key. What do you think. Regards Jerry (sweden)
  • Oliver H. BaileyOliver H. Bailey Posts: 107
    edited 2006-07-15 01:36
    Jerry,
    There are a number o things that can go wrong in trying to capture and convert RS232 to RS485. What type of Scopemeter are you using? Do you mean oscilloscope, logic analyzer, or Serial Port analyzer? You also don't mention handshaking. Are you using none, hardware, or XON/XOFF? Are you using any pace characters? Are you using any delyas between characters? Any or all of these can have a big impact on the receive timing depending on the type of analyzer your using.

    Oliver
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-07-15 16:40
    http://bray.velenje.cx/avr/terminal

    This site provides Terminal v1.92 for free [noparse][[/noparse]maybe]. I am having trouble connecting and they may have gone to shareware.

    Hyperterminal is mentioned in another thread as supporting a limited ASCII from 0-127 and only the visual characters. Terminal will also handle everything in HEX and can operated with odd serial formats [noparse][[/noparse]like 12 bits]. XON/XOFF and other handshaking has indication of on or off condition.

    Essentially RS-232 and RS-485/422 is about the driver chips. RS-422 in particular is set up to mimic RS-232 transparently in a full duplex mode, but has 2 separate twisted pairs [noparse][[/noparse]one for Rx and one for Tx].

    This is a simple node-to-node communication set up. Since you have 3 nodes, you need to clarify their relationships to eachother. Seems one should be the master and the other two slaves of some sort. The master could enable one by broadcasting an address with an enabling code [noparse][[/noparse]this would not be in the SX, but in the master] or you might have to have handshaking controls via wire.

    Definitely need more info.· Full duplex would allow you to send ASCII to the slave and have it return with a stream of raw data in HEX.· This could easily be captured and timestamped in a DOS file.· At least with Terminal v.1.92 it can work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • JerryEJerryE Posts: 5
    edited 2006-07-15 16:55
    It is now clear for me that it is the terminal prog. that is the problem. Many Thanx to you guys who open my mind.
    Regards Jerry
  • nick bernardnick bernard Posts: 329
    edited 2006-07-19 20:44
    jerry are you trying to send a byte variable (0-255) in a single character in a sentence?

    i find using 2 characters ("0" to "F" fetched in a lookup table) to transmit data over a serial interface is better because i can watch the data on hyperterminal easily (so could someone who may have to service my designs in the future).

    consider formatting your sentence structure to be more hyperterminal friendly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    engineer, fireman, bowler, father, WoW addict [noparse];)[/noparse]
Sign In or Register to comment.