1
This section covers the ASCII code, asynchronous serial transmission with start, stop and parity bits and baud rate, synchronous transmission, and the physical communication standards used to connect medical equipment.
2
Serial and Parallel Transmission • Parallel transmission sends all bits of a word simultaneously on separate lines — fast but needing many conductors, and limited in distance by skew and crosstalk; it is used inside equipment (the data bus).
3
Serial transmission sends bits one after another on a single line — slower per bit but needing only one or two conductors, and far better over distance; it is used for every external link and is what this section describes. • Direction: simplex (one way only), half duplex (both ways but not at once) and full duplex (both ways simultaneously).
4
The ASCII Code • ASCII (American Standard Code for Information Interchange) is the standard code for representing characters as binary.
5
It is a 7-bit code giving 2⁷ = 128 characters, commonly stored or transmitted in 8 bits with the eighth used for parity or to give the extended 256-character set. • Structure: codes 0-31 and 127 are control characters (such as LF = 10, CR = 13, ESC = 27), and 32-126 are printable.
6
Useful landmarks: space = 32, '0' = 48, 'A' = 65, 'a' = 97 — so the decimal digits are 48 to 57, and lower case is 32 more than upper case, meaning case is changed by flipping a single bit. • Other codes:
7
EBCDIC (IBM, 8-bit), Unicode/UTF-8 (which extends ASCII to all writing systems and is what modern systems actually use), and BCD and Gray code for numeric and positional data.
8
Asynchronous Serial Transmission • In asynchronous transmission, transmitter and receiver do not share a clock; instead each character is framed by its own start and stop bits, and the receiver resynchronises at the beginning of every character.
9
The line is therefore idle for arbitrary periods between characters, which suits keyboards, terminals and instruments that send data sporadically. • The frame: the line rests in the mark (logic 1) state.
10
Transmission begins with one start bit, which is always a 0 (space) — its falling edge tells the receiver when to start sampling; then 5 to 8 data bits, sent least significant bit first; then an optional parity bit; then 1, 1.5 or 2 stop bits, always logic 1, which guarantee a transition at the start of the next character and give the receiver time to process.
11
The common configuration is written 8N1 — eight data bits, no parity, one stop bit. • Overhead is the point to remember: with 8N1, 10 bits are transmitted for every 8 bits of data, so only 80 % of the line capacity carries information — at 9,600 baud that is 960 characters per second. • Baud rate versus bit rate: the baud rate is the number of signalling elements (symbol changes) per second, while the bit rate is the number of bits per second.
12
They are equal only when each symbol carries one bit, which is the case for simple two-level signalling; with multi-level or phase modulation (as in a modem) one symbol can carry several bits, so the bit rate exceeds the baud rate.
13
Standard rates are 300, 1,200, 2,400, 9,600, 19,200, 38,400 and 115,200.
14
Both ends must be set to the same speed, data length, parity and stop bits, or the data will be garbled. • Parity is the simplest error check: a bit is added to make the total number of 1s even (even parity) or odd (odd parity).
15
It is generated and checked with XOR gates.
16
Its limitation is fundamental: parity detects any odd number of bit errors but cannot detect an even number, and it cannot correct anything.
17
Serious links therefore use checksums, CRC or Hamming codes.
18
Other detected conditions are the framing error (the stop bit is not found where expected — usually a baud-rate mismatch) and the overrun error (a character arrives before the previous one has been read). • The UART (universal asynchronous receiver/transmitter) performs all of this in hardware: on transmission it takes a parallel byte, adds start, parity and stop bits and shifts it out (a PISO shift register — 8.3); on reception it detects the start bit, samples each bit at its centre using a clock typically 16 times the baud rate, checks parity, removes the framing and presents a parallel byte (a SIPO register), raising an interrupt.
19
A USART can also work synchronously.
20
Synchronous Transmission • In synchronous transmission, transmitter and receiver are locked to a common clock — either carried on a separate line, or recovered from the data stream itself by using a self-clocking code such as Manchester encoding.
21
Data is sent as a continuous block or frame of many characters, preceded by SYN characters or a flag and followed by a CRC, with no start and stop bits around each character. • Comparison, which is the standard examination question: synchronous transmission has far lower overhead and therefore much higher efficiency and speed, and is used for bulk data; asynchronous transmission is simpler and cheaper, needs no clock recovery, tolerates irregular timing between characters, and is used for low-speed intermittent data — but its per-character framing wastes 20 % or more of the capacity.
22
Synchronous links require more complex hardware and lose synchronisation badly if the clock slips.
23
Physical Communication Standards Standard Characteristics RS-232 (EIA-232) The classic point-to-point serial standard: single-ended (unbalanced) signalling referred to a common ground, ±3 to ±15 V with negative voltage representing logic 1 (mark) and positive logic 0; limited to about 15 m and 20 kbit/s (in practice more);
24
9-pin or 25-pin connector.
25
Still ubiquitous on laboratory and medical instruments RS-422 / RS-485 Differential (balanced) signalling on a twisted pair, giving excellent noise immunity over 1,200 m at high data rates;
26
RS-485 is multi-drop, supporting up to 32 devices on one bus — used in building and equipment networks USB Differential pair plus power; hot-pluggable, host-controlled, with several speed grades; the standard interface for modern instruments and for connecting devices to a PC Ethernet (IEEE 802.3) and TCP/IP The basis of hospital networks, PACS (4.5) and central monitoring (5.2) I²C and SPI Short-distance on-board buses between a microcontroller and its sensors and peripherals — I²C uses two wires with addressing, SPI four wires with chip select and higher speed CAN bus Robust differential multi-master bus with error handling, used inside complex equipment such as imaging systems and ventilators Bluetooth, BLE, Zigbee, Wi-Fi Wireless links for telemetry, wearables and implants (5.3) HL7, DICOM, IEEE 11073 Not physical layers but the data and interoperability standards that give the bits their meaning — DICOM for images (4.5), HL7 for clinical data, and IEEE 11073 for point-of-care medical device communication • In medical equipment the physical layer must also satisfy the patient isolation requirements of 6.6: data crossing to a patient-connected circuit passes through optocouplers, isolation transformers, digital isolators or a fibre-optic link, and the interface must be designed so that no fault can raise the leakage current beyond the permitted limit.