In this series of articles, we present the most popular interfaces used to data transfer, in this case – images, between devices providing data such as processors/controllers or computers and devices presenting data such as displays and monitors.
Table of Contents
When describing ‘interfaces’, we think of connecting the devices used to data transfer. They are essential to present any content on the visual information carriers, e.g., LCD-TFTs.
We can divide interfaces into two groups:
- internal solutions – in these solutions, we directly connect components of the same device (usually set in the same enclosure) so controller and display; among them, e.g., interfaces to image transfer (RGB, LVDS, eDP, MIPI DSI, and Vx1) as well as interfaces to various data transfer, including image transfer (RS232, I2C, SPI and 8- or 16-bit parallel solutions);
- external solutions – in these solutions, we connect two separate devices, e.g., computer and monitor via cable; among them, e.g., HDMI, DVI, VGA, or DP.
We can also divide interfaces due to the type of data transmission to parallel interfaces, in which 1-bit information is transmitted via several lines, and serial interfaces, in which subsequent 1-bit information is transmitted via a single line.
In this article, we mainly focus on RS232, I2C,and SPI interfaces. To learn more about RGB, LVDS, eDP, MIPI DSI, and Vx1 interfaces, check out the article “The review of popular interfaces to image transfer – part 1”.
RS232 (Recommended Standard 232)
The RS232 interface origins in the sixties of the 20th century – it has been developed by EIA (Electronic Industries Association) to connect teletypewriters and modems. In the following decades, we used the RS232 interface to connect various devices, e.g., printers or scanners, with our computers. Today, it is used primarily in specialistic equipment, e.g., in industry.
The RS232 interface might connote cables with distinctive connectors. However, in this article, we focus on solutions integrated with PCBs intended to connect various components within a single device.
The RS232 interface is a serial solution used to connect DTE (Data Terminal Equipment) and DCE (Data Communication Equipment) devices. However, only two devices can be connected via a single line: one DTE and one DCE. The communication might be simplex or duplex, supporting both synchronous and asynchronous data transmissions. In the RS232 interface, there are a few types of lines, including:
- data lines (TxD – transmitted data, RxD – received data),
- control lines (e.g., DSR (Data Set Ready) – DCE device is ready to cooperate with DTE or DTR (Data Terminal Ready) – DTE is ready to cooperate with DCE (both DSR and DTR are ready to use all along the time of the connection);
- ground lines (e.g., GND (Ground) or PG (Protective Ground)).
According to the application requirements, you can build your subsets of lines of various complexity levels. One of the variants is three-line solutions with one TxD line (to transmit data), one RxD line (to receive data), and one GND line (Ground).
The RS232 interface is relatively resistant to electromagnetic interferences, but the data is usually transmitted with 9600 or 115200 b/s (the only exception is for specific synchronous solutions with a bandwidth of even 1 Mb/s). Moreover, it is worth remembering that the RS232 interface is exposed to voltage swings.
Master/Slave Model
Before describing two consecutive standards, so I2C and SPI interfaces, it is worth mentioning the master/slave model. In such solutions, the master device always begins the communication cycle, generating the clock signal required to transmit or receive data.
The “master/slave” term arouse controversy due to associations with slavery. In 2004, the Global Language Monitor (GLM) found the term “master/slave” to be the most egregious example of political incorrectness. Today, more and more often, it is replaced with other words as, e.g., “primary” or “replica”, which are used in, e.g., Django and Drupal frameworks. They also have been introduced by, e.g., Microsoft.
I2C (Inter-Integrated Circuit)
The I2C interface, alias IIC (Inter-Integrated Circuits), is used for attaching peripheral integrated circuits. It has been developed at the beginning of the eighties of the 20th century by Philips.
The I2C is a serial technology. It is a duplex bus with two lines: SDA (Serial Data Line) and SCL (Serial Clock Line). It is based on the master/slave model, also in multi-master architecture, so any number of master devices that control slave devices can be present. The information is transfer as 1-byte, so 8-bites “packages”. Each transmission begins with the START signal (start bit) and ends with the STOP signal (stop bit). In the meantime, the master device transmits a 7-bit address, followed by a transmission of read/write bit and desirable data to a target device. After the transfer of address, the slave device transmits one additional bit, that is ACK or NACK, so the “acknowledge” bit, which defines if the transmission runs smoothly (so we will not lose any data). Also, after the transfer of data, the slave device transmits the same bit. In the I2C interface, there are five modes of data synchronization, which differ in bandwidth:
- Standard Mode – up to 100 kbit/s,
- Fast Mode – up to 400 kbit/s,
- Fast Mode Plus – up to 1 Mbit/s,
- High Speed Mode – up to 3.4 Mbit/s,
- Ultra-Fast Mode – up to 5 Mbit/s.
Sometimes, you can also notice Turbo Mode, which bandwidth is up to 1.4 Mbit/s.
In the I2C interface, each slave device, so one single integrated circuit, has its address. A total of 128 addresses, so 128 single integrated circuits, can co-create one bus; however, you should remember the limited bandwidth of up to 5 Mbit/s. In some applications, the I2C interface might not be applied due to the relatively high impedance and low noise immunity.
Many OLED displays support the I2C interface. You can find them on Unisystem’s offer – check graphic and character solutions.
SPI (SERIAL PERIPHERAL INTERFACE)
The SPI interface is one of the most common buses used to connect microprocessors and peripherals, such as, e.g., ADC/DAC, EEPROM, or MMC/SD cards. It has been developed in the eighties of the 20th century by Motorola.
The SPI interface is a serial and full duplex bus. It is also based on the master/slave model, but not in multi-master architecture. In this technology, only one master device can be present, which manages a few slave devices. In the SPI interface, there are four types of lines needed for data transfer:
- SCLK (Serial Clock),
- MOSI (Master Output Slave Input) – use to transfer data to a slave device,
- MISO (Master Input Slave Output) – use to transfer data to a master device,
- SS (Slave Select) or CS (Chip Select) – use to select the slave device.
In the SPI interface, the master device generates the clock signal and indicates the slave device; it uses the SD or SC line to activate the slave device. The data are transferred via MOSI (from the master device to the slave device) or MISO (from the slave device to the master device). The communication is based on shift registers made of eight D flip-flops (numbered from 0 to 7). Each D flip-flop stores 1-bit information, so during the eight clock cycles, it transmits 1 byte, so 8 bits of data. Simultaneously, it is an expandable solution – there are no 8-bit limitations, so you can arbitrarily choose the, e.g., size or content of the messages.
The SPI interface is valued for its performance – the bandwidth is up to even 37.5 Mb/s. However, there is no error-checking protocol (like, e.g., ACK and NACK bits in the I2C interface), so there is a potential risk of data loss. Moreover, in some applications, the SPI interface might not be applied due to the relatively high impedance and low noise immunity. (Let’s add that it is even more nuisance than in the case of the I2C interface due to the operation frequency of the SPI interface measured in hundreds of MHz.)
The SPI interface is used primarily in displays up to 7-inch size – both LCD and OLED displays, as well as EPDs. You can find them also on Unisystem’s offer – check their availability for LCDs, graphic and character OLED displays, and EPDs.
In the context of described interfaces, there are also worth noticing 8- or 16-bit parallel solutions, which still can be found in, e.g., OLED displays. They are based on full-duplex communication to transfer 4-, 8-, 16-, or 24-bit data. However, each 1-bit information is transmitted via a separate line, which multiplied the number of wires needing to connect with microprocessors (still, you should also remember additional lines, e.g., serial clock ones).
The 8- or 16-bit parallel interfaces are still used due to uncomplicated integration to the system and the performance of data transfer bandwidth. Let’s compare parallel and serial 8-bit interface, assuming that both operate with the same clock frequency. The key difference is in transferring data – in parallel interfaces, it is transferred concurrently, so eight bit at once, while in serial interfaces, it is transferred sequentially, so one by one bit. So, in which interface will the data be transmitted eight times faster? 😉
Wonder which interface will be best for your application? Contact us – we will find the optimal solution.