PROTOCOLS FOR CONTROL AND COMMUNICATION IN THE EMBEDDED SYSTEMS AND FPGA

ПРОТОКОЛЫ КОНТРОЛЯ И ВЗАИМОДЕЙСТВИЯ ВО ВСТРАИВАЕМЫХ СИСТЕМАХ И FPGA
Safir P.
Цитировать:
Safir P. PROTOCOLS FOR CONTROL AND COMMUNICATION IN THE EMBEDDED SYSTEMS AND FPGA // Universum: технические науки : электрон. научн. журн. 2023. 9(114). URL: https://7universum.com/ru/tech/archive/item/15958 (дата обращения: 21.11.2024).
Прочитать статью:
DOI - 10.32743/UniTech.2023.114.9.15958

 

ABSTRACT

This article will describe some physical level communication protocols such  I2C, SPI, 1- wire, RS-232, RS-485. These protocols are used for control and communication with peripherals and sensors. The advantages of several communication protocols, which software libraries can be plugged in to immediately work with these protocols, and the physical topology of these protocols will be discussed.

АННОТАЦИЯ

В данной статье будут описаны некоторые коммуникационные протоколы нижнего уровня, такие как I2C, SPI[1], one wire, RS-232, RS-485. Данные протоколы применяются для контроля и связи с периферийными устройствами и сенсорами. Будут рассмотрены преимущества некоторых протоколов, какие программные библиотеки можно подключить для немедленной работы с этими протоколами, а также физическая топология этих протоколов.

 

Keywords: embedded system, FPGA, I2C, SPI, one wire, RS-232, RS-485, OSI.

Ключевые слова: ПЛИС, встраиваемые системы, I2C, SPI, one wire, RS-232, RS-485.

 

Introduction

To control and communicate with peripheral devices such as sensors, relays, motors, and other embedded systems, a number of electronics organizations have developed a number of different low- and high-level protocols in accordance with Open Systems Interconnection (ISO)[2]. In this article, we will review the low-level protocols that are most commonly used for projects with embedded systems.

Figure 1. Open Systems Interconnection (ISO)

 

Protocols

I2C

The I2C protocol is a very widespread network serial protocol, which was developed by Philips. An important feature of the I2C protocol is that on two communication cables that are used in the I2C standard, you can connect up to 112 different devices at 7 bit address and 1008 devices at 10 bit address, which support this protocol. Important features of the I2C protocol[3].

  •  Regardless of the number of sensors or other devices, 2 cables are used to control these devices, which significantly saves the output of the controlling device.
  •  SCL - clock line. Clocks are always generated by the master. SDA- Data line, data line, which is used to transmit all information.
  •  I2C has a 7 or 10 bit address space, which allows you to connect to the master up to 112 different devices simultaneously at 7 bit address (16 reserved addresses) or 1008 devices at 10 bit address.
  •  In ultra-fast mode it is possible to transmit data over the network at speeds up to 5000kHz.
  •  There is a ready-made library for Arduino called wire.h.

Figure 2. I2C

Figure 3. Message I2C

 

SPI-Serial Peripheral Interface

Figure 4. SPI

 

SPI - Serial Peripheral Interface, is a four-wire bus, which was developed by Motorola. The main building block of the SPI interface is a conventional shift register, synchronization signals and input/output bitstream which form the interface signals. Thus, the protocol SPI is more correctly called not the protocol of data transfer, but the protocol of data exchange between two shift registers, each of which simultaneously performs both the function of the receiver and the function of the transmitter. An indispensable condition for data transfer over the SPI[4] bus is the generation of the bus synchronization signal. Only the bus master is authorized to generate this signal and the operation of the bus slave is completely dependent on this signal.

  •  The SPI bus transmission speed can reach tens of megahertz, as the reception and transmission occur on two different cables in contrast to I2C. Due to the speed of SPI is suitable for video transmission, for working with memory and any other peripherals where high data transfer rates are required.
  •  Very easy to implement at the software level.
  •  To work with Arduino there is a ready library SPI.h.
  •  The disadvantages of the SPI bus are that you need to use 4 cables.

1-Wire

Figure 5. 1-Wire

 

1-wire[5] was developed by Dallas Semiconductor. 1-wire has a topology of a common bus with many slaves and one master. According to the 1-wire standard, each device in the network has a 64-bit address, which will allow to connect a sufficiently large number of devices on a single bus with a maximum bus length of 300 meters. One cable is used for two-way data transmission as well as for power supply, the second cable is the ground.

  • The data transfer rate on the 1-Wire bus can reach 111Kbit in the speed mode, but the length of the bus cable and the number of devices in the network is limited, or the standard mode with a speed of 15 Kbit.
  • Each 1-Wire device has a 64-bit identifier (ID). It consists of an 8-bit family code that identifies the type of device and the features it supports, a 48-bit serial number, and an 8-bit Cyclic Redundancy Control Code (CRC-8)[6] field. The ID is entered when the device is manufactured and stored in ROM.
  • 1-Wire is self-synchronizing, i.e., it does not require a separate line to transmit clock signals.
  • There are some devices called interface bridges. These bridges connect different interfaces, for example between I2C and 1-wire. One such chip is the DS2482-100. This chip acts as a master in relation to the 1-wire network. But it is connected to the controller using the I2C interface. DS2482-100[7] removes from the controller the main function such as the formation and optimization of edges transmitted on the bus.
  • There is also a DS2480B[8] chip that can be used as a bridge between RS232 and 1-Wire.

Conclusion

Many sensors and peripherals support multiple protocols, such as I2C and SPI, the user chooses which protocol is more convenient for him to work with. There are also chips that allow you to expand the address space for any interface and thus add additional devices to the network, without additional use of outputs in the monitored device.

 

References:

  1. Randall Hyde, The Book of I²C: A Guide for Adventurers, October 11, 2022, P. 28-36.
  2. Dharma Prakash Agrawal, Embedded Sensor Systems 1st ed. 2017 Edition, Springer, 2017, P. 98 - 103.
  3. Elecia White, Making Embedded Systems: Design Patterns for Great Software 1st Edition, O'Reilly Media, 2011, P 34 - 40.
  4. Tim Wescott, Applied Control Theory for Embedded Systems, Elsevier Science 2011, P. 123 - 140.
  5. Arnold S. Berger, Debugging Embedded and Real-Time Systems The Art, Science, Technology, and Tools of Real-Time System Debugging, Elsevier Science 2020, P. 56 -59.
  6. Arben Çela, Mongi Ben Gaid, Xu-Guang Li, Silviu-Iulian Niculescu, Optimal Design of Distributed Control and Embedded Systems, Springer International Publishing 2013, P.116 - 126.
  7.  Michael Barr, Programming Embedded Systems in C and C++ 1st Edition, O'Reilly Media, 1999, P. 45 - 67.
  8.  Arnold S. Berger, Debugging Embedded and Real-Time Systems The Art, Science, Technology, and Tools of Real-Time System Debugging, Elsevier Science 2020, P. 78 -103.
Информация об авторах

Bachelor of Science, The Azrieli College of Engineering in Jerusalem (JCE), Israel, Jerusalem

бакалавр наук, Академический инженерный колледж Азриэли, Израиль, г. Иерусалим

Журнал зарегистрирован Федеральной службой по надзору в сфере связи, информационных технологий и массовых коммуникаций (Роскомнадзор), регистрационный номер ЭЛ №ФС77-54434 от 17.06.2013
Учредитель журнала - ООО «МЦНО»
Главный редактор - Ахметов Сайранбек Махсутович.
Top