Serial Communications

advertisement
Serial Communications
Standards
(Partly Excerpted from Simpl Primer)
Cabling
Configuration
Protocol
Standards
RS-232, RS-422, and RS-485
• The terms RS-232, RS-422, and RS-485 all
refer to physical standards for serial
communication developed by the Electronic
Industries Association (EIA).
• The standards specify the electrical
interface between equipment.
• Any device that conforms to one of the
standards above should be able to
communicate with any other device
conforming to the same standard.
RS-232
• By far the most popular of the serial
protocols
• “Single Ended” meaning the signals are
referenced to ground and therefore limited
in cable length
• Approx. 50’ maximum cable length
• Many A.V., lighting and other devices
implement RS-232
RS-422 and RS-485
• These are less often used
• Most often found in instrumentation
systems in industrial environments
• “Double Ended” signal electronics means
much greater distances
• Up to 5000’ cable length
• Cresnet is RS-485
RS-232 Standard Cabling
• DB-25 is full industry standard
• DB-9 has become more popular over last
several years due to compact size. It is a
limited but normally adequate
implementation
• DTE is Data Terminal Equipment
(Computer)
• DCE is Data Communications Equipment
(Modem)
• DTE talks to DCE
Crossover
• DTE should connect to DCE with straight
through cable
• DTE can connect to DTE and DCE can
connect to DCE using a crossover cable
Handshaking
• Handshaking is the process of ensuring that
data not be transmitted when the receiver is
not ready and to ensure error free
transmission.
• Handshaking can be either hardware or
software
• Handshaking may not be required if the
amount of data is small.
Minimal Implementations
• Although the RS-232 standard uses up to 25
wires, as few as 2 may be used for 1 way
communications, or as few as 3 for 2 way
communications. The other pins are either
looped back on themselves, or not
implemented internally.
• The minimum signals are: Ground, TX and
RX
• Both communicating devices must be
satisfied with the cabling
Other Serial Standards
• USB, Firewire, SCSI and ethernet are all
more sophisticated serial standards.
• To date, they are mostly limited to
computer peripherals
• Expect to see USB may be a control
standard in the future
• Ethernet is beginning to be used for control
For Crestron Systems
• The COM ports can be configured for
RS232, RS422 or RS485 with minimal or
greater level implementation.
• The I.R. ports can be used as 1 way
minimally implemented RS232 with
Ground and TX only.
• Crestron cable database shows many
cabling requirements for controlled devices
Configuration
• Once the hardware is correctly connected,
the data configuration must be determined
and adhered to by both devices
• Data rate (Baud)
• Number of data bits (7 or 8)
• Number of stop bits
• Parity or no parity
• Handshaking
Configuration
• The controlled device will have a default
configuration and may be changeable
• Normally, best practice is to leave the
controlled device in default and program the
controller (Crestron) to that standard.
Protocols
• Each device to be controlled will have a
protocol, which are the “rules”
• Often, this is simply a table with the
controllable commands and the data to be
sent for that command.
– Example: POWER ON = 05(H)
Power Off = 06(H)
• The (H) in the example refers to HEX
Data formats
• The device protocol may be listed in Hex,
Decimal, Binary or ASCII. The
programmer needs to ensure that the
program sends appropriate data format.
Download