Introduction
I’ve discovered something amazing - we are stronger together. And so are electronics! How do you heighten the quality of communication between two parts that hardly understand each other? Worry no more for we will explore some of the answers. It’s all about interfacing!
Understanding interfacing techniques, including communication protocols, data transfer methods, and device drivers, is essential for electronics makers to connect their devices to other systems. Without interfacing no electronics could talk to each other and that’s just so very sad, so we better start learning how to connect them!
Data transfer methods
Transmission modes is a term of 3 methods in which modules can either transmit data, receive data or both at the same time. The 3 types are simplex, half-duplex and full-duplex.
Simplex
Simplex is described as 2 modules - the transmitter and receiver, see Figure 1. One module is the sender and the other module is the receiver. They cannot change roles and it is thus only a one-way communication.

Figure 1: Illustrates the concept of the simplex transfer method. As indicated by the direction of the arrow, the data travels only from the sender to the receiver module.
The transmitter module can use the full capacity of the communication medium, for example, radio signals and/or cables, to transmit data. A one-way radio broadcast is a simplex example; modern keyboards and radio-controlled devices may also have a return channel.
Half-duplex
Half-duplex is when 2 modules can switch between the Transmitter and Receiver roles, see Figure 2. For half-duplex both modules can transmit and receive data. They can switch roles. However, it is important to note that each module cannot have both roles at the same time.

Figure 2: Illustrates the concept of the half-duplex transfer method. As indicated by the direction of the arrows, data can be transmitted and received by both modules. But one module can only hold one role at the time.
At half-duplex you can again, as with simplex, use the full capacity of the communication medium. Half-duplex is for example seen in the data transfer in walkie talkies.
Full-duplex
Full-duplex is where 2 modules can have both roles at the same time - both modules can transmit and receive data at the same time, see Figure 3.
There is a limitation of full-duplex in terms of transmission medium capacity. As we learned earlier both half-duplex and simplex can use the full capacity of the communication medium, whereas for full-duplex this highway of data must be shared between each module or the modules must each have their own transmission medium.

Figure 3: Illustrates the concept of the full-duplex transfer method. As indicated by the direction of the arrows, data can be transmitted and received by both modules at the same time.
Full duplex is for example used in the communication between phones and in the microcontroller Arduino UNO.
Serial and parallel communication
Serial
The data that travels between the transmitter and the receiver modules can be separated into serial and parallel communication. In other words, data can be transmitted serially or as several bits in parallel. Serial communication transmits bits sequentially; timing may use a shared clock or agreed asynchronous bit timing, see Figure 4.

Figure 4: Illustrates serial communication between two modules. Here we notice that the values for the data that is transmitted enter the receiver module one by one.
The advantage of serial communication is that it is cheaper and simpler than parallel communication. Serial communication is also typically used over longer distances than parallel communication
Parallel
Parallel transmission consists of several cables, one cable for each bit you want to transfer per clock cycle, see Figure 5.

Figure 5: illustrates the concept of parallel communication. Each cable represents a bit that is transferred per clock cycle.
Parallel communication is often used at short distances. Parallel communication carries several bits per transfer, but is not inherently faster than serial communication: clock rate, encoding, signal integrity and link design determine throughput.
Communication protocols
A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any kind of variation of a physical quantity. The protocol defines the rules, syntax, semantics and synchronization of communication and possible error recovery methods.
Inter and Intra system protocols
In order to gain an understanding of inter and intra system protocols, it must be established what a protocol itself is. A protocol is a set of rules that two or more modules follow to understand what they communicate to each other. An abstraction could be the communication between two people who speak Danish and a 3rd person who speaks Hindi. If the Danes do not speak Hindi and the Hindi speaker does not speak Danish, the communication between the two parts just emerges as a random composition of letters or weird noises. To communicate with each other they need a translator.
Inter system protocols and intra system protocols, are distinguished if two modules communicate within a system, such as a printed circuit board, or whether it is a module that communicates with another module outside the system. Intra system protocols are protocols which communicate internally within a system. This would in our abstraction be when the Danish speaking and Hindi speaking people can communicate without outside assistance and understand each others languages. The inter system are then protocols that communicate beyond a system.
The method in which the data is transferred, whether it is inter or intra, is determined more specifically by which communication protocol that is in use. Some of these communication protocols could be, SPI, I2C and UART to name a few.
SPI
SPI uses the "MasterSlave" principle. SPI, Serial Peripheral Interface, has synchronous transmission. SPI transmits serially and has no built-in error check. The communication between master and slave (you can kinda think of it as the transmitter and receiver modules), is full duplex - for each clock cycle there is transmitted one bit from both devices.
The usual full-duplex SPI arrangement uses 4 signal connections, plus a common reference/ground and suitable power connections: namely MISO (Master Input Slave Out) MOSI (Master Out Slave Input), SS/CS (Slave select/chip select) SCLK(Clock).
It works so that one module is master and the other modules are slaves. The master administers the other modules and determines the speed of communication.
I2C
I2C, IIC "I squared C" or "Inter-Integrated-Circuit", is a bus protocol, which transmits data serially and synchronously. I2C can have multiple master's and slave's in a system. The protocol requires 2 connections SDA (Serial DAta) and SCL (Serial CLock). SCL is a control bus with the clock signal which in turn, determines the speed of data transmission.
I2C uses start and stop conditions to delimit transfers; these do not by themselves guarantee error-free data, see figure 6.

Figure 6: The data, or the message, begins with a START condition, which will be followed by the address specific to the slave with whom the master will communicate. From there is a read/write bit, which tells the slave whether the master will read or write to it. ACK/NACK is an acknowledge/not-acknowlegde bit, that is sent from the recipient of a message, either a slave or master, to acknowledge a byte or indicate no acknowledgement; this is not a checksum proving the data was error-free. In this figure we see 2x 8 bits that are being transmitted after the first ACK/NACK. These data packages are then acknowledge or not-acknowlegde before the stop condition of the package.
UART
The UART protocol is a circuit of 2 devices in which 1 can take a parallel signal, convert from parallel to serial and transmit this to another device, which converts the signal back to parallel. UART transmits serially and asynchronously. It has no shared clock wire; both ends still need compatible baud rates and local clocks. Basic UART communication is point-to-point and does not inherently assign master/slave roles.
UART data packets are constructed as illustrated on figure 7.
Device drivers
So now we know a little more about how data can be transmitted and received in electronics. But where exactly do we transmit to and where do we receive the data that has been transmitted? For that we use device drivers. So what are device drivers?
A device driver is a computer program that allows a computer's operating system to communicate with various kinds of hardware that connects many different modules to each other. The idea of a driver is that the hardware manufacturer can make just one type of hardware, but make it work on different operating systems. We can now imagine that such a device driver must take into consideration a lot of different factors, for it to be used in different forms of communication between electronics and be as effective as possible!
