Select serial bus

Abstract: This application note discusses the communication technology of a microcontroller as one of the cores of today's advanced electronic products and one or more peripheral devices. Previously, the peripherals of the microcontroller were connected to the data and address bus in a memory-mapped manner. However, due to the larger number of pins, the package size is increased and the overall cost is increased. To reduce costs and shrink package size, serial interfaces are clearly ideal alternatives, such as: 1-Wire®, SPI, I²C, USB, etc., which represent different physical network sizes, network drivers, power supplies, data rates, and functions select. Different types of interfaces have different advantages, and the 1-Wire interface is an innovative design in serial communication.

This article was also published in Maxim Engineering Journal, Issue 59 (PDF, 876kB).

Microcontroller (µC) is the core of various advanced electronic products today, it needs to communicate with one or more peripheral devices. Previously, µC peripherals were connected to the data and address buses in a memory-mapped manner. Decode the address line to obtain a chip select signal, so that each peripheral is assigned a unique address within a limited address range. The minimum number of pins (except power and ground) required for this interface type is: 8 (data) + 1 (R // W) + 1 (/ CS) + n address lines [n = log2 (internal Number of registers or memory bytes)]. For example, when communicating with a 16-byte peripheral, the number of pins required is: 8 + 1 + 1 + 4 = 14. The access speed of this interface is fast, but the larger number of pins also brings the problem of increased package size and increased total cost. To reduce costs and shrink package size, the serial interface is clearly an ideal alternative.

Choosing a serial bus is not easy. In addition to the need to consider the data rate, data bit transmission sequence (first pass the highest or lowest bit) and voltage, the designer should also consider the following points: How to select a peripheral (through hardware chip select input or software protocol ). How peripherals are synchronized with µC (with a hardware clock line, or with clock information embedded in the data stream). Whether the data is transmitted on a single line (switching between "high" and "low") or on a pair of differential lines (both lines switch their voltages in opposite directions simultaneously). Both ends of the communication line use matching resistors to achieve impedance matching (usually used for differential signal transmission), or are they unmatched or only matched at one end (usually used for single-ended buses). Table 1 shows the differences between various universal bus systems in the form of a matrix. Only 4 general types out of 16 possible combinations are well known.

In addition to these characteristics, specific applications will also put forward more requirements, such as power supply method, isolation, noise suppression, maximum transmission distance between µC (master) and peripherals (slave), and cable connection method (bus type, star type) , Can withstand reverse connection, etc.). Applications that have raised similar requirements include building automation, industrial control, and meter reading, and have all developed corresponding standards. 1, 2

Table 1. Overview of the serial bus system


Circuit board to backplane application requirements Serial bus systems that provide peripheral functions should not add any heavy load to the application system. Pay particular attention to the following points: The interconnection wiring must be simple (the fewer signal lines, the better). It must be possible to easily implement the protocol via software (or the chosen µC / µP itself provides this interface). Need to provide a wide range of devices. The bus system must be easily expandable. Single-ended, self-synchronizing systems that use software protocols to complete addressing require the fewest signal lines. As can be seen from Table 1, 1-Wire, LIN bus and SensorPath can meet these conditions. In this type of bus system, other factors also need to be considered (see Table 2).

Table 2. Performance differences between 1-Wire, LIN bus and SensorPath bus systems
1-Wire3 LIN Bus4 SensorPath5
Physical Network Size Board or backplane, can be expanded up to ~ 300m ~ 40m Board
Network Drivers (Hardware) Drivers are available for RS-232, I²C, USB, and general µP port pins6, 7 Drivers are available for µP port pins Super-I / O chips, µP port pins
Network Drivers (Software) Available free for various platforms, including µCs8 Available free for Freescale ™ µCs Not available
Power Supply Through the data line (typical case), local VCC (some devices) Through the data line Local VCC
Data Rate Up to ~ 15kbps (standard) or ~ 125kbps (overdrive) 9 Up to ~ 20kbps Data dependent, up to ~ 20kbps
Network Inventory Through the "search ROM" network funcTIon Not applicable, message-based addressing Not supported
Choice of Device FuncTIons Large variety of device funcTIons, including serial number, instrumentaTIon, secure memories, etc. Limited to functions needed in automotive applications Limited to temperature sensors and voltage ADCs

The physical network size only SensorPath is limited to the application of circuit board size. Under certain conditions, the use of appropriate hardware and software network drivers can greatly extend the distance of the 1-Wire bus network.

Network drivers For protocol-based networks, designers need software drivers to generate communication waveforms (link layer), identify and address individual slave devices / nodes in the network (network layer), and send / receive data (transport layer). Software drivers are related to specific operating systems and communication ports. It can provide 1-Wire hardware driver chips (hosts) and adapters based on various ports. Port types include COM, LPT, USB, and I²C. In large unmatched networks, reflections from cable ends, connectors and branches can limit the transmission performance of the network.

The power supply must power each slave device in the network to achieve normal operation. The most cost-effective method is to supply power remotely via a data cable. This method is also called "parasitic power supply", which makes it possible to read system diagnostic information (such as in power-down mode). For specific examples, please refer to Figure 3 and related content in Application Note 178: "Identify Printed Circuit Boards with 1-Wire Products" 10. Of course, parasitic power supply also reduces the available data rate because time must be set aside for power supply.

Data rate Generally speaking, the higher the data rate, the shorter the network transmission distance, and vice versa. The 1-Wire system has a power transmission function, so the maximum data transmission rate depends on the number of slave devices on the network and the total cable length (capacitance).

Network node lookup function This feature allows the host to identify the number, type and address of slave devices in the network. This is essential for a network with dynamic (changing) number of nodes. Please refer to the example on page 22 of Dallas Engineering Journal (Issue 2) 11.

If the device function selection range cannot provide the functions required by the application, even an excellent bus is useless. Compared with LIN bus and SensorPath, 1-Wire system can provide the most abundant functions at present.

I²C / SMBus and 1-Wire bus If the actual application can provide a clock line, the bus selection can be extended to I²C12 and SMBus13 devices. According to the SMBus specification, it can be regarded as a derived bus type after the timeout feature is added to the 100kbps I²C bus specification. In the case where a node loses synchronization with the bus master, the timeout feature can prevent the bus from blocking, and the I²C system needs to go through a power-on reset process to recover from this fault state to normal working state. In a 1-Wire system, the reset / online detection cycle resets the communication interface to a certain start condition.

In addition to the clock line, I²C / SMBus also provides an acknowledge bit for each byte transmitted on the bus. This reduces the effective data rate by 12%. The communication process starts with a start condition and follows the slave address and a data direction bit (read / write), and finally ends with a stop condition. For the 1-Wire system, you first need to meet the requirements of the network layer (that is, select a specific device, execute the search ROM command or broadcast); then send the command code related to the specific device, which will also affect the data transmission direction Read / write).

A prominent problem with the original I²C and SMBus bus systems is their limited 7-bit address space. Since more than 127 different device types are available, we cannot infer device functionality based on the slave device address. In addition, many I²C devices also allow users to freely set one or more address bits to connect multiple identical devices on the bus. This feature further reduces the available address space. The standard method to solve the problem of address conflict is to divide the bus system into several segments, and a certain network segment can be activated under software control at a certain moment. This network segment needs to add more hardware, which also makes the application firmware more complicated. The I²C system does not have the function of searching or enumerating network nodes, so it is difficult to deal with a system where the number of nodes changes dynamically. This problem can be solved by address resolution protocol in SMBus Specification Version 2.013. However, SMBus devices that support this feature are extremely rare.

SPI and MICROWIRE interfaces SPI14 and MICROWIRE15 (a subset of SPI) are required to provide an additional chip select line for each slave device. Due to the chip select signal, the SPI protocol only defines read / write commands for memory addresses and status registers. It does not provide answer function. Generally, the data input and data output of SPI devices use different pins. In view of the fact that the data output is tri-stated (disabled) under any circumstances except read operations, the two data pins can be connected together to form a single bidirectional data line. When other bus systems cannot provide the required functions or require higher data transmission rates, the SPI bus can be selected, which can support 2Mbps or higher rates. The disadvantage of SPI and MICROWIRE lies in the decoding logic that generates the CS signal to address a specific device. But there will be no address conflicts. Like the I²C bus, no node search function is provided. The master cannot infer the function of the device based on the logical address of the slave device, so it is difficult to manage the dynamically changing network of nodes.

RS-485, LVDS, CAN, USB 2.0 and FireWire discuss these standards to illustrate the characteristics of differential transmission. The two fastest transfer rates in this type of bus system are FireWire16 and USB 2.017, which use point-to-point electrical connections. Using advanced nodes or hubs, a virtual bus with a tree topology can be formed. Data packets are sent from the source to the endpoint (USB) or peer-to-peer transmission (FireWire) with a burst data rate of up to 480Mbps (USB 2.0) or 1600Mbps (FireWire ). Data packets of limited size and receive / buffer / retransmit communication mechanisms increase transmission time, which in turn reduces the effective data throughput. The topology and protocol of USB allows a maximum of 126 nodes to be connected, and FireWire allows a maximum of 63 nodes. The maximum transmission distance between nodes when using passive cables is 4.5m. Designed for applications including PC peripherals, multimedia, industrial control, and aviation (FireWire only), USB and FireWire devices can be plugged into the system with power (hot swap). This feature allows the number of network nodes to change dynamically.

LVDS18, RS-48519 and CAN20 can realize the bus-type structure of connecting master and slave, and even connect multiple masters. Low-voltage differential signaling (LVDS) in these standards is the fastest. If the bus length does not exceed 10m, it can work at 100Mbps. The available data rate and throughput can be faster or slower, depending on the network size. The LVDS electrical standard is specifically designed for backplane applications and supports hot swapping, but does not include any protocols.

RS-485 also only defines electrical parameters. RS-485 defines the load and the maximum number of loads per bus (32), not given in the form of nodes. The load of an electrical node can be less than 1. The typical data rate at a network distance of 12m can be up to 35Mbps, and the data rate at a distance of 1200m can reach 100kbps. These characteristics are sufficient for data acquisition and control applications. The protocol of RS-485 equipment is usually based on some protocols originally designed for RS-232.

Unlike this, the controller area network (CAN) defines a communication protocol for distributed real-time control, with high security, and is specifically oriented to automotive applications and industrial automation. Data rates range from 1Mbps at a distance of 40m to 50kbps at a distance of 1000m. The addressing mode is based on messages, and the protocol itself has no restrictions on the number of nodes. CAN nodes support hot swapping, and the number of network nodes can be changed dynamically.

In a simple, low-cost bus system, compared with LIN bus and SensorPath, the slave device of 1-Wire system can provide the most extensive functions and network drivers. In addition to the data line and reference ground, I²C and SMBus also need a clock line and VCC power supply. Of course, there are many device functions to choose from. SPI and MICROWIRE require additional chip select lines, but can provide higher data rates. In addition to supporting parasitic power supply and network node search functions, the 1-Wire interface and protocol also support hot swapping. This feature is usually only available in high-speed systems that use differential signals and SMBus 2.0 compatible products. iButton® products are widely used hot-swappable 1-Wire devices. Hot-swapping is the normal working method of these devices. Facts have proven that 1-Wire devices are extremely effective in the following applications: global identification number 21, circuit board / accessory identification and certification 10, temperature detection and execution devices, etc. Another very successful 1-Wire product is a device with secure memory and challenge-response mechanism, which can achieve two-way authentication and software code protection at the lowest cost22, 23.

A similar article appeared on Electronic Products published in September 2006.

Reference data Interbus Club. (Industrial automation) The valid M-Bus standard. (Meter reading) "Overview of 1-Wire Technology and Its Use." AN1796 (intro to 1-Wire) LIN Local Interconnect Network. (LIN specification) National Semiconductor. "Cost Effective Partitioning of IO and Management Functions in PCs-Introduction of SensorPath ™ Technology." (SensorPath) "Excellent 1-Wire Network Driver" AN244 (Hardware Driver) "1-Wire Network Reliable Design Guide" AN148 ( 1-Wire Network) "1-Wire Software Resource Guide" AN155 (Software Driver) "Determining the Recovery Time of a Multi-Slave 1-Wire Network" AN3829 (Recovery Time) "Identifying Printed Circuit Boards with 1-Wire Products" AN178 (Circuit Board Identification) "Dallas Engineering Journal," Issue 2 pdfserv.maxim-ic.com/cn/ej/DallasEJ2.pdf (Dynamic Network) "The I²C-Bus Specification, Version 2.1, January 2000." (I²C) "SMBus Specifications. "(SMBus)" M68HC11E Family. "M68HC11E.pdf (SPI)" MICROWIRE ™ Serial Interface. "AN / AN-452.pdf (MICROWIRE) The Air Power Australia Website." Firewire. "OSR-0201.ht ml (FireWire) "USB 2.0 Specification." (USB specification) National Semiconductor. "LVDS Owner's Manual: Low-Voltage Differential Signaling." (LVDS) Lammert Bies' Website. "RS485 serial information." RS-485.html (RS -485) Robert Bosch GmbH. "CAN Specification, Version 2.0." (CAN specification part A)
CAN in Automation (CiA). "CAN Specification 2.0, Part B."? 269 (CAN specification part B) "Establish a global identifier using 1-Wire devices" AN186 (Global Identifier) ​​"Protect your R & D results-two-way authentication And software function protection "AN3675 (bidirectional authentication)" uses the SHA-1 secure memory of a single bus interface to realize the identification and copy protection mechanism of Xilinx® FPGA "AN3826 (FPGA protection) Please also refer to the 1-Wire and iButton interface and interconnection Need an I²C converter? Maxim offers you! SMBus 2-Wire Interface Battery Management IC USB LVDS Line Driver / Receiver Automotive Electronics Guide RS-485 Technical Information

Cadillac Dash Cam

Cadillac Dash Cam,Wireless Dash Cam Front And Back,Front And Rear View Dash Cam,Dash Cam Front

SHENZHEN ROSOTO TECHNOLOGY CO., LTD. , https://www.rdtkdashcam.com