Analysis of Bluetooth baseband data transmission mechanism

Abstract: Analysis of the baseband data transmission mechanism in the Bluetooth protocol system lays the foundation for further comprehensive and in-depth research, development and application of Bluetooth technology. Based on the introduction of the basic concepts, it focuses on the analysis and discussion of Bluetooth device connection, data transmission and security mechanisms.

Bluetooth (Bluetooth) is a new, open, low-cost, short-distance wireless connection technology that can replace short-distance cables to achieve wireless transmission of voice and data. This effective and inexpensive wireless connection technology can easily connect computers and peripherals, mobile phones, PDAs, information appliances, and other devices. Within the reach of it, all kinds of information-based mobile portable devices can be realized without It can also be used for wireless resource sharing, and can also be connected to the Internet through Wireless LAN to realize wireless transmission of multimedia information.

The Bluetooth system adopts a Scatter structure, and constitutes a piconet (Piconet) between devices and in slave mode, supporting point-to-point and point-to-multipoint communication. It adopts GFSK modulation, has good anti-interference performance, and reduces co-channel interference through fast frequency hopping and short packet technology to ensure the reliability of transmission. The frequency band used is the 2.4GHz ISM band that does not require a license.

The Bluetooth protocol is roughly divided into four parts from the protocol source: Core protocol, cable replacement protocol (RECOMM), circuit control protocol and optional protocol. The core protocol is the Bluetooth patent protocol, which was completely developed by the Bluetooth SIG, including the baseband protocol (BB), connection management protocol (LMP), logical link control and adaptation protocol (L2CAP) and service discovery protocol (SDP). The Bluetooth protocol can be divided into three parts: the underlying hardware module, the middle protocol layer, and the high-end application layer from the architecture. The link management layer (LM), baseband (BB), and radio frequency layer (RF) constitute the underlying module of Bluetooth. This shows that the baseband layer is an important part of the Bluetooth protocol. This article mainly analyzes the most important baseband data transmission mechanism in Bluetooth technology.

1 Baseband protocol overview

Figure 1 shows a schematic diagram of the Bluetooth system structure. In the Bluetooth system, a network using Bluetooth technology to connect devices is called a piconet (Piconet), which consists of a master node (Master Unit) and multiple slave nodes (Slave Unit). The master node is a Bluetooth device used to synchronize other nodes in the piconet and is the initiator of the connection process. It can maintain a connection with up to 7 slave nodes at the same time. The slave node is a device other than the master node in the piconet. Two or more piconets can be connected to form a scatternet.

Figure 2 shows a schematic diagram of the Bluetooth protocol structure. The baseband layer is located above the Bluetooth radio frequency of the Bluetooth protocol stack, and together with the radio frequency layer constitutes the physical layer of Bluetooth. Essentially, as a link controller, it describes the digital signal processing specifications of the baseband link controller and works in conjunction with the link manager to perform link layers such as connection establishment and power control, as shown in the figure 3 shown. The baseband transceiver divides time (time division) while frequency hopping (frequency division), adopts time division duplex (TDD) working mode (alternate transmission and reception), and the baseband is responsible for writing digital signals and reading data from the transceiver . Mainly manage physical channels and links, responsible for frequency hopping selection and transmission of Bluetooth data and information frames, like error correction, data whitening, Bluetooth security, etc. The baseband also manages synchronous and asynchronous links, processes packet packets, performs paging, querying visits, and obtaining Bluetooth devices.

It is specified in the Bluetooth baseband protocol that Bluetooth devices can use 4 types of addresses for the same occasion and status. Among them, the 48-bit Bluetooth device address BD_ADDR (IEEE802 standard) is the only standard for the Bluetooth device connection process; the 3-bit piconet activation node address AM_ADDR is used to identify the active member in the piconet, and the three bits of this address are all used for broadcasting Information; 8-bit piconet sleeping node address PM_ADDR, used to identify the sleeping slave node in the piconet. The piconet access address AR_ADDR is assigned to the slave node in the piconet to start the wake-up process.

When piconet master-slave nodes communicate, they must keep in sync with each other. The clocks used for synchronization include the local device clock CLKN which is not adjusted nor closed, the system clock CLK of the master node in the piconet, and the compensation clock CLKE for the master node clock to periodically update the local device clock of the slave node to maintain master-slave synchronization .

Like other wireless technologies, the piconet in Bluetooth technology realizes the wireless transmission of data by using various channels. Among them, the physical channel represents a pseudo-random frequency hopping sequence that hops on 79 or 23 radio frequency channels. The frequency hopping sequence of each piconet is unique and is determined by the Bluetooth device address of the master node; in addition, Bluetooth has 5 Logical channels that convey different types of information, they are:

(1) LC channel: Control channel, used to transmit link layer control information;

(2) LMC channel: link management channel, used to transmit link management information at the link layer;

(3) UA channel: user channel, used to transmit asynchronous user information;

(4) UI channel: user channel, used to transmit isochronous user information;

(5) US channel: User channel, used to transmit synchronized user information.

In the Bluetooth system, the master and slave nodes take turns to transmit data in a time division duplex (TDD) mechanism. Therefore, the channel can be divided into time slots with a length of 625 μs (TIme Slot), and numbered by the piconet master node clock (0-2 27-1). send.

2 Bluetooth data transmission

Bluetooth supports circuit and packet switching, data is transmitted in channels in packets, and flow control is used to avoid packet loss and congestion. In order to ensure the correct transmission of packet data, whitening and error correction of the data are also carried out. The transmission mechanisms are analyzed separately below.

2.1 Bluetooth grouping

Packet data can contain voice, data, or both. Packets can occupy multiple time slots (multi-slot grouping) and can continue to be sent in the next time slot. The payload also has a 16-bit error check identification and check (CRC). There are 5 common packet types, 4 SCO packet and 7 ACL packet. The general packet format is shown in Figure 4.

Figure 3 Baseband layer abstraction

Among them, the access code (Access code) is used for timing synchronization, offset compensation, paging and query. There are three different types of access codes in Bluetooth:

(1) Channel access code (CAC): used to identify a piconet;

(2) Device access code (DAC): used for device paging and its response;

(3) Query access code (IAC): used for device query purpose.

The packet header (Header) contains 6 fields for link control. Among them, AM_ADDR is the active member address, TYPE indicates the packet type, FLOW is used for the ACL flow control bit, ARQN is the packet identification, and SEQN is used for the packet number of the packet rearrangement. Bluetooth uses a fast, unnumbered packet confirmation method, and determines whether a data packet is received by setting an appropriate ARQN value. If it times out, ignore this packet and continue to send the next one.

2.2 Link and flow control

Bluetooth defines two types of links, namely connection-oriented synchronous link (SCO) and connection-free asynchronous link (ACL). The SCO link is a symmetrical point-to-point synchronous link between the master and slave nodes. The SCO packet is sent within the reserved time, which belongs to circuit switching and mainly carries voice information. The master node can support 3 SCO links at the same time, and the slave node can support 2 to 3 link SCO at the same time. The SCO packet does not support retransmission. The SCO link is established by the master node LMP sending a SCO establishment message, which contains timing parameters (Tsco and Dsco).

The ACL link is a mechanism for the master node of the Peak network to provide asynchronous or synchronous data exchange with any slave nodes in the time slots that are not reserved for the SCO link. A pair of master and slave nodes can only maintain one ACL link. When using multiple ACL packets, Bluetooth uses a packet retransmission mechanism to ensure data integrity. The ACL packet does not specify a slave node, it is considered a broadcast packet, and each slave node receives this packet.

Bluetooth recommends the use of FIFO (First In First Out) queues to implement the transmission and reception of ACL and SCO links. The link manager is responsible for filling these queues, and the link controller is responsible for automatically clearing the queues. When the receive FIFO queue is full, flow control is used to avoid packet loss and congestion. If the data cannot be received, the receiver's link controller sends a STOP instruction and inserts it into the returned packet header (Header) with the FLOW bit set. When the sender receives the STOP instruction, it freezes its FIFO queue to stop sending. If the receiver is ready, send a GO packet to the sender to resume data transmission, FLOW bit is 0.

2.3 Data synchronization, scrambling and error correction

Since the Bluetooth device transmitter uses a time division duplex (TDD) working mechanism, it must alternately send and receive data in a synchronized manner. Piconet achieves synchronization through the system clock of the master node and determines the phase in its frequency hopping sequence. When the piconet is established, the master node's clock is transmitted to the slave node, and each slave node adds an offset to its own local clock to achieve synchronization with the master node. During the same lifetime, the master node will not adjust its own system clock. In order to match the clock of the master node, the slave node will periodically update the offset. The Bluetooth clock should have a resolution of at least 312 μs. Compared with the ideal 625ms time slot, the average timing of the packet transmission of the master node should not exceed 20ppm, and the jitter should be less than 1ms.

Before packet data is sent and before FEC encoding, the packet header and payload are scrambled to randomize the packet. When receiving data packets, use the same whitened word for descrambling.

In order to improve the reliability of data transmission and the anti-interference of the system, the Bluetooth data transmission mechanism uses three error correction methods: 1/3 rate FEC encoding (that is, each data bit is repeated 3 times), and redundant 2/3 rate FEC encoding (That is, a polynomial generator is used to encode the 10-bit code into a 15-bit code) and the automatic data request retransmission method (that is, the sender keeps retransmitting the data packet until it times out before receiving the confirmation message from the receiver).

Figure 4 Bluetooth packet format

3 Bluetooth device connection

The Bluetooth link controller works in two main states: Standby and ConnecTIon. In Bluetooth devices, Standby is the default low-power state, which only runs the local clock and does not interact with any other devices. In the connected state, the master node and the slave node can exchange packets for communication, so to achieve mutual communication between Bluetooth devices, you must first establish a connection with each other. Because the ISM frequency band used by Bluetooth is a frequency band open to all radio systems and will encounter various sources of interference, Bluetooth uses packet packet rapid confirmation technology and frequency hopping scheme to ensure the stability of links and channels. The frequency hopping sequence is used as a physical channel during connection establishment and communication. Frequency hopping selection is to select the communication channel.

3.1 Frequency hopping selection

Frequency hopping technology divides the frequency band into several hop channels. The radio transceiver continuously jumps from one channel to another according to a certain code sequence (in the manner of generating random numbers), and both the sending and receiving parties can communicate and synchronize according to this rule. The instantaneous bandwidth of frequency hopping is very narrow, and spread into a wide frequency band through spread spectrum technology to minimize the impact of interference. When a device is activated, the device is assigned 32 frequency hopping frequency points, and then the device receives and sends information on these frequency hopping points. The general frequency hopping selection scheme consists of two parts, that is, selecting a sequence and mapping the sequence on the frequency hopping frequency point. For each case, two frequency hopping sequences, slave-master and master-slave, are required. The frequency hopping sequences used in the Bluetooth system are as follows:

(1) Call frequency hopping sequence: used in the state of Page;

(2) Call response sequence: used in Page Response state;

(3) Query sequence: used in the status of Inquiry;

(4) Query response sequence: used in the status of Inquiry Response;

(5) Channel frequency hopping sequence: used in connected (ConnecTIon) state.

3.2 Bluetooth connection establishment

The process from the standby state to the connection state is the connection establishment process. Generally speaking, the connection establishment process of the two devices is as follows:

First, the master node uses GIAC and DIAC to query Bluetooth devices within range (query status). If any nearby Bluetooth device is listening for these queries (querying the scan status), after sending its address and clock information, the slave node can start listening for paging messages from the master node (page scan). The master node is discovering nearby These devices can be paged between devices (paging status) to establish a link. After the slave device of the page scan is paged by the master node, it will respond with a DAC (device access code) (Slave response substate). After receiving the response from the slave node, the master node can send the real-time clock, BD_ADDR, BCH parity bit and device class (FHS packet) of the master node, and finally enter the connection state after the slave node has received this FHS packet . The specific process is shown in Figure 5.

As can be seen from Figure 5, at different stages of the Bluetooth connection establishment, the master node and the slave node are in different states. These states include:

Inquiry: Inquiry is used by the master node to find Bluetooth devices in the monitorable area, so as to obtain the device address and clock of the node by collecting the response message from the slave node. The query process uses IAC;

Inquiry Scan: The Bluetooth device periodically monitors the inquiry messages from other devices so that it can be discovered. During the scanning process, the device can monitor the general query access code (GIAC) and the specific query access code (DIAC);

Inquiry response: The slave node responds to the inquiry message in FHS packets, which carries the slave node's DAC, local clock and other information;

Page: The master node activates a slave node and establishes a connection by sending messages in different frequency hopping sequences. The paging process uses DAC;

Page Scan: The slave node periodically wakes itself up during the scan window interval and monitors its own DAC. The slave node selects a scan frequency based on the page hopping sequence on this scan window every 1.28s;

Slave Response: When the slave node receives the paging message from the master node in paging scan state, it enters the response state and responds to the paging message of the master device;

Master Response: After the master node receives the slave node's response to its paging message, the master node sends an FHS packet to the slave node. If the slave node responds with a response, the master node enters the connected state.

3.3 Connection status

The connection (connecTIon) state starts with a POLL packet sent by the master node, indicating that the connection has been established. At this time, the packet can be sent back and forth between the master and slave nodes. Both ends of the connection, the master and slave nodes, use the access code and clock of the master node, and the frequency hopping used is the channel frequency hopping sequence. That is, after the connection is established, the Bluetooth device address (BD_ADDR) of the master node determines the frequency hopping sequence and channel access code. The Bluetooth device in the connected state can have the following sub-states:

Active: In this mode, the master and slave nodes are listening, sending and receiving packets on the channel, and keep in sync with each other;

Sniff: In this mode, the slave node may temporarily not support ACL grouping, that is, the ACL link enters low-energy sleep mode, vacating resources, so that activities such as paging and scanning, channels are still available;

Park: When the slave node does not need to intervene in the piconet channel, but still wants to maintain synchronization with the channel, it can enter the park (sleep) mode. At this time, it has little activity and is in low consumption mode. The slave node gives up AM_ADDR and uses PM_ADDR.

4 Bluetooth complete mechanism

If it is allowed to use Bluetooth technology to achieve unlocked doors or automatically pay in supermarkets, Bluetooth completeness is very important. The Bluetooth protocol provides a reliable security mechanism for users to transmit data. First, the Bluetooth baseband provides protection and information encryption mechanisms for users at the physical layer, and encrypts user information at the link layer through equivalent authentication. The Bluetooth device uses the query / response method for authentication during the connection process. A device sends a password or query, and the slave device responds to the password, which prevents theft and misuse. The information encryption mechanism uses serial password encryption algorithm to encrypt user data or information after the Bluetooth device connection is established, thereby increasing system security. There are four parameters in the link layer to ensure the security of communication. They are Bluetooth device address BD_ADDR, authentication private key, encryption private key and random code RAND. If the user has a higher level of confidentiality requirements, a more effective complete mechanism of the transport layer and application layer can be used. In short, the purpose of the Bluetooth complete mechanism is to provide an appropriate level of complete protection. Since Bluetooth is completely a very complicated issue of Bluetooth, we will not discuss it further due to space limitations.

This article mainly analyzes and discusses the most basic and most important baseband layer in Bluetooth technology, which lays the foundation for further in-depth research, development and application of Bluetooth technology. Bluetooth technology is mainly used in a small range of home and office information transmission systems and information appliances, so the development and application of Bluetooth technology has important practical significance. In particular, China is densely populated, has broad application prospects, and will have a significant impact on China's national economic construction.

MAINTEX is a professional development and production of BLDC treadmill motor & brushless DC treadmill motor manufacturer and supplier in China. Welcome to contact us for treadmill motor of your demands.

If you want Treadmill Motor, BLDC treadmill motor, brushless DC treadmill motor or Other Products , please contact us to Customize for you.

Treadmill Motor

treadmill motor,BLDC treadmill motor,brushless DC treadmill motor

Shenzhen Maintex Intelligent Control Co., Ltd. , https://www.maintexmotor.com