0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心
发布
  • 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
AT86RF212B-ZU

AT86RF212B-ZU

  • 厂商:

    ACTEL(微芯科技)

  • 封装:

    VFQFN32_EP

  • 描述:

    IC RF TxRx + MCU 802.15.4, General ISM

  • 数据手册
  • 价格&库存
AT86RF212B-ZU 数据手册
AT86RF212B Features • Fully integrated 769 – 935MHz transceiver including: - Chinese WPAN band from 779 to 787MHz - European SRD band from 863 to 870MHz - North American ISM band from 902 to 928MHz - Japanese band from 915 to 930MHz • Direct Sequence Spread Spectrum with different modulation and data rates: ® - BPSK with 20 and 40kb/s, compliant to IEEE 802.15.4-2003/2006/2011 - O-QPSK with 100 and 250kb/s, compliant to IEEE 802.15.4-2006/2011 - O-QPSK with 250kb/s, compliant to IEEE 802.15.4-2011 - O-QPSK with 200, 400, 500, and 1000kb/s PSDU data rate • Flexible combination of frequency bands and data rates • Industry leading link budget: - Receiver sensitivity up to -110dBm - Programmable TX output power up to +11dBm • Ultra-low current consumption: - SLEEP = 0.2µA - TRX_OFF = 450µA - RX_ON = 9.2mA - BUSY_TX = 18.0mA at TX output power +5dBm • Ultra-low supply voltage (1.8V to 3.6V) with internal regulator • Easy to use interface: - Registers, frame buffer, and AES accessible through fast SPI - Clock output with prescaler from radio transceiver • Radio transceiver features: - 128-byte FIFO (SRAM) for data buffering - Fully integrated, fast settling PLL to support Frequency Hopping - Battery monitor - Adjustable receiver sensitivity - Integrated TX/RX switch, LNA, and PLL loop filter - Automatic VCO and filter calibration - Integrated 16MHz crystal oscillator ™ • Special IEEE 802.15.4 -2011 hardware support: - FCS computation and Clear Channel Assessment - RSSI measurement, Energy Detection and Link Quality Indication • MAC hardware accelerator: - Automated acknowledgement and retransmission - CSMA-CA and Listen Before Talk (LBT) - Automatic address filtering and automated FCS check • Extended feature set hardware support: - AES 128-bit hardware accelerator - Antenna Diversity - RX/TX indication for external RF front end control - True Random Number Generation for security application • Optimized for low BoM Cost and ease of production: - Few external components necessary (crystal, capacitors and antenna) - Excellent ESD robustness - Industrial temperature range from -40°C to +85°C • I/O and packages: - 32-pin Low-Profile QFN Package 5 x 5 x 0.9mm³ - RoHS/Fully Green • Compliant to IEEE 802.15.4-2003/2006/2011 • Compliant to ETSI EN 300 220-1, and FCC 47 CFR Section 15.247 42002E–MCU Wireless–02/2015 Low Power, 700/800/900MHz Transceiver for ZigBee, IEEE 802.15.4, 6LoWPAN, and ISM Applications AT86RF212B Rev. 42002E–MCU Wireless–02/2015 1 1 Pin-out Diagram DIG3 1 DIG4 2 AVSS 3 RFP 4 RFN 5 AVSS 2 AT86RF212B 1. XTAL2 XTAL1 AVSS EVDD AVDD AVSS 32 31 30 29 28 27 26 25 24 exposed paddle IRQ /SEL 22 MOSI 21 DVSS 20 MISO 6 19 SCLK DVSS 7 18 DVSS /RST 8 17 9 10 11 12 13 14 15 16 CLKM DEVDD DVDD DVDD DVSS SLP_TR DIG2 AT86RF212B DVSS 23 AVSS DIG1 Note: AVSS AVSS Figure 1-1. Atmel AT86RF212B Pin-out Diagram. The exposed paddle is electrically connected to the die inside the package. It shall be soldered to the board to ensure electrical and thermal contact and good mechanical stability. 42002E–MCU Wireless–02/2015 AT86RF212B 1.1 Pin Descriptions Table 1-1. Atmel AT86RF212B Pin Description. Pins Name Type Description 1 DIG3 Digital output (Ground) 1. RX/TX Indication, see Section 11.4 2. If disabled, pull-down enabled (AVSS) 2 DIG4 Digital output (Ground) 1. RX/TX Indication (DIG3 inverted), see Section 11.4 2. If disabled, pull-down enabled (AVSS) 3 AVSS Ground Ground for RF signals 4 RFP RF I/O Differential RF signal 5 RFN RF I/O Differential RF signal 6 AVSS Ground Ground for RF signals 7 DVSS Ground Digital ground 8 /RST Digital input Chip reset; active low 9 DIG1 Digital output (Ground) 1. Antenna Diversity RF switch control, see Section 11.3 2. If disabled, pull-down enabled (DVSS) 10 DIG2 Digital output (Ground) 1. Antenna Diversity RF switch control (DIG1 inverted), see Section 11.3 2. RX Frame Time Stamping, see Section 11.5 3. If functions disabled, pull-down enabled (DVSS) 11 SLP_TR Digital input Controls sleep, transmit start, and receive states; active high; see Section 6.6 12 DVSS Ground Digital ground 13, 14 DVDD Supply Regulated 1.8V voltage regulator output or regulated voltage input; digital domain, see Section 9.5 15 DEVDD Supply External supply voltage; digital domain 16 DVSS Ground Digital ground 17 CLKM Digital output Master clock signal output; low if disabled, see Section 9.7 18 DVSS Ground Digital ground 19 SCLK Digital input SPI clock 20 MISO Digital output SPI data output (master input slave output) 21 DVSS Ground Digital ground 22 MOSI Digital input SPI data input (master output slave input) 23 /SEL Digital input SPI select, active low 24 IRQ Digital output 1. Interrupt request signal; active high or active low; configurable, see Section 6.7 2. Frame Buffer Empty Indicator; active high, see Section 11.6 25 XTAL2 Analog input Crystal pin, see Section 9.7 26 XTAL1 Analog input Crystal pin or external clock supply, see Section 9.7 27 AVSS Ground Analog ground 28 EVDD Supply External supply voltage, analog domain 29 AVDD Supply Regulated 1.8V voltage regulator output or regulated voltage input; analog domain, see Section 9.5 30, 31, 32 AVSS Ground Analog ground Paddle AVSS Ground Analog ground; Exposed paddle of QFN package 3 42002E–MCU Wireless–02/2015 1.2 Analog and RF Pins 1.2.1 Supply and Ground Pins EVDD, DEVDD EVDD and DEVDD are analog and ® Atmel AT86RF212B radio transceiver. digital supply voltage pins of the AVDD, DVDD AVDD and DVDD are outputs of the internal voltage regulators and require bypass capacitors for stable operation. The voltage regulators are controlled independently by the radio transceivers state machine and are activated depending on the current radio transceiver state. The voltage regulators can be configured for external supply; for details, refer to Section 9.5. AVSS, DVSS AVSS and DVSS are analog and digital ground pins respectively. The analog and digital power domains should be separated on the PCB. 1.2.2 RF Pins RFN, RFP A differential RF port (RFP/RFN) provides common-mode rejection to suppress the switching noise of the internal digital signal processing blocks. At board-level, the differential RF layout ensures high receiver sensitivity by reducing spurious emissions originated from other digital ICs such as a microcontroller. The RF port is designed for a 100Ω differential load. A DC path between the RF pins is allowed; a DC path to ground or supply voltage is not allowed. Therefore, when connecting an RF-load providing a DC path to the power supply or ground, AC-coupling is required as indicated in Table 1-2. A simplified schematic of the RF front end is shown in Figure 1-2. Figure 1-2. Simplified RF Front-end Schematic. PCB AT86RF212B 0.9V M0 4 AT86RF212B LNA RX PA TX CM Feedback RXTX 42002E–MCU Wireless–02/2015 AT86RF212B The RF port DC values depend on the operating state; refer to Chapter 7. In TRX_OFF state, when the analog front-end is disabled (see Section 7.1.2.3), the RF pins are pulled to ground, preventing a floating voltage larger than 1.8V which is not allowed for the internal circuitry. In transmit mode, a control loop provides a common-mode voltage of 0.9V. Transistor M0 is off, allowing the PA to set the common-mode voltage. The common-mode capacitance at each pin to ground shall be < 100pF to ensure the stability of this common-mode feedback loop. In receive mode, the RF port provides a low-impedance path to ground when transistor M0 (see Figure 1-2) pulls the inductor center tap to ground. A DC voltage drop of 20mV across the on-chip inductor can be measured at the RF pins. 1.2.3 Crystal Oscillator Pins XTAL1, XTAL2 The pin 26 (XTAL1) of Atmel AT86RF212B is the input of the reference oscillator amplifier (XOSC), the pin 25 (XTAL2) is the output. A detailed description of the crystal oscillator setup and the related XTAL1/XTAL2 pin configuration can be found in Section 9.7. When using an external clock reference signal, XTAL1 shall be used as input pin. For further details, refer to Section 9.7.3. 1.2.4 Analog Pin Summary Table 1-2. Analog Pin Behavior – DC Values. Pin Values and Conditions Comments RFP/RFN VDC = 0.9V (BUSY_TX) VDC = 20mV (receive states) VDC = 0mV (otherwise) DC level at pins RFP/RFN for various transceiver states. AC coupling is required if a circuitry with a DC path to ground or supply is used. Serial capacitance and capacitance of each pin to ground must be < 100pF. XTAL1/XTAL2 VDC = 0.9V at both pins CPAR = 3pF DC level at pins XTAL1/XTAL2 for various transceiver states. Parasitic capacitance (CPAR) of the pins must be considered as additional load capacitance to the crystal. DVDD VDC = 1.8V (all states, except SLEEP) VDC = 0mV (otherwise) DC level at pin DVDD for various transceiver states. Supply pins (voltage regulator output) for the digital 1.8V voltage domain. The outputs shall be bypassed by 1µF. AVDD VDC = 1.8V (all states, except P_ON, SLEEP, RESET, and TRX_OFF) VDC = 0mV (otherwise) DC level at pin AVDD for various transceiver states. Supply pin (voltage regulator output) for the analog 1.8V voltage domain. The outputs shall be bypassed by 1µF. 5 42002E–MCU Wireless–02/2015 1.3 Digital Pins The Atmel AT86RF212B provides a digital microcontroller interface. The interface comprises a slave SPI (/SEL, SCLK, MOSI, and MISO) and additional control signals (CLKM, IRQ, SLP_TR, /RST, and DIG2). The microcontroller interface is described in detail in Chapter 6. Additional digital output signals DIG1, …, DIG4 are provided to control external blocks, that is for Antenna Diversity RF switch control or as an RX/TX Indicator; see Section 11.3 and Section 11.4 respectively. 1.3.1 Driver Strength Settings The driver strength of all digital output pins (MISO, IRQ, DIG1, …, DIG4) and CLKM pin can be configured using register bits PAD_IO and PAD_IO_CLKM (register 0x03, TRX_CTRL_0); see Table 1-3. Table 1-3. Digital Output Driver Configuration. Pin Default Driver Strength Comment MISO, IRQ, DIG1, …, DIG4 2mA Adjustable to 2mA, 4mA, 6mA, and 8mA CLKM 4mA Adjustable to 2mA, 4mA, 6mA, and 8mA The capacitive load should be as small as possible and not larger than 50pF when using the 2mA minimum driver strength setting. Generally, the output driver strength should be adjusted to the lowest possible value in order to keep the current consumption and the emission of digital signal harmonics low. 1.3.2 Pull-up and Pull-down Configuration Pulling transistors (10µA current source) are internally connected to all digital input pins in radio transceiver state P_ON, including reset during P_ON; refer to Section 7.1.2.1 and Section 7.1.2.8. Table 1-4 summarizes the pull-up and pull-down configuration. Table 1-4. Pull-Up / Pull-Down Configuration of Digital Input Pins. Pin H =ˆ pull-up, L /RST H /SEL H SCLK L MOSI L SLP_TR L =ˆ pull-down In all other radio transceiver states, including RESET, no pull-up or pull-down transistors are connected to any of the digital input pins mentioned in Table 1-4. Note: 1. In all other states, external circuitry should guaranty defined levels at all input pins. Floating input pins may cause unexpected functionality and increased power consumption, for example in SLEEP state. If the additional digital output signals DIG1, …, DIG4 are not activated, these pins are pulled-down to digital ground (DIG1/DIG2) or analog ground (DIG3/DIG4). 6 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 1.3.3 Register Description Note: 1. Throughout this datasheet, underlined values indicate reset settings. Register 0x03 (TRX_CTRL_0): The TRX_CTRL_0 register controls the driver current of the digital output pads and the CLKM clock rate. Figure 1-3. Register TRX_CTRL_0. Bit 7 0x03 Read/Write Reset value Bit 0x03 6 5 4 PAD_IO PAD_IO_CLKM R/W 0 R/W 0 3 2 CLKM_SHA_SEL Read/Write Reset value TRX_CTRL_0 R/W 0 R/W 1 1 0 CLKM_CTRL R/W 1 R/W 0 R/W 0 TRX_CTRL_0 R/W 1 • Bit 7:6 - PAD_IO These register bits set the output driver current of digital output pads, except CLKM. Table 1-5. PAD_IO. Register Bits Value PAD_IO Note: 1. Descriptio n 0 2mA 1 4mA 2 6mA 3 8mA Selecting low-level driver current reduces power consumption and minimizes transceiver’s harmonic distorion. • Bit 5:4 - PAD_IO_CLKM These register bits set the output driver current of pin CLKM. It is recommended to reduce the driver strength to 2mA (PAD_IO_CLKM = 0) if possible. This reduces power consumption and spurious emissions. Table 1-6. PAD_IO_CLKM. Register Bits PAD_IO_CLKM Value Description 0 2mA 1 4mA 2 6mA 3 8mA 7 42002E–MCU Wireless–02/2015 2 Disclaimer Typical values contained in this datasheet are based on simulations and testing. Minimum and maximum values are available when the radio transceiver has been fully characterized. 3 Overview The Atmel AT86RF212B is a low-power, low-voltage 700/800/900MHz transceiver specially designed for the ZigBee/IEEE 802.15.4, 6LoWPAN, and high data rate sub-1GHz ISM applications. For the sub-1GHz bands, all modulation schemes and data rates according to IEEE 802.15.4-2003 [1], IEEE 802.15.4-2006 [2] standards, and the respective 802.15.4c-2009 [3] amendment are supported. All these PHY modes are summarized in IEEE 802.15.4-2011 [4] Standard. Furthermore, proprietary High Data Rate Modes up to 1000kb/s can be employed. The AT86RF212B is a true SPI-to-antenna solution. All RF-critical components except the antenna, crystal, and de-coupling capacitors are integrated on-chip. MAC and AES hardware accelerators improve overall system power efficiency and timing. Therefore, the AT86RF212B is particularly suitable for applications like: • Sub-1GHz IEEE 802.15.4 and ZigBee systems • Energy Harvesting systems • 6LoWPAN systems • Wireless sensor networks • Industrial Control • Residential and commercial automation • Health care • Consumer electronics • PC peripherals The AT86RF212B can be operated by using an external microcontroller like Atmel ® AVR microcontrollers. A comprehensive software programming description can be found in reference [11]. 8 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 4 General Circuit Description The Atmel AT86RF212B single-chip radio transceiver provides a complete radio transceiver interface between an antenna and a microcontroller. It comprises the analog radio, digital modulation and demodulation including time and frequency synchronization, as well as data buffering. A single 128-byte TRX buffer stores receive or transmit data. Communication between transmitter and receiver is based on direct sequence spread spectrum with different modulation schemes and spreading codes. The AT86RF212B diagram is shown in Figure 4-1. TX Power XTAL2 XTAL1 Figure 4-1. AT86RF212B Block Diagram. Voltage Regulator XOSC Mixer PA RFP RFN LPF Frequency Synthesis LNA PPF Mixer DAC FTN, BATMON BPF ADC AGC Analog Domain Configuration Registers TX BBP TRX Buffer RX BBP Control Logic SPI (Slave) /SEL MISO MOSI SCLK AES IRQ CLKM DIG1 DIG2 /RST SLP_TR DIG3/4 Digital Domain The number of external components is minimized so that only the antenna, a filter (at high output power levels), the crystal, and four bypass capacitors are required. The bidirectional differential antenna pins (RFP, RFN) are used for transmission and reception, thus no external antenna switch is needed. Control of an external power amplifier is supported by two digital control signals (differential operation). The AT86RF212B supports the IEEE 802.15.4-2006 [2] standard mandatory BPSK modulation and optional O-QPSK modulation in the 868.3MHz and 915MHz bands. In addition, it supports the O-QPSK modulation defined in IEEE 802.15.4-2011 [4] for the Chinese 780MHz band. For applications not necessarily targeting IEEE compliant networks, the radio transceiver supports proprietary High Data Rate Modes based on O-QPSK. 9 42002E–MCU Wireless–02/2015 The Atmel AT86RF212B features hardware supported 128-bit security operation. The standalone AES encryption/decryption engine can be accessed in parallel to all PHY operational modes. Configuration of the AT86RF212B, reading and writing of data memory, as well as the AES hardware engine are controlled by the SPI interface and additional control signals. On-chip low-dropout voltage regulators provide regulated analog and digital 1.8V power supply outputs. Control registers retain their settings in sleep mode when the regulators are turned off. The RX and TX signal processing paths are highly integrated and optimized for low power consumption. Additional features of the Extended Feature Set, see Chapter 11, are provided to simplify the interaction between radio transceiver and microcontroller. 10 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 5 Application Schematic 5.1 Basic Application Schematic A basic application schematic of the Atmel AT86RF212B with a single-ended RF connector is shown in Figure 5-1. The 50Ω single-ended RF input is transformed to the 100Ω differential RF port impedance using balun B1. The capacitors C1 and C2 provide AC coupling of the RF input to the RF port. If the balun pins at the differential side provide no DC path to ground and to the single-ended pin, the capacitors are not necessary. Regulatory rules like FCC 47 CFR Section 15.247 [5], ETSI EN 300 220-1 [6], and ERC/REC 70-03 [7] may require an external filter F1, depending on used transmit power levels. Figure 5-1. Basic Application Schematic. CX1 CB2 XTAL CX2 VDD 30 29 28 27 26 25 AVSS AVDD EVDD AVSS XTAL1 XTAL2 2 DIG4 C1 RF IRQ 24 /SEL 23 3 AVSS MOSI 22 4 RFP DVSS 21 AT86RF212B MISO 20 6 AVSS SCLK 19 7 DVSS DVSS 18 DVSS DVDD DVDD DEVDD DVSS R1 SLP_TR C2 5 RFN DIG2 B1 DIG1 F1 Digital Interface 31 AVSS 1 DIG3 32 AVSS CB1 9 10 11 12 13 14 15 16 8 /RST CLKM 17 C3 VDD CB3 CB4 The power supply decoupling capacitors (CB2, CB4) are connected to the external analog supply pin 28 (EVDD) and external digital supply pin 15 (DEVDD). Capacitors CB1 and CB3 are bypass capacitors for the integrated analog and digital voltage regulators to ensure stable operation. All bypass capacitors should be placed as close as possible to the pins and should have a low-resistance and low-inductance connection to ground to achieve the best performance. The crystal (XTAL), the two load capacitors (CX1, CX2), and the internal circuitry connected to pins XTAL1 and XTAL2 form the crystal oscillator. To achieve the best accuracy and stability of the reference frequency, large parasitic capacitances should be avoided. Crystal lines should be routed as short as possible and not in proximity of 11 42002E–MCU Wireless–02/2015 digital I/O signals. This is especially required for the High Data Rate Modes; refer to Section 9.1.4. Crosstalk from digital signals on the crystal pins or the RF pins can degrade the system performance. Therefore, a low-pass filter (C3, R1) is placed close to the Atmel AT86RF212B CLKM output pin to reduce the emission of CLKM signal harmonics. This is not needed if pin 17 (CLKM) is not used as a microcontroller clock source. In this case, pin 17 (CLKM) output should be disabled during device initialization. The ground plane of the application board should be separated into four independent fragments: the analog, the digital, the antenna, and the XTAL ground plane. The exposed paddle shall act as the reference point of the individual grounds. Note: 1. The pins DIG1, DIG2, DIG3, and DIG4 are connected to ground in the Basic Application Schematic; refer to Figure 5-1. Special programming of these pins requires a different schematic; refer to Section 5.2. Table 5-1. Exemplary Bill of Materials (BoM) for Basic Application Schematic. Symbol Description Value Manufacturer Part Number B1 SMD balun 800 – 1000MHz Wuerth JTI 748431090 0900BL18B100 F1 SMD low pass filter 902 – 928MHz Wuerth JTI 748131009 0915LP15A026 B1 + F1 Balun/Filter combination (alternatively) 863 – 928MHz JTI 0896FB15A0100 779 – 787MHz JTI 0783FB15A0100 CB1 CB3 LDO VREG bypass capacitor 1µF AVX Murata 0603YD105KAT2A GRM188R61E105KA12 CB2 CB4 Power supply bypass capacitor CX1, CX2 Crystal load capacitor C1, C2 C3 RF coupling capacitor CLKM low-pas filter capacitor 12pF 100pF 2.2pF Comment X5R (0603) 10% 16V X5R (0603) 15% 25V C0G 5% 50V AVX Murata 06035A120JA GRM1555C1H120JA01 Epcos Epcos AVX B37930 B37920 06035A680JAT2A C0G AVX Murata 06035A229DA GRP1886C1H2R0DA01 COG (0603) (0402 or 0603) 5% 50V (0402 or 0603) ±0.5pF 50V Designed for fCLKM = 1MHz R1 CLKM low-pass filter resistor 680Ω XTAL Crystal CX-4025 16MHz SX-4025 16MHz 12 AT86RF212B Designed for fCLKM = 1MHz ACAL Taitjen Siward XWBBPL-F-1 A207-011 42002E–MCU Wireless–02/2015 AT86RF212B 5.2 Extended Feature Set Application Schematic The Atmel AT86RF212B supports additional features like: • Security Module (AES) Section 11.1 • Random Number Generator Section 11.2 • Antenna Diversity uses pins DIG1(/2) Section 11.3 • RX/TX Indicator uses pins DIG3/4 Section 11.4 • RX Frame Time Stamping uses pin DIG2 Section 11.5 • Frame Buffer Empty Indicator uses pin IRQ Section 11.6 • Dynamic Frame Buffer Protection Section 11.7 • Alternate Start-Of-Frame Delimiter Section 11.8 An extended feature set application schematic illustrating the use of the AT86RF212B Extended Feature Set, see Chapter 11, is shown in Figure 5-2. Although this example shows all additional hardware features combined, it is possible to use all features separately or in various combinations. Figure 5-2. Extended Feature Application Schematic. CB2 CX1 XTAL CX2 VDD AVDD EVDD AVSS XTAL1 XTAL2 IRQ 24 /SEL 23 3 AVSS MOSI 22 4 RFP DVSS 21 AT86RF212B MISO 20 6 AVSS SCLK 19 7 DVSS DVSS 18 DEVDD DVSS R1 DVDD C2 5 RFN DVDD B1 DVSS SW1 C1 Digital Interface 25 SLP_TR ANT1 N1 26 DIG2 F1 27 DIG1 PA RFSwitch RFSwitch SW2 28 2 DIG4 N2 LNA 30 29 AVSS 1 DIG3 31 AVSS ANT0 32 AVSS CB1 9 10 11 12 13 14 15 16 8 /RST CLKM 17 C3 VDD CB3 CB4 13 42002E–MCU Wireless–02/2015 In this example, a balun (B1) transforms the differential RF signal at the Atmel AT86RF212B radio transceiver RF pins (RFP/RFN) to a single ended RF signal, similar to the Basic Application Schematic; refer to Figure 5-1. The RF switches (SW1, SW2) separate between receive and transmit path in an external RF front-end. These switches are controlled by the RX/TX Indicator, represented by the differential pin pair DIG3/DIG4; refer to Section 11.4. During receive, the corresponding microcontroller may search for the most reliable RF signal path using an Antenna Diversity algorithm or stored statistic data of link signal (1) quality. One antenna is selected by an RF switch (SW2) controlled by pin 9 (DIG1) . The RF signal is amplified by an optional low-noise amplifier (N2) and fed to the radio transceiver using an RX/TX switch (SW1). During transmit, the AT86RF212B TX signal is amplified using an external PA (N1), low pass filtered to suppress spurious harmonics emission, and fed to the antennas via an RF switch (SW2). In this example, RF switch SW2 further supports Antenna Diversity (1) controlled by pin 9 (DIG1) . Note: 1. DIG1/DIG2 can be used as a differential pin pair to control an RF switch if RX Frame Time Stamping is not used; refer to Section 11.3 and Section 11.5. The Security Module (AES), Random Number Generator, Frame Buffer Empty Indicator, Dynamic Frame Buffer Protection or Alternate Start-Of-Frame Delimiter do not require specific circuitry to operate, for details refer to Section 11.1, Section 11.2, Section 11.6, Section 11.7 and Section 11.8. 14 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 6 Microcontroller Interface 6.1 Overview This section describes the Atmel AT86RF212B to microcontroller interface. The interface comprises a slave SPI and additional control signals; see Figure 6-1. The SPI timing and protocol are described below. Figure 6-1. Microcontroller to AT86RF212B Interface. AT86RF212B /SEL /SEL /SEL MOSI MOSI MOSI SPI - Master MISO MISO MISO SCLK SCLK SCLK GPIO1/CLK CLKM IRQ GPIO2/IRQ SPI - Slave SPI Microcontroller CLKM IRQ SLP_TR GPIO3 SLP_TR GPIO4 /RST /RST GPIO5 DIG2 DIG2 Microcontrollers with a master SPI such as Atmel AVR family interface directly to the AT86RF212B. The SPI is used for register, Frame Buffer, SRAM, and AES access. The additional control signals are connected to the GPIO/IRQ interface of the microcontroller. Table 6-1 introduces the radio transceiver I/O signals and their functionality. Table 6-1. Signal Description of Microcontroller Interface. Signal Description /SEL SPI select signal, active low MOSI SPI data (master output slave input) signal MISO SPI data (master input slave output) signal SCLK SPI clock signal CLKM Optional, Clock output, refer to Section 9.7.4, usable as: - microcontroller clock source and/or MAC timer reference - high precision timing reference IRQ Interrupt request signal, further used as: - Frame Buffer Empty indicator; refer to Section 11.6 SLP_TR Multi purpose control signal (functionality is state dependent, see Section 6.6): - Sleep/Wakeup enable/disable SLEEP state - TX start BUSY_TX_(ARET) state - disable/enable CLKM /RST AT86RF212B reset signal; active low DIG2 Optional, - IRQ_2 (RX_START) for RX Frame Time Stamping, see Section 11.5 15 42002E–MCU Wireless–02/2015 6.2 SPI Timing Description Pin 17 (CLKM) can be used as a microcontroller master clock source. If the microcontroller derives the SPI master clock (SCLK) directly from CLKM, the SPI operates in synchronous mode, otherwise in asynchronous mode. In asynchronous mode, the maximum SCLK frequency fasync is limited to 7.5MHz. The signal at pin 17 (CLKM) is not required to derive SCLK and may be disabled to reduced power consumption and spurious emissions. Figure 6-2 and Figure 6-3 illustrate the SPI timing and introduces its parameters. The corresponding timing parameter definitions t1 – t9 are defined in Section 12.4. Figure 6-2. SPI Timing, Global Map and Definition of Timing Parameters t5, t6, t8, t9. t8 t9 /SEL SCLK MOSI 7 6 5 4 3 2 7 0 1 6 5 4 3 2 1 0 t5 MISO Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 t6 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Figure 6-3. SPI Timing, Detailed Drawing of Timing Parameters t1 to t4. /SEL SCLK t3 MOSI t4 Bit 6 Bit 7 t1 MISO Bit 5 t2 Bit 7 Bit 6 Bit 5 The SPI is based on a byte-oriented protocol and is always a bidirectional communication between the master and slave. The SPI master starts the transfer by asserting /SEL = L. Then the master generates eight SPI clock cycles to transfer one byte to the radio transceiver (via MOSI). At the same time, the slave transmits one byte to the master (via MISO). When the master wants to receive one byte of data from the slave, it must also transmit one byte to the slave. All bytes are transferred with the MSB first. An SPI transaction is finished by releasing /SEL = H. An SPI register access consists of two bytes, a Frame Buffer or SRAM access of at least two or more bytes as described in Section 6.3. /SEL = L enables the MISO output driver of the Atmel AT86RF212B. The MSB of MISO is valid after t1 (see Section 12.4) and is updated on each SCLK falling edge. If the driver is disabled, there is no internal pull-up transistor connected to it. Driving the appropriate signal level must be ensured by the master device or an external pull-up resistor. 16 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Note: 1. When both /SEL and /RST are active, the MISO output driver is also enabled. Referring to Figure 6-2 and Figure 6-3, Atmel AT86RF212B MOSI is sampled at the rising edge of the SCLK signal and the output is set at the falling edge of SCLK. The signal must be stable before and after the rising edge of SCLK as specified by t3 and t4, refer to Section 12.4 parameters. This SPI operational mode is commonly known as “SPI mode 0”. 6.3 SPI Protocol Each SPI sequence starts with transferring a command byte from the SPI master via MOSI (see Table 6-2) with the MSB first. This command byte defines the SPI access mode and additional mode-dependent information. Table 6-2. SPI Command Byte Definition. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 1 0 1 1 0 0 1 Reserved 0 1 1 Reserved 0 0 0 Reserved 0 1 0 Reserved Bit 0 Register address [5:0] Access Mode Access Type Register access Read access Register address [5:0] Write access Frame Buffer access Read access Write access SRAM access Read access Write access Each SPI transfer returns bytes back to the SPI master on MISO output pin. The content of the first byte (see value “PHY_STATUS“ in Figure 6-4 to Figure 6-14) is set to zero after reset. To transfer status information of the radio transceiver to the microcontroller, the content of the first byte can be configured with register bits SPI_CMD_MODE (register 0x04, TRX_CTRL_1). For details, refer to Section 6.4.1. Note: 1. Return values on MISO stated as XX shall be ignored by the microcontroller. The different access modes are described within the following sections. 6.3.1 Register Access Mode Register Access Mode is used to read and write AT86RF212B regsisters (register address from 0x00 up to 0x3F). A register access mode is a two-byte read/write operation initiated by /SEL = L. The first transferred byte on MOSI is the command byte including an identifier bit (bit[7] = 1), a read/write select bit (bit[6]), and a 6-bit register address. On read access, the content of the selected register address is returned in the second byte on MISO (see Figure 6-4). Figure 6-4. Packet Structure - Register Read Access. byte 1 (command byte) MOSI 1 ADDRESS[5:0] PHY_STATUS MISO Note: 0 1. (1) byte 2 (data byte) XX READ DATA[7:0] Each SPI access can be configured to return radio controller status information (PHY_STATUS) on MISO, for details refer to Section 6.4. 17 42002E–MCU Wireless–02/2015 On write access, the second byte transferred on MOSI contains the write data to the selected address (see Figure 6-5). Figure 6-5. Packet Structure - Register Write Access. byte 1 (command byte) MOSI 1 MISO 1 ADDRESS[5:0] PHY_STATUS byte 2 (data byte) WRITE DATA[7:0] XX Each register access must be terminated by setting /SEL = H. Figure 6-6 illustrates a typical SPI sequence for a register access sequence for write and read respectively. Figure 6-6. Exemplary SPI Sequence – Register Access Mode. Register Write Access Register Read Access /SEL SCLK MOSI WRITE COMMAND MISO PHY_STATUS WRITE DATA XX READ COMMAND PHY_STATUS XX READ DATA 6.3.2 Frame Buffer Access Mode Frame Buffer Access Mode is used to read and write Atmel AT86RF212B frame buffer. The frame buffer address is always reset to zero and incremented to access PSDU, LQI, ED and RX_STATUS data. The Frame Buffer can hold up to 128-byte of one PHY service data unit (PSDU) IEEE 802.15.4 data frame. A detailed description of the Frame Buffer can be found in Section 9.4. An introduction to the IEEE 802.15.4 frame format can be found in Section 8.1. Each access starts with /SEL = L followed by a command byte on MOSI. Each frame read or write access command byte is followed by the PHR data byte, indicating the frame length, followed by the PSDU data, see Figure 6-7 and Figure 6-8. In Frame Buffer Access Mode during buffer reads, the PHY header (PHR) and the PSDU data are transferred via MISO following PHY_STATUS byte. Once the PSDU data is uploaded, three more bytes are transferred containing the link quality indication (LQI) value, the energy detection (ED) value, and the status information (RX_STATUS) of the received frame, for LQI details refer to Section 8.8.The Figure 6-7 illustrates the packet structure of a Frame Buffer read access. Note: 18 AT86RF212B 1. The frame buffer read access can be terminated immediately at any time by setting pin 23 (/SEL) = H, for example after reading the PHR byte only. 42002E–MCU Wireless–02/2015 AT86RF212B Figure 6-7. Packet Structure - Frame Read Access. byte 1 (command byte) byte 2 (data byte) byte 3 (data byte) byte n-1 (data byte) byte n (data byte) MOSI 0 0 1 reserved[4:0] XX XX XX XX MISO PHY_STATUS PHR[7:0] PSDU[7:0] ED[7:0] RX_STATUS[7:0] The structure of RX_STATUS is described in Table 6-3. Table 6-3. Structure of RX_STATUS. Bit 7 6 RX_CRC_VALID 5 4 TRAC_STATUS Read/Write Reset value R 0 R 0 Bit 3 2 RX_STATUS R 0 R 0 1 0 R 0 R 0 reserved Read/Write Reset value Note: 2. R 0 R 0 RX_STATUS More information to RX_CRC_VALID, see Section 8.3.5, and to TRAC_STATUS, see Section 7.2.6. On frame buffer write access, the second byte transferred on MOSI contains the frame length (PHR field) followed by the payload data (PSDU) as shown in Figure 6-8. Figure 6-8. Packet Structure - Frame Write Access. byte 1 (command byte) byte 2 (data byte) byte 3 (data byte) byte n-1 (data byte) byte n (data byte) MOSI 0 1 1 reserved[4:0] PHR[7:0] PSDU[7:0] PSDU[7:0] PSDU[7:0] MISO PHY_STATUS XX XX XX XX The number of bytes n for one frame buffer access is calculated as follows: Read Access: n = 5 + frame_length [PHY_STATUS, PHR byte, PSDU data, LQI, ED, and RX_STATUS] Write Access: n = 2 + frame_length [command byte, PHR byte, and PSDU data] The maximum value of frame_length is 127 bytes. That means that n ≤ 132 for Frame Buffer read and n ≤ 129 for Frame Buffer write accesses. Each read or write of a data byte automatically increments the address counter of the Frame Buffer until the access is terminated by setting /SEL = H. A Frame Buffer read access can be terminated at any time without any consequences by setting /SEL = H, for example after reading the frame length byte only. A successive Frame Buffer read operation starts again with the PHR field. The content of the Atmel AT86RF212B Frame Buffer is overwritten by a new received frame or a Frame Buffer write access. Figure 6-9 and Figure 6-10 illustrate an exemplary SPI sequence of a Frame Buffer access to read a frame with 2-byte PSDU and write a frame with 4-byte PSDU. 19 42002E–MCU Wireless–02/2015 Figure 6-9. Exemplary SPI Sequence - Frame Buffer Read of a Frame with 2-byte PSDU. /SEL SCLK MOSI COMMAND XX MISO PHY_STATUS PHR XX PSDU 1 XX PSDU 2 XX XX LQI ED XX RX_STATUS Figure 6-10. Exemplary SPI Sequence - Frame Buffer Write of a Frame with 4-byte PSDU. /SEL SCLK MOSI COMMAND MISO PHY_STATUS PSDU 1 PHR XX XX PSDU 2 XX PSDU 3 XX PSDU 4 XX Access violations during a Frame Buffer read or write access are indicated by interrupt IRQ_6 (TRX_UR). For further details, refer to Section 9.4. Notes: 1. The Frame Buffer is shared between RX and TX operations, the frame data is overwritten by freshly received data frames. If an existing TX payload data frame is to be retransmitted, it must be ensured that no TX data is overwritten by newly received RX data. 2. To avoid overwriting during receive Dynamic Frame Buffer Protection can be enabled, refer to Section 11.7. 3. For exceptions, receiving acknowledgement frames in Extended Operating Mode (TX_ARET) refer to Section 7.2.4. 6.3.3 SRAM Access Mode The SRAM access mode is used to read and write Atmel AT86RF212B frame buffer beginning with a specified byte address. It enables to access dedicated buffer data directly from a desired address without a need of incrementing the frame buffer from the top. The SRAM access mode allows accessing dedicated bytes within the Frame Buffer or AES address space, refer to Section 11.1. This may reduce the SPI traffic. During frame receive, after occurrence of IRQ_2 (RX_START), an SRAM access can be used to upload the PHR field while preserving Dynamic Frame Buffer Protection, see Section 11.7. Each SRAM access starts with /SEL = L. The first transferred byte on MOSI shall be the command byte and must indicate an SRAM access mode according to the definition in Table 6-2. The following byte indicates the start address of the write or read access. SRAM address space: 20 AT86RF212B • Frame Buffer: 0x00 to 0x7F • AES: 0x82 to 0x94 42002E–MCU Wireless–02/2015 AT86RF212B On SRAM read access, one or more bytes of read data are transferred on MISO starting with the third byte of the access sequence; refer to Figure 6-11. Figure 6-11. Packet Structure – SRAM Read Access. byte 1 (command byte) byte 2 (address) byte 3 (data byte) byte n-1 (data byte) byte n (data byte) MOSI 0 0 0 reserved[4:0] ADDRESS[7:0] XX XX XX MISO PHY_STATUS XX DATA[7:0] DATA[7:0] DATA[7:0] On SRAM write access, one or more bytes of write data are transferred on MOSI starting with the third byte of the access sequence; refer to Figure 6-12. Do not attempt to read or write bytes beyond the SRAM buffer size. Figure 6-12. Packet Structure – SRAM Write Access. byte 1 (command byte) byte 2 (address) byte 3 (data byte) byte n-1 (data byte) byte n (data byte) MOSI 0 1 0 reserved[4:0] ADDRESS[7:0] DATA[7:0] DATA[7:0] DATA[7:0] MISO PHY_STATUS XX XX XX XX As long as /SEL = L, every subsequent byte read or byte write increments the address counter of the Frame Buffer until the SRAM access is terminated by /SEL = H. Figure 6-13 and Figure 6-14 illustrate an exemplary SPI sequence of an Atmel AT86RF212B SRAM access to read and write a data package of five byte length, respectively. Figure 6-13. Exemplary SPI Sequence – SRAM Read Access of a 5-byte Data Package. /SEL SCLK MOSI COMMAND MISO PHY_STATUS ADDRESS XX XX DATA 1 XX DATA 2 XX DATA 3 XX DATA 4 XX DATA 5 Figure 6-14. Exemplary SPI Sequence – SRAM Write Access of a 5-byte Data Package. /SEL SCLK MOSI COMMAND MISO PHY_STATUS ADDRESS XX DATA 1 XX DATA 2 XX DATA 3 XX DATA 4 XX DATA 5 XX 21 42002E–MCU Wireless–02/2015 Notes: 1. The SRAM access mode is not intended to be used as an alternative to the Frame Buffer access modes (see Section 6.3.2). 2. Frame Buffer access violations are not indicated by a TRX_UR interrupt when using the SRAM access mode, for further details refer to Section 9.4.3. 6.4 Radio Transceiver Status Information Each Atmel AT86RF212B SPI access can return radio transceiver status information which is a first byte transmitted out of MISO output as the serial data is being shifted into MOSI input. Radio transceiver status information (PHY_STATUS) can be configured using register bits SPI_CMD_MODE (register 0x04, TRX_CTRL_1) to return TRX_STATUS, PHY_RSSI or IRQ_STATUS register as shown in below. 6.4.1 Register Description Register 0x04 (TRX_CTRL_1): The TRX_CTRL_1 register is a multi-purpose register to control various operating modes and settings of the radio transceiver. Figure 6-15. Register TRX_CTRL_1. Bit 0x04 Read/Write Reset value 7 6 5 4 PA_EXT_EN IRQ_2_EXT_EN TX_AUTO_CRC_ ON RX_BL_CTRL R/W 0 R/W 0 R/W 1 R/W 0 3 2 Bit 0x04 Read/Write Reset value SPI_CMD_MODE R/W 0 1 0 IRQ_MASK_MODE IRQ_POLARITY R/W 0 R/W 0 R/W 0 TRX_CTRL_1 TRX_CTRL_1 • Bit 3:2 - SPI_CMD_MODE Each SPI transfer returns bytes back to the SPI master. The content of the first byte (PHY_STATUS) can be configured using register bits SPI_CMD_MODE. Table 6-4. SPI_CMD_MODE. Register Bits SPI_CMD_MODE 22 AT86RF212B Value Description 0 Default (empty, all bits zero) 1 Monitor TRX_STATUS register 2 Monitor PHY_RSSI register 3 Monitor IRQ_STATUS register 42002E–MCU Wireless–02/2015 AT86RF212B 6.5 Radio Transceiver Identification Atmel AT86RF212B can be identified by four registers. One 8-bit register contains a unique part number (PART_NUM) and one register contains the corresponding 8-bit version number (VERSION_NUM). Two additional 8-bit registers contain the JEDEC manufacture ID. 6.5.1 Register Description Register 0x1C (PART_NUM): The register PART_NUM can be used for the radio transceiver identification and includes the part number of the device. Figure 6-16. Register PART_NUM. Bit 7 6 0x1C Read/Write Reset value R 0 R 0 Bit 3 2 0x1C Read/Write Reset value 5 4 R 0 R 0 1 0 R 1 R 1 PART_NUM PART_NUM PART_NUM R 0 R 1 PART_NUM • Bit 7:0 - PART_NUM Table 6-5. PART_NUM. Register Bits Value Description PART_NUM 0x07 AT86RF212B part number Register 0x1D (VERSION_NUM): The register VERSION_NUM can be used for the radio transceiver identification and includes the version number of the device. Figure 6-17. Register VERSION_NUM. Bit 7 6 5 0x1D Read/Write Reset value R 0 R 0 Bit 3 2 0x1D Read/Write Reset value 4 VERSION_NUM VERSION_NUM R 0 R 0 1 0 R 1 R 1 VERSION_NUM R 0 R 0 VERSION_NUM • Bit 7:0 - VERSION_NUM Table 6-6. VERSION_NUM. Register Bits Value Description VERSION_NUM 0x03 Revision C 23 42002E–MCU Wireless–02/2015 Register 0x1E (MAN_ID_0): Part one of the JEDEC manufacturer ID. Figure 6-18. Register MAN_ID_0. Bit 7 6 0x1E Read/Write Reset value R 0 R 0 Bit 3 2 0x1E Read/Write Reset value 5 4 R 0 R 1 1 0 R 1 R 1 MAN_ID_0 MAN_ID_0 MAN_ID_0 R 1 R 1 MAN_ID_0 • Bit 7:0 - MAN_ID_0 Table 6-7. MAN_ID_0. Register Bits Value Description MAN_ID_0 0x1F Atmel JEDEC manufacturer ID, bits[7:0] of the 32-bit JEDEC manufacturer ID are stored in register bits MAN_ID_0. Bits [15:8] are stored in register 0x1F (MAN_ID_1). The higher 16 bits of the ID are not stored in registers. Register 0x1F (MAN_ID_1): Part two of the JEDEC manufacturer ID. Figure 6-19. Register MAN_ID_1. Bit 7 6 0x1F Read/Write Reset value R 0 R 0 Bit 3 2 0x1F Read/Write Reset value 5 4 R 0 R 0 1 0 MAN_ID_1 MAN_ID_1 MAN_ID_1 R 0 R 0 MAN_ID_1 R 0 R 0 • Bit 7:0 - MAN_ID_1 Table 6-8. MAN_ID_1. 24 Register Bits Value Description MAN_ID_1 0x00 Atmel JEDEC manufacturer ID, bits[15:8] of the 32-bit JEDEC manufacturer ID are stored in register bits MAN_ID_1. Bits [7:0] are stored in register 0x1E (MAN_ID_0). The higher 16 bits of the ID are not stored in registers. AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 6.6 Sleep/Wake-up and Transmit Signal (SLP_TR) Pin 11 (SLP_TR) is a multi-functional pin. Its function relates to the current state of the Atmel AT86RF212B and is summarized in Table 6-9. The radio transceiver states are explained in detail in Chapter 7. Table 6-9. SLP_TR Multi-functional Pin. Transceiver Status Function PLL_ON TX start Transition Description LH Starts frame transmission TX_ARET_ON TX start LH Starts TX_ARET transaction BUSY_RX_AACK TX start LH Starts ACK transmission during RX_AACK slotted operation, see Section 7.2.3.5 TRX_OFF Sleep LH Takes the radio transceiver into SLEEP state; CLKM disabled SLEEP Wakeup HL Takes the radio transceiver back into TRX_OFF state, level sensitive RX_ON Disable CLKM LH Takes the radio transceiver into RX_ON_NOCLK state and disables CLKM RX_ON_NOCLK Enable CLKM HL Takes the radio transceiver into RX_ON state and enables CLKM RX_AACK_ON Disable CLKM LH Takes the radio transceiver into RX_AACK_ON_NOCLK state and disables CLKM RX_AACK_ON_NOCLK Enable CLKM HL Takes the radio transceiver into RX_AACK_ON state and enables CLKM In states PLL_ON and TX_ARET_ON, pin 11 (SLP_TR) is used as trigger input to initiate a TX transaction. Here SLP_TR is sensitive on rising edge only. After initiating a state change by a rising edge at pin 11 (SLP_TR) in radio transceiver states TRX_OFF, RX_ON or RX_AACK_ON, the radio transceiver remains in the new state as long as the pin is logical high and returns to the preceding state with the falling edge. SLEEP state The SLEEP state is used when radio transceiver functionality is not required, and thus the AT86RF212B can be powered down to reduce the overall power consumption. A power-down scenario is shown in Figure 6-20. When the radio transceiver is in TRX_OFF state, the microcontroller forces the AT86RF212B to SLEEP by setting SLP_TR = H. If pin 17 (CLKM) provides a clock to the microcontroller, this clock is switched off after 35 CLKM cycles. This enables a microcontroller in a synchronous system to complete its power-down routine and prevent deadlock situations. The AT86RF212B awakes when the microcontroller releases pin 11 (SLP_TR). This concept provides the lowest possible power consumption. The CLKM clock frequency settings for CLKM_CTRL values six and seven are not intended to directly clock the microcontroller. When using these clock rates, CLKM is turned off immediately when entering SLEEP state. Figure 6-20. Sleep and Wake-up Initiated by Asynchronous Microcontroller Timer. SLP_TR tTR1a CLKM tTR3 (35 CLKM clock cycles) CLKM off async timer elapses (microcontroller) Note: 1. Timing figures tTR3 and tTR1a refer to Table 7-1. 25 42002E–MCU Wireless–02/2015 RX_ON and RX_AACK_ON states For synchronous systems where CLKM is used as a microcontroller clock source and the SPI master clock (SCLK) is directly derived from CLKM, the Atmel AT86RF212B supports an additional power-down mode for receive operating states (RX_ON and RX_AACK_ON). If an incoming frame is expected and no other applications are running on the microcontroller, it can be powered down without missing incoming frames. This can be achieved by a rising edge on pin 11 (SLP_TR) that turns CLKM off. Then the radio transceiver state changes from RX_ON or RX_AACK_ON (Extended Operating Mode) to RX_ON_NOCLK or RX_AACK_ON_NOCLK, respectively. In case that a frame is received (for example indicated by an IRQ_2 (RX_START) interrupt), the clock output CLKM is automatically switched on again. This scenario is shown in Figure 6-21. In RX_ON state, the clock at pin 17 (CLKM) is switched off after 35 CLKM cycles when setting SLP_TR = H. The CLKM clock frequency settings for CLKM_CTRL values six and seven are not intended to directly clock the microcontroller. When using these clock rates, CLKM is turned off immediately when entering RX_ON_NOCLK or RX_AACK_ON_NOCLK. In states RX_(AACK)_ON_NOCLK and RX_(AACK)_ON, the radio transceiver current consumptions are equivalent. However, the RX_(AACK)_ON_NOCLK current consumption is reduced by the current required for driving pin 17 (CLKM). Figure 6-21. Wake-Up Initiated by Radio Transceiver Interrupt. radio transceiver IRQ issued typ. 5 μs IRQ SLP_TR CLKM 35 CLKM clock cycles 26 AT86RF212B CLKM off 42002E–MCU Wireless–02/2015 AT86RF212B 6.7 Interrupt Logic 6.7.1 Overview Atmel AT86RF212B differentiates between nine interrupt events (eight physical interrupt registers, one shared by two functions). Each interrupt is enabled by setting the corresponding bit in the interrupt mask register 0x0E (IRQ_MASK). Internally, each pending interrupt is flagged in the interrupt status register. All interrupt events are ORcombined to a single external interrupt signal (IRQ pin). If an interrupt is issued pin 24 (IRQ) = H, the microcontroller shall read the interrupt status register 0x0F (IRQ_STATUS) to determine the source of the interrupt. A read access to this register clears the interrupt status register and thus the IRQ pin, too. Interrupts are not cleared automatically when the event trigger for respective interrupt flag bit in the register 0x0F (IRQ_STATUS) is no longer active. Only a read access to register 0x0F (IRQ_STATUS) clears the flag bits. Exceptions are IRQ_0 (PLL_LOCK) and IRQ_1 (PLL_UNLOCK) where each is cleared in addition by the appearance of the other. The supported interrupts for the Basic Operating Mode are summarized in Table 6-10. Table 6-10. Interrupt Description in Basic Operating Mode. IRQ Name Description Section IRQ_7 (BAT_LOW) Indicates a supply voltage below the programmed threshold. 9.6.4 IRQ_6 (TRX_UR) Indicates a Frame Buffer access violation. 9.4.3 IRQ_5 (AMI) Indicates address matching. IRQ_4 (CCA_ED_DONE) Multi-functional interrupt: 1. AWAKE_END: • Indicates radio transceiver reached TRX_OFF state at the end of P_ON  TRX_OFF and SLEEP  TRX_OFF state transition. 2. CCA_ED_DONE: • Indicates the end of a CCA or ED measurement. 8.2 7.1.2.3 8.6.4 IRQ_3 (TRX_END) RX: Indicates the completion of a frame reception. TX: Indicates the completion of a frame transmission. 7.1.3 7.1.3 IRQ_2 (RX_START) Indicates the start of a PSDU reception; the AT86RF212B state changed to BUSY_RX; the PHR can be read from Frame Buffer. 7.1.3 IRQ_1 (PLL_UNLOCK) Indicates PLL unlock. If the radio transceiver is in BUSY_TX / BUSY_TX_ARET state, the PA is turned off immediately. 9.8.5 IRQ_0 (PLL_LOCK) Indicates PLL lock. 9.8.5 Note: 1. The IRQ_4 (AWAKE_END) interrupt can usually not be seen when the transceiver enters TRX_OFF state after P_ON or RESET, because register 0x0E (IRQ_MASK) is reset to mask all interrupts. It is recommended to enable IRQ_4 (AWAKE_END) to be notified once the TRX_OFF state is entered. The interrupt handling in Extended Operating Mode is described in Section 7.2.5. 27 42002E–MCU Wireless–02/2015 6.7.2 Interrupt Mask Modes and Pin Polarity If register bit IRQ_MASK_MODE (register 0x04, TRX_CTRL_1) is set, an interrupt event can be read from IRQ_STATUS register even if the interrupt itself is masked. However, in that case no timing information for this interrupt is provided. The Table 6-11, Figure 6-22, and Figure 6-23 describes the function. Table 6-11. IRQ Mask Configuration. IRQ_MASK Value IRQ_MASK_MODE Description 0 0 IRQ is suppressed entirely and none of interrupt sources are shown in register IRQ_STATUS. 0 1 IRQ is suppressed entirely but all interrupt causes are shown in register IRQ_STATUS. ≠0 0 All enabled interrupts are signaled on IRQ pin and are also shown in register IRQ_STATUS. ≠0 1 All enabled interrupts are signaled on IRQ pin and all interrupt causes are shown in register IRQ_STATUS. Interrupt Sources Figure 6-22. IRQ_MASK_MODE = 0. . . . IRQ_MASK (register 0x0E) IRQ_STATUS (register 0x0F) IRQ OR Interrupt Sources Figure 6-23. IRQ_MASK_MODE = 1. . . . IRQ_STATUS (register 0x0F) IRQ IRQ_MASK OR (register 0x0E) The Atmel AT86RF212B IRQ pin polarity can be configured with register bit IRQ_POLARITY (register 0x04, TRX_CTRL_1). The default behavior is active high, which means that pin 24 (IRQ) = H issues an interrupt request. If the “Frame Buffer Empty Indicator” is enabled during Frame Buffer read access, the IRQ pin has an alternative functionality, refer to Section 11.6 for details. A solution to monitor the IRQ_STATUS register (without clearing it) is described in Section 6.4.1. 28 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 6.7.3 Register Description Register 0x0E (IRQ_MASK): The IRQ_MASK register controls the interrupt signaling via pin 24 (IRQ). Figure 6-24. Register IRQ_MASK. Bit 7 6 R/W 0 R/W 0 3 2 0x0E 5 4 R/W 0 R/W 0 1 0 R/W 0 R/W 0 IRQ_MASK Read/Write Reset value Bit 0x0E IRQ_MASK IRQ_MASK Read/Write Reset value R/W 0 R/W 0 IRQ_MASK • Bit 7:0 - IRQ_MASK Mask register for interrupts. IRQ_MASK[7] correspondents to IRQ_7 (BAT_LOW). IRQ_MASK[0] correspondents to IRQ_0 (PLL_LOCK). Table 6-12. IRQ_MASK. Register Bits Value Description IRQ_MASK 0x00 The IRQ_MASK register is used to enable or disable individual interrupts. An interrupt is enabled if the corresponding bit is set to one. All interrupts are disabled after power-on sequence (P_ON state) or reset (RESET state). Valid values are [0xFF, 0xFE, …, 0x00]. Note: 1. If an interrupt is enabled it is recommended to read the interrupt status register 0x0F (IRQ_STATUS) first to clear the history. Register 0x0F (IRQ_STATUS): The IRQ_STATUS register contains the status of the pending interrupt requests. Figure 6-25. Register IRQ_STATUS. Bit 0x0F 7 6 5 4 IRQ_7_BAT_LOW IRQ_6_TRX_UR IRQ_5_AMI IRQ_4_CCA_ED_ DONE Read/Write Reset value R 0 R 0 R 0 R 0 Bit 3 2 1 0 IRQ_3_TRX_END IRQ_2_RX_ START IRQ_1_PLL_ UNLOCK IRQ_0_PLL_ LOCK R 0 R 0 R 0 R 0 0x0F Read/Write Reset value IRQ_STATUS IRQ_STATUS For more information to meanings of interrupts, see Table 6-10 Interrupt Description in Basic Operating Mode. 29 42002E–MCU Wireless–02/2015 By reading the register after an interrupt is signaled at pin 24 (IRQ), the source of the issued interrupt can be identified. A read access to this register resets all interrupt bits, and so clears the IRQ_STATUS register. Notes: 1. If register bit IRQ_MASK_MODE (register 0x04, TRX_CTRL_1) is set, an interrupt event can be read from IRQ_STATUS register even if the interrupt itself is masked; refer to Figure 6-23. However in that case no timing information for this interrupt is provided. 2. If register bit IRQ_MASK_MODE (register 0x04, TRX_CTRL_1) is set, it is recommended to read the interrupt status register 0x0F (IRQ_STATUS) first to clear the history. Register 0x04 (TRX_CTRL_1): The TRX_CTRL_1 register is a multi-purpose register to control various operating modes and settings of the radio transceiver. Figure 6-26. Register TRX_CTRL_1. Bit 7 0x04 6 5 4 PA_EXT_EN IRQ_2_EXT_EN TX_AUTO_CRC_ ON RX_BL_CTRL R/W 0 R/W 0 R/W 1 R/W 0 3 2 Read/Write Reset value Bit 0x04 SPI_CMD_MODE Read/Write Reset value R/W 0 1 0 IRQ_MASK_MODE IRQ_POLARITY R/W 0 R/W 0 R/W 0 TRX_CTRL_1 TRX_CTRL_1 • Bit 6 - IRQ_2_EXT_EN The register bit IRQ_2_EXT_EN controls external signaling for time stamping via pin 10 (DIG2). Table 6-13. IRQ_2_EXT_EN. Register Bits IRQ_2_EXT_EN Value 0 Time stamping over pin 10 (DIG2) is disabled (1) Time stamping over pin 10 (DIG2) is enabled 1 Note: 1. Description The pin 10 (DIG2) is also active if the corresponding interrupt event IRQ_2 (RX_START) mask bit in register 0x0E (IRQ_MASK) is set to zero. The timing of a received frame can be determined by a separate pin 10 (DIG2). If register bit IRQ_2_EXT_EN is set to one, the reception of a PHR field is directly issued on pin 10 (DIG2), similar to interrupt IRQ_2 (RX_START). For further details refer to Section 11.5. 30 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B • Bit 1 - IRQ_MASK_MODE The radio transceiver supports polling of interrupt events. Interrupt polling is enabled by setting register bit IRQ_MASK_MODE. Table 6-14. IRQ_MASK_MODE. Register Bits Value IRQ_MASK_MODE Description 0 Interrupt polling is disabled. Masked off IRQ bits will not appear in IRQ_STATUS register. 1 Interrupt polling is enabled. Masked off IRQ bits will appear in IRQ_STATUS register. With the interrupt polling enabled (IRQ_MASK_MODE = 1) the interrupt events are flagged in the register 0x0F (IRQ_STATUS) when their respective mask bits are disabled in the register 0x0E (IRQ_MASK). • Bit 0 - IRQ_POLARITY The register bit IRQ_POLARITY controls the polarity for pin 24 (IRQ). The default polarity of the pin 24 (IRQ) is active high. The polarity can be configured to active low via register bit IRQ_POLARITY. Table 6-15. IRQ_POLARITY. Register Bits IRQ_POLARITY Note: 1. Value Description 0 Pin IRQ is high active 1 Pin IRQ is low active A modification of register bit IRQ_POLARITY has no influence to RX_BL_CTRL behavior. This setting does not affect the polarity of the “Frame Buffer Empty Indicator”, refer to Section 11.6. The Frame Buffer Empty Indicator is always active high. 31 42002E–MCU Wireless–02/2015 7 Operating Modes 7.1 Basic Operating Mode This section summarizes all states to provide the basic functionality of Atmel AT86RF212B, such as receiving and transmitting frames, the power-on sequence, and sleep. The Basic Operating Mode is designed for IEEE 802.15.4 and general ISM band applications; the corresponding radio transceiver states are shown in Figure 7-1. Figure 7-1. Basic Operating Mode State Diagram (for timing refer to Table 7-1). SLEEP (Sleep State) XOSC=ON Pull=ON XOSC=OFF Pull=OFF = L P_ON (Power-on after VDD) = H (from all states) R /RST = L SL FF P_ T 2 1 SL O X_ TR P_ TR 3 FORCE_TRX_OFF TRX_OFF 12 (all states except SLEEP) PLL_ON N _O FF RX O X_ TR PLL_ON 9 BUSY_TX (Transmit State) 10 SLP_TR = H or TX_START = P_ TR 14 SL P_ TR = SL L FORCE_PLL_ON RX_ON_NOCLK (Rx Listen State) (all states except SLEEP, P_ON, RESET, TRX_OFF, *_NOCLK) Legend: Blue: SPI Write to Register TRX_STATE (0x02) Red: Control signals via IC Pin Green: Event Basic Operating Mode States CLKM=OFF X 32 Frame End (PLL State) H SHR Detected ON 11 RX_ON (Rx Listen State) Frame End 4 FF 8 RX_ON L_ O X_ BUSY_RX (Receive State) SHR Detected PL 5 TR 6 RESET (all states except P_ON) XOSC=ON Pull=OFF 7 /RST = H 13 (Clock State) AT86RF212B State transition number, see Table 5-1 42002E–MCU Wireless–02/2015 AT86RF212B 7.1.1 State Control The radio transceiver’s states are controlled by shifting serial digital data using the SPI to write individual commands to the command register bits TRX_CMD (register 0x02, TRX_STATE). Change of the transceiver state can also be triggered by driving directly two signal pins: pin 11 (SLP_TR) and pin 8 (/RST). A successful state change can be verified by reading the radio transceiver status from register bits TRX_STATUS (register 0x01, TRX_STATUS). If TRX_STATUS = 0x1F (STATE_TRANSITION_IN_PROGRESS), the Atmel AT86RF212B is in a state transition. Do not try to initiate a further state change while the radio transceiver is in STATE_TRANSITION_IN_PROGRESS. Pin 11 (SLP_TR) is a multifunctional pin, refer to Section 6.6. Depending on the radio transceiver state, a rising edge of pin 11 (SLP_TR) causes the following state transitions: • TRX_OFF  SLEEP (level sensitive) • RX_ON  RX_ON_NOCLK (level sensitive) • PLL_ON  BUSY_TX Whereas the falling edge of pin SLP_TR causes the following state transitions: • SLEEP  TRX_OFF • RX_ON_NOCLK  RX_ON (level sensitive) A low level on pin 8 (/RST) causes a reset of all registers (register bits CLKM_CTRL are shadowed; for details, refer to Section 9.7.4) and forces the radio transceiver into TRX_OFF state. However, if the device was in P_ON state it remains in the P_ON state. For all states except SLEEP, the state change commands FORCE_TRX_OFF or TRX_OFF lead to a transition into TRX_OFF state. If the radio transceiver is in active receive or transmit states (BUSY_*), the command FORCE_TRX_OFF interrupts these active processes, and forces an immediate transition to TRX_OFF. In contrast a TRX_OFF command is stored until an active state (receiving or transmitting) has been finished. After that the transition to TRX_OFF is performed. For a fast transition from any non sleep states to PLL_ON state the command FORCE_PLL_ON is provided. Active processes are interrupted. In contrast to FORCE_TRX_OFF, this command does not disable the PLL and the analog voltage regulator (AVREG). It is not available in states P_ON, SLEEP, RESET, and all *_NOCLK states. The completion of each requested state change shall always be confirmed by reading the register bits TRX_STATUS (register 0x01, TRX_STATUS). Note: 1. If FORCE_TRX_OFF and FORCE_PLL_ON commands are used, it is recommended to set pin 11 (SLP_TR) = L before. 7.1.2 Basic Operating Mode Description 7.1.2.1 P_ON – Power-On after VDD When the external supply voltage (VDD) is applied first to the AT86RF212B, the radio transceiver goes into P_ON state performing an on-chip reset. The crystal oscillator is activated and the default 1MHz master clock is provided at pin 17 (CLKM) after the 33 42002E–MCU Wireless–02/2015 crystal oscillator has stabilized. CLKM can be used as a clock source to the microcontroller. The SPI interface and digital voltage regulator (DVREG) are enabled. The on-chip power-on-reset sets all registers to their default values. A dedicated reset signal from the microcontroller at pin 8 (/RST) is not necessary, but recommended for hardware / software synchronization reasons. All digital inputs are pulled-up or pulled-down during P_ON state, refer to Section 1.3.2. This is necessary to support microcontrollers where GPIO signals are floating after power-on or reset. The input pull-up and pull-down transistors are disabled when the radio transceiver leaves P_ON state towards TRX_OFF state. A reset during P_ON state does not change the pull-up and pull-down configuration. Leaving P_ON state, output pins DIG1/DIG2 are pulled-down to digital ground, whereas pins DIG3/DIG4 are pulled-down to analog ground, unless their configuration is changed. Prior to leaving P_ON, the microcontroller must set the Atmel AT86RF212B pins to the default operating values: pin 11 (SLP_TR) = L, pin 8 (/RST) = H and pin 23 (/SEL) = H. All interrupts are disabled by default. Thus, interrupts for state transition control are to be enabled first, for example enable IRQ_4 (AWAKE_END) to indicate a state transition to TRX_OFF state or interrupt IRQ_0 (PLL_LOCK) to signal a locked PLL in PLL_ON state. In P_ON state a first access to the radio transceiver registers is possible after a default 1MHz master clock is provided at pin 17 (CLKM), refer to tTR1 to Table 7-1. Once the supply voltage has stabilized and the crystal oscillator has settled (see parameter tXTAL refer to Table 7-2), the interrupt mask for the AWAKE_END should be set. A valid SPI write access to register bits TRX_CMD (register 0x02, TRX_STATE) with the command TRX_OFF or FORCE_TRX_OFF initiate a state change from P_ON towards TRX_OFF state, which is then indicated by an interrupt IRQ_4 (AWAKE_END) if enabled. 7.1.2.2 SLEEP – Sleep State In SLEEP state, the radio transceiver is disabled. The radio transceiver current consumption is reduced to leakage current plus the current of a low power voltage regulator (typ. 100nA). This regulator provides the supply voltage to the registers to preserve their contents. SLEEP state can only be entered from state TRX_OFF, by setting SLP_TR = H. If CLKM is enabled with a clock rates higher than 250kHz, the SLEEP state is entered 35 CLKM cycles after the rising edge at pin 11 (SLP_TR). At that time CLKM is turned off. If the CLKM output is already turned off (register bits CLKM_CTRL = 0), the SLEEP state is entered immediately. At clock rates of 250kHz and symbol clock rate (CLKM_CTRL values six and seven; register 0x03, TRX_CTRL_0), the main clock at pin 17 (CLKM) is turned off immediately. Setting SLP_TR = L returns the radio transceiver back to the TRX_OFF state. During SLEEP state the radio transceiver register contents and the AES register contents remain valid while the contents of the Frame Buffer are lost. /RST = L in SLEEP state returns the radio transceiver to TRX_OFF state and thereby sets all registers to their default values. Exceptions are register bits CLKM_CTRL (register 0x03, TRX_CTRL_0). These register bits require a specific treatment; for details see Section 9.7.4. 34 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 7.1.2.3 TRX_OFF – Clock State In TRX_OFF the crystal oscillator is running and the master clock is available if enabled. The SPI interface and digital voltage regulator are enabled, thus the radio transceiver registers, the Frame Buffer and security engine (AES) are accessible (see Section 9.4 and Section 11.1). In contrast to P_ON state the pull-up and pull-down configuration is disabled. Notes: 1. Pin 11 (SLP_TR) and pin 8 (/RST) are available for state control. 2. The analog front-end is disabled during TRX_OFF state. If TRX_OFF_AVDD_EN (register 0x0C, TRX_CTRL_2) is set, the analog voltage regulator is turned on, enabling faster switch to any transmit/receive state. Entering the TRX_OFF state from P_ON, SLEEP, or RESET state, the state change is indicated by interrupt IRQ_4 (AWAKE_END) if enabled. 7.1.2.4 PLL_ON – PLL State Entering the PLL_ON state from TRX_OFF state enables the analog voltage regulator (AVREG) first, unless the AVREG is already switched on (register 0x0C, TRX_OFF_AVDD_EN). After the voltage regulator has been settled (see Table 7-2), the PLL frequency synthesizer is enabled. When the PLL has been settled at the receive frequency to a channel defined by register bits CHANNEL (register 0x08, PHY_CC_CCA) or register bits CC_NUMBER (register 0x13, CC_CTRL_0) and CC_BAND (register 0x14, CC_CTRL_1), refer to Section 9.8.2, a successful PLL lock is indicated by issuing an interrupt IRQ_0 (PLL_LOCK). If an RX_ON command is issued in PLL_ON state, the receiver is enabled immediately. If the PLL has not been settled before the state change nevertheless takes place. Even if the register bits TRX_STATUS (register 0x01, TRX_STATUS) indicates RX_ON, actual frame reception can only start once the PLL has locked. The PLL_ON state corresponds to the TX_ON state in IEEE 802.15.4. 7.1.2.5 RX_ON and BUSY_RX – RX Listen and Receive State In RX_ON state the receiver is in the RX data polling mode and the PLL frequency synthesizer is locked to its preprogrammed frequency. The Atmel AT86RF212B receive mode is internally separated into RX_ON state and BUSY_RX state. There is no difference between these states with respect to the analog radio transceiver circuitry, which are always turned on. In both states, the receiver and the PLL frequency synthesizer are enabled. During RX_ON state, the receiver listens for incoming frames. After detecting a valid synchronization header (SHR), the AT86RF212B automatically enters the BUSY_RX state. The reception of a valid PHY header (PHR) generates an IRQ_2 (RX_START) if enabled. During PSDU reception, the frame data are stored continuously in the Frame Buffer until the last byte was received. The completion of the frame reception is indicated by an interrupt IRQ_3 (TRX_END) and the radio transceiver reenters the state RX_ON. At the same time the register bit RX_CRC_VALID (register 0x06, PHY_RSSI) is updated with the result of the FCS check (see Section 8.3). Received frames are passed to the frame filtering unit, refer to Section 8.2. If the content of the MAC addressing fields (refer to [2] IEEE 802.15.4-2006, Section 7.2.1) generates a match, IRQ_5 (AMI) interrupt is issued, refer to Section 6.7. The expected address values are to be stored in registers 0x20 – 0x2B (Short address, PAN-ID and 35 42002E–MCU Wireless–02/2015 IEEE address). Frame filtering is available in Basic Operating Mode and Extended Operating Mode, refer to Section 8.2. Leaving state RX_ON is possible by writing a state change command to register bits TRX_CMD in register 0x02 (TRX_STATE). 7.1.2.6 RX_ON_NOCLK – RX Listen State without CLKM In RX_ON_NOCLK state the receiver is in the RX data polling mode with CLKM output disabled. If the radio transceiver is listening for an incoming frame and the microcontroller is not running an application, the microcontroller may be powered down to decrease the total system power consumption. This specific power-down scenario – for systems running in clock synchronous mode (see Chapter 6) – is supported by the Atmel AT86RF212B using the state RX_ON_NOCLK. This state can only be entered by asserting pin 11 (SLP_TR) = H while the radio transceiver is in RX_ON state. Pin 17 (CLKM) is disabled 35 CLKM cycles after the rising edge at pin 11 (SLP_TR), see Figure 6-21. This allows the microcontroller to complete its power-down sequence. Note: 1. For CLKM clock rates 250kHz and symbol clock rates (CLKM_CTRL values six and seven; register 0x03, TRX_CTRL_0), the master clock signal CLKM is switched off immediately after the rising edge of pin 11 (SLP_TR). Once in RX_ON_NOCLK state a valid SHR header triggers a state transition to BUSY_RX state. The reception of a frame shall be indicated to the microcontroller by an interrupt indicating the receive status. CLKM is turned on again, and the radio transceiver enters the BUSY_RX state (see Section 6.6 and Figure 6-21). When using RX_ON_NOCLK, it is essential to enable at least one interrupt request indicating the reception status. After the receive transaction has been completed, the radio transceiver enters the RX_ON state. The radio transceiver only reenters the RX_ON_NOCLK state when the next rising edge of pin 11 (SLP_TR) occurs. If the AT86RF212B is in the RX_ON_NOCLK state and pin 11 (SLP_TR) is reset to logic low, it enters the RX_ON state and it starts to supply clock on pin 17 (CLKM) again. Note: 2. A reset in state RX_ON_NOCLK further requires to reset pin 11 (SLP_TR) to logic low, otherwise the radio transceiver enters directly the SLEEP state. 7.1.2.7 BUSY_TX – Transmit State In the BUSY_TX state AT86RF212B is in the data transmission state. A transmission can only be initiated from the PLL_ON state. The transmission can be started either by driving event such as: • A rising edge on pin 11 (SLP_TR), or • A serial TX_START command via the SPI to register bits TRX_CMD (register 0x02, TRX_STATE). Either of these forces the radio transceiver into the BUSY_TX state. Refer to Section 10.2 for more details. During the transition to the BUSY_TX state, the PLL frequency shifts to the transmit frequency, refer to Section 9.8.3. The actual transmission of the first data chip of the 36 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B SHR starts after one symbol period (see note) in order to allow PLL settling and PA ramp-up, see Figure 7-6. After transmission of the SHR, the Frame Buffer content is transmitted. In case the PHR indicates a frame length of zero, the transmission is aborted immediately after the PHR field. After the frame transmission has been completed, the AT86RF212B automatically turns off the power amplifier, generates an IRQ_3 (TRX_END) interrupt, and returns into PLL_ON state. Note: 1. Throughout this datasheet, a “symbol period” refers to the definition described in Section 9.1.3. 7.1.2.8 RESET State The RESET state is used to set back the state machine and to reset all registers of Atmel AT86RF212B to their default values; exceptions are register bits CLKM_CTRL (register 0x03, TRX_CTRL_0). These register bits require a specific treatment, for details see Section 9.7.4. Once in RESET state a device enters TRX_OFF state by setting pulling a reset pin high pin 8 (/RST) = H. If the device is still in the P_ON state it remains in the P_ON state though. A reset is triggered by pulling /RST pin low pin 8 (/RST) = L and the state returns after setting /RST = H. The reset pulse should have a minimum length as specified in Section 7.1.4.5 and Section 12.4 (parameter t10). During reset, the microcontroller has to set the radio transceiver control pins SLP_TR and /SEL to their default values. An overview of the register reset values is provided in Table 14-2. 37 42002E–MCU Wireless–02/2015 7.1.3 Interrupt Handling All interrupts provided by the Atmel AT86RF212B (see Table 6-10) are supported in Basic Operating Mode. For example, interrupts are provided to observe the status of radio transceiver RX and TX operations. When being in receive mode, IRQ_2 (RX_START) indicates the detection of a valid PHR first, IRQ_5 (AMI) an address match, and IRQ_3 (TRX_END) the completion of the frame reception. During transmission, IRQ_3 (TRX_END) indicates the completion of the frame transmission. Figure 7-2 shows an example for a transmit/receive transaction between two devices and the related interrupt events in Basic Operating Mode. Device 1 transmits a frame containing a MAC header (in this example of length seven), MAC payload, and a valid FCS. The end of the frame transmission is indicated by IRQ_3 (TRX_END). The frame is received by Device 2. Interrupt IRQ_2 (RX_START) indicates the detection of a valid PHR field and IRQ_3 (TRX_END) the completion of the frame reception. If the frame passes the Frame Filter (refer to Section 8.2), an address match interrupt IRQ_5 (AMI) is issued after the reception of the MAC header (MHR). The received frame is stored in the Frame Buffer. In Basic Operating Mode the third interrupt IRQ_3 (TRX_END) is issued at the end of the received frame. In Extended Operating Mode, refer to Section 7.2; the interrupt is only issued if the received frame passes the address filter and the FCS is valid. Further exceptions are explained in Section 7.2. Processing delay tIRQ is a typical value, refer to Section 12.4. Figure 7-2. Timing of RX_START, AMI and TRX_END Interrupts in Basic Operating Mode for O-QPSK 250kb/s Mode. 160 PLL_ON 192 192+(9+m)*32 Time [µs] PLL_ON BUSY_TX SLP_TR IRQ IRQ_3 (TRX_END) tTR10 Number of Octets Frame Content TRX_STATE 1 1 7 m 2 SFD PHR MHR MSDU FCS BUSY_RX RX_ON IRQ IRQ_2 (RX_START) Interrupt latency 38 4 Preamble AT86RF212B tIRQ IRQ_5 (AMI) tIRQ Frame on Air Typ. Processing Delay RX_ON TRX_END RX (Device 2) TRX_STATE 128 TX (Device1) -16 0 tIRQ 42002E–MCU Wireless–02/2015 AT86RF212B 7.1.4 Basic Operating Mode Timing This section depicts Atmel AT86RF212B state transitions and their timing properties. Timing figures are explained in Table 7-1, Table 7-2, and Section 12.4. 7.1.4.1 Power-on Procedure The power-on procedure to P_ON state is shown in Figure 7-3. Figure 7-3. Power-on Procedure to P_ON State. 0 100 Event VDD on State P_ON Block XOSC, DVREG 400 Time [µs] CLKM on Time tTR1 When the external supply voltage (VDD) is initially supplied to the AT86RF212B, the radio transceiver enables the crystal oscillator (XOSC) and the internal 1.8V voltage regulator for the digital domain (DVREG). After tTR1 = 420µs (typ.), the master clock signal is available at pin 17 (CLKM) at default rate of 1MHz. As soon as CLKM is available the SPI is enabled and can be used to control the transceiver. As long as no state change towards state TRX_OFF is performed, the radio transceiver remains in P_ON state. 7.1.4.2 Wake-up Procedure from SLEEP The wake-up procedure from SLEEP state is shown in Figure 7-4. Figure 7-4. Wake-up Procedure from SLEEP State. 100 0 SLP_TR = L Event State Block Time 200 400 300 CLKM Time [μs] IRQ_4 (AWAKE_END) TRX_OFF SLEEP XOSC, DVREG FTN XOSC, DVREG tTR2 The radio transceiver’s SLEEP state is left by releasing pin 11 (SLP_TR) to logic low. This restarts the XOSC and DVREG. After tTR2 = 420µs (typ.) the radio transceiver enters TRX_OFF state. The internal clock signal is available and provided to pin 17 (CLKM), if enabled. This procedure is similar to the Power-on Procedure. However the radio transceiver automatically proceeds to the TRX_OFF state. During this, transition the filter-tuning network (FTN) calibration is performed. Entering TRX_OFF state is signaled by IRQ_4 (AWAKE_END), if this interrupt was enabled by the appropriate mask register bit. 39 42002E–MCU Wireless–02/2015 7.1.4.3 PLL_ON and RX_ON States The transition from TRX_OFF to PLL_ON or RX_ON state and further to RX_ON or PLL_ON is shown in Figure 7-5. Figure 7-5. Transition from TRX_OFF to PLL_ON/RX_ON State and further to RX_ON/PLL_ON. 200 0 IRQ_0 (PLL_LOCK) Event State RX_ON / PLL_ON PLL_ON / RX_ON TRX_OFF Block AVREG Command PLL_ON / RX_ON Time Notes: Time [µs] PLL RX_ON / PLL_ON tTR8/tTR9 tTR4 / tTR6 1. If TRX_CMD = RX_ON in TRX_OFF state, RX_ON state is entered immediately, even if the PLL has not settled. 2. Timing figures tTR4, tTR6, tTR8, and tTR9 refers to Table 7-1. In TRX_OFF state, entering the commands PLL_ON or RX_ON initiates a ramp-up sequence of the internal 1.8V voltage regulator for the analog domain (AVREG). RX_ON state can be entered any time from PLL_ON state, regardless whether the PLL has already locked, which is indicated by IRQ_0 (PLL_LOCK). Likewise, PLL_ON state can be entered any time from RX_ON state. When TRX_OFF_AVDD_EN (register 0x0C, TRX_CTRL_2) is already set in TRX_OFF state, the analog voltage regulator is turned on immediately and the ramp-up sequence to PLL_ON or RX_ON can be accelerated. 7.1.4.4 BUSY_TX to RX_ON States The transition from PLL_ON to BUSY_TX state and subsequently to RX_ON state is shown in Figure 7-6. Figure 7-6. PLL_ON to BUSY_TX to RX_ON Timing for O-QPSK 250kb/s Mode. 16 0 SLP_TR=H or TRX_CMD =TX_START Event State PLL_ON Time TRX_CMD=RX_ON BUSY_TX Block IRQ_3 (TRX_END) RX_ON TX tTR10 x + 32 Time [µs] x PLL RX tTR11 Starting from PLL_ON state, it is further assumed that the PLL has already been locked. A transmission is initiated either by a rising edge of pin 11 (SLP_TR) or by command TX_START. The PLL settles to the transmit frequency and the PA is enabled. After the duration of tTR10 (one symbol period), the Atmel AT86RF212B 40 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B changes into BUSY_TX state, transmitting the internally generated SHR and the PSDU data of the Frame Buffer. After completing the frame transmission, indicated by IRQ_3 (TRX_END), the PLL settles back to the receive frequency within tTR11 = 32µs and returns to state PLL_ON. If during BUSY_TX the radio transmitter is requested to change to a receive state, it automatically proceeds to state RX_ON upon completion of the transmission. 7.1.4.5 Reset Procedure The radio transceiver reset procedure is shown in Figure 7-7. Figure 7-7. Reset Procedure. x + 30 x 0 Time [μs] [IRQ_4 (AWAKE_END)] Event Any, except P_ON and SLEEP State TRX_OFF undefined Block FTN Pin /RST Time Note: t10 1. tTR13 Timing figure tTR13 refers to Table 7-1, t10 refers to Section 12.4. /RST = L sets all registers to their default values. Exceptions are register bits CLKM_CTRL (register 0x03, TRX_CTRL_0), refer to Section 9.7.4. After releasing the reset pin 8 (/RST) = H, the wake-up sequence including an FTN calibration cycle is performed, refer to Section 9.9. After that, the TRX_OFF state is entered. Figure 7-7 illustrates the reset procedure once P_ON state was left and the radio transceiver was not in SLEEP state. The reset procedure is identical for all originating radio transceiver states except of states P_ON and SLEEP. Instead, the procedures described in Section 7.1.2.1 and Section 7.1.2.2 must be followed to enter the TRX_OFF state. If the radio transceiver was in SLEEP state, the XOSC and DVREG are enabled before entering TRX_OFF state. If register bits TRX_STATUS indicates STATE_TRANSITION_IN_PROGRESS during system initialization until the Atmel AT86RF212B reaches TRX_OFF state, do not try to initiate a further state change while the radio transceiver is in this state. Notes: 2. The reset impulse should have a minimum length t10 = 625ns as specified in Section 12.4. 3. An access to the device should not occur earlier than t11 ≥ 625ns after releasing the /RST pin; refer to Section 12.4. 4. A reset overrides an SPI command request that might have been queued. 41 42002E–MCU Wireless–02/2015 7.1.4.6 State Transition Timing Summary The Atmel AT86RF212B transition numbers correspond to Figure 7-1 and do not include SPI access time if not otherwise stated. See measurement setup in Figure 5-1. Table 7-1. State Transition Timing. Symbol Parameter Condition tTR1 P_ON⇒CLKM is available tTR1a Typ. Max. Unit Depends on crystal oscillator setup (Siward A207-011, CL= 10pF) and external capacitor at DVDD (CB3 = 1µF nom.). 420 1000 µs SLEEP⇒CLKM is available Depends on crystal oscillator setup (Siward A207-011, CL= 10pF) and external capacitor at DVDD (CB3 = 1µF nom.). 390 1000 µs tTR2 SLEEP⇒TRX_OFF Depends on crystal oscillator setup (Siward A207-011, CL= 10pF) and external capacitor at DVDD (CB3 = 1µF nom.); TRX_OFF state indicated by IRQ_4 (AWAKE_END). 420 1000 µs tTR3 TRX_OFF⇒SLEEP For fCLKM > 250kHz. 35 CLKM cycles Otherwise. 0 CLKM cycles tTR4 TRX_OFF⇒PLL_ON tTR5 PLL_ON⇒TRX_OFF tTR6 TRX_OFF⇒RX_ON tTR7 RX_ON⇒TRX_OFF 1 µs tTR8 PLL_ON⇒RX_ON 1 µs tTR9 RX_ON⇒PLL_ON Transition time is also valid for TX_ARET_ON, RX_AACK_ON⇒PLL_ON. 1 µs tTR10 PLL_ON⇒BUSY_TX When asserting pin 11 (SLP_TR) or TRX_CMD = TX_START first symbol transmission is delayed by one symbol period (PLL settling and PA ramp-up). 1 symbol period tTR11 BUSY_TX⇒PLL_ON PLL settling time. 32 µs tTR12 Various states⇒TRX_OFF Using TRX_CMD = FORCE_TRX_OFF (see register 0x02, TRX_STATE); not valid for SLEEP⇒TRX_OFF (see tTR2). 1 µs tTR13 RESET⇒TRX_OFF Not valid for P_ON or SLEEP. 26 µs tTR14 Various states⇒PLL_ON Using TRX_CMD = FORCE_PLL_ON (see register 0x02, TRX_STATE); not valid for 1 µs 42 AT86RF212B Depends on external capacitor at AVDD (CB1 = 1µF nom.); register bit TRX_OFF_AVDD_EN (register 0x0C, TRX_CTRL_2) is not set. Min. Depends on external capacitor at AVDD (CB1 = 1µF nom.); register bit TRX_OFF_AVDD_EN (register 0x0C, TRX_CTRL_2) is not set. 170 µs 1 µs 170 µs 42002E–MCU Wireless–02/2015 AT86RF212B Symbol Parameter Condition Min. Typ. Max. Unit states SLEEP, P_ON, RESET, TRX_OFF, and *_NOCLK. The state transition timing is calculated based on the timing of the individual blocks shown in Figure 7-3 to Figure 7-7. The worst case values include maximum operating temperature, minimum supply voltage, and device parameter variations. Table 7-2. Block Initialization and Settling Time. Symbol Parameter Condition tXTAL Reference oscillator settling time Start XTAL⇒clock available at pin 17 (CLKM). Depends on crystal oscillator setup (Siward A207011, CL= 10pF). tFTN FTN calibration time tDVREG DVREG settling time Depends on external bypass capacitor at DVDD (CB3 = 1µF nom., 10µF worst case). tAVREG AVREG settling time tPLL_INIT Min. Typ. Max. Unit 420 1000 µs 25 µs 150 1500 µs Depends on external bypass capacitor at AVDD (CB1 = 1µF nom., 10µF worst case). 150 1500 µs Initial PLL settling time PLL settling time TRX_OFF⇒PLL_ON, including 150µs AVREG settling time. 170 370 µs tPLL_SW PLL settling time on channel switch Duration of channel switch within frequency band. 11 42 µs tPLL_CF PLL CF calibration PLL center frequency calibration. 8 270 µs tPLL_DCU PLL DCU calibration PLL DCU calibration. 10 10 µs tRX_TX RX⇒TX Maximum settling time RX⇒TX. 16 µs tTX_RX TX⇒RX Maximum settling time TX⇒RX. 32 µs tRSSI RSSI, update RSSI update period in receive states. 8 BPSK-20: 32 µs BPSK-40: 24 µs O-QPSK: 8 µs tED ED measurement ED measurement period is eight symbols. Different timing within High Data Rate Modes. 8 symbol tCCA CCA measurement CCA measurement period is eight symbols. 8 symbol tRND Random value, update Random value update period. 1 µs tAES AES core cycle time 23.4 24 µs 43 42002E–MCU Wireless–02/2015 7.1.5 Register Description Register 0x01 (TRX_STATUS): The read-only register TRX_STATUS signals the present state of the radio transceiver as well as the status of a CCA operation. Figure 7-8. Register TRX_STATUS. Bit 0x01 7 6 5 4 CCA_DONE CCA_STATUS reserved TRX_STATUS Read/Write Reset value R 0 R 0 R 0 R 0 Bit 3 2 1 0 R 0 R 0 0x01 TRX_STATUS Read/Write Reset value R 0 R 0 TRX_STATUS TRX_STATUS • Bit 4:0 - TRX_STATUS The register bits TRX_STATUS signal the current radio transceiver status. Table 7-3. TRX_STATUS. Register Bits Value Description TRX_STATUS 0x00 P_ON 0x01 BUSY_RX 0x02 BUSY_TX 0x06 RX_ON 0x08 TRX_OFF (CLK Mode) 0x09 PLL_ON (TX_ON) (1) SLEEP 0x11 (2) BUSY_RX_AACK 0x12 (2) BUSY_TX_ARET 0x16 (2) RX_AACK_ON 0x19 (2) TX_ARET_ON 0x0F 0x1C RX_AACK_ON_NOCLK (2) BUSY_RX_AACK_NOCLK (3) STATE_TRANSITION_IN_PROGRESS 0x1D 0x1E 0x1F RX_ON_NOCLK (2) All other values are reserved Notes: 1. In SLEEP state register not accessible. 2. Extended Operating Mode only. 3. Do not try to initiate a further state change while the radio transceiver is in STATE_TRANSITION_IN_PROGRESS state. A read access to register bits TRX_STATUS reflects the current radio transceiver state. A state change is initiated by writing a state transition command to register bits TRX_CMD (register 0x02, TRX_STATE). Alternatively, some state transitions can be initiated by the rising edge of pin 11 (SLP_TR) in the appropriate state. These register bits are used for Basic and Extended Operating Mode, see Section 7.2. 44 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B If the requested state transition has not been completed, the TRX_STATUS returns STATE_TRANSITION_IN_PROGRESS value. Do not try to initiate a further state change while the radio transceiver is in STATE_TRANSITION_IN_PROGRESS state. State transition timings are defined in Table 7-1. Register 0x02 (TRX_STATE): The radio transceiver states are advanced via register TRX_STATE by writing a command word into register bits TRX_CMD. The read-only register bits TRAC_STATUS indicate the status or result of an Extended Operating Mode transaction. Figure 7-9. Register TRX_STATE. Bit 7 0x02 6 5 TRAC_STATUS Read/Write Reset value R 0 R 0 Bit 3 2 0x02 4 TRX_CMD R 0 R/W 0 1 0 R/W 0 R/W 0 TRX_CMD Read/Write Reset value R/W 0 R/W 0 TRX_STATE TRX_STATE • Bit 4:0 - TRX_CMD A write access to register bits TRX_CMD initiate a radio transceiver state transition to the new state. Table 7-4. TRX_CMD. Register Bits TRX_CMD Value Description 0x00 (1) NOP 0x02 (2) TX_START 0x03 0x04 (3) FORCE_TRX_OFF FORCE_PLL_ON 0x06 RX_ON 0x08 TRX_OFF (CLK Mode) 0x09 PLL_ON (TX_ON) 0x16 (4) RX_AACK_ON 0x19 (4) TX_ARET_ON All other values are reserved Notes: 1. TRX_CMD = “0” after power on reset (POR). 2. The frame transmission starts one symbol after TX_START command. 3. FORCE_PLL_ON command is not valid in states P_ON, SLEEP, RESET, and all *_NOCLK states, as well as STATE_TRANSITION_IN_PROGRES towards these states. 4. Extended Operating Mode only. A write access to register bits TRX_CMD initiates a radio transceiver state transition towards the new state. These register bits are used for Basic and Extended Operating Mode, see Section 7.2. 45 42002E–MCU Wireless–02/2015 7.2 Extended Operating Mode Extended Operating Mode makes up for a large set of automated functionality add-ons which can be referred to as a hardware MAC accelerator. These add-ons go beyond the basic radio transceiver functionality provided by the Basic Operating Mode. Extended Operating Mode functions handle time critical MAC tasks, requested by the IEEE 802.15.4 standard, in hardware, such as automatic acknowledgement, automatic CSMA-CA, and retransmission. This results in a more efficient IEEE 802.15.4 software MAC implementation, including reduced code size, and may allow use of a smaller microcontroller or operation at low clock rates. The Extended Operating Mode is designed to support IEEE 802.15.4-2006 and IEEE 802.15.4-2011 compliant frames; the mode is backward compatible to IEEE 802.15.4-2003 and supports non IEEE 802.15.4 compliant frames. This mode comprises the following procedures: Automatic acknowledgement (RX_AACK) divides into the tasks: • Frame reception and automatic FCS check • Configurable addressing fields check • Interrupt indicating address match • Interrupt indicating frame reception, if it passes address filtering and FCS check • Automatic ACK frame transmission (if the received frame passed the address filter and FCS check and if an ACK is required by the frame type and ACK request) • Support of slotted acknowledgment using SLP_TR pin (used for beacon-enabled operation) Automatic CSMA-CA and Retransmission (TX_ARET) divides into the tasks: • CSMA-CA, including automatic CCA retry and random backoff • Frame transmission and automatic FCS field generation • Reception of ACK frame (if an ACK was requested) • Automatic retry of transmissions if ACK was expected but not received or accepted • Interrupt signaling with transaction status Automatic FCS check and generation, refer to Section 8.3, is used by the RX_AACK and TX_ARET modes. In RX_AACK mode, an automatic FCS check is always performed for incoming frames. In TX_ARET mode, an ACK which is received within the time required by IEEE 802.15.4 is automatically accepted if the FCS is valid and the ACK sequence number must match the sequence number of the previously transmitted frame. Dependent on the value of the frame pending subfield in the received acknowledgement frame received, the transaction status is set, see register bits TRAC_STATUS (register 0x02, TRX_STATE), Section 7.2.7. An Atmel AT86RF212B state diagram, including the Extended Operating Mode states, is shown in Figure 7-10. Orange marked states represent the Basic Operating Mode; blue marked states represent the Extended Operating Mode. 46 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 7-10. Extended Operating Mode State Diagram. SLEEP (Sleep State) XOSC=ON Pull=ON XOSC=OFF Pull=OFF TRX_OFF 12 /RST = L 13 (Clock State) (all modes except SLEEP) (from all states) SL FF FORCE_TRX_OFF 2 1 3 P_ TR =H SL O X_ TR P_ TR =L P_ON (Power-on after VDD) /RST = H (all modes except P_ON) RESET TR X_ O FF RX _O 8 RX_ON (Receive State) (Rx Listen State) RX_ON PLL_ON SLP_TR=H or TX_START PLL_ON 10 BUSY_TX (PLL State) 11 (Transmit State) 9 TR =L _ LP see notes From / To TRX_OFF _A R TR ET_ X_ O OF N F K_ _A RX FORCE_PLL_ON RX TX _A A TR CK_ X_ OF ON F CLKM=OFF AC PL From / To TRX_OFF PLL_ON ON ON L_ SL (Rx Listen State) TX_ARET_ON TR S RX_ON_NOCLK SHR Detected RX_AACK_ON BUSY_RX_AACK Transaction Finished CLKM=OFF SHR Detected Frame Rejected SLP_TR=H or TX_START TX_ARET_ON BUSY_TX_ARET SLP_TR=H Frame End SLP_TR=L Frame Accepted BUSY_RX_ AACK_NOCLK Frame End 14 =H P_ SHR Detected BUSY_RX 4 FF SHR Detected Frame End 5 7 O X_ TR 6 ON L_ PL N XOSC=ON Pull=OFF RX_AACK_ ON_NOCLK CLKM=OFF Legend: Blue: SPI Write to Register TRX_STATE (0x02) Red: Control signals via IC Pin Green: Event Basic Operating Mode States Extended Operating Mode States 47 42002E–MCU Wireless–02/2015 7.2.1 State Control The Extended Operating Mode include RX_AACK and TX_ARET modes and are controlled by writing respective command to register bits TRX_CMD (register 0x02, TRX_STATE). Receive with Auto matic Acknowledgement state RX_AACK_ON and Transmit with Automatic Frame Retransmission and CSMA-CA Retry state TX_ARET_ON can be entered either from TRX_OFF or PLL_ON state as illustrated in Figure 7-10. The completion of each change state command shall always be confirmed by reading the register bits TRX_STATUS (register 0x01, TRX_STATUS). RX_AACK - Receive with Automatic Acknowledgement A state transition to RX_AACK_ON from PLL_ON or TRX_OFF is initiated by writing the RX_AACK_ON command to register bits TRX_CMD (register 0x02, TRX_STATE). On success, reading register bits TRX_STATUS (register 0x01, TRX_STATUS) returns RX_AACK_ON or BUSY_RX_AACK. The latter one is returned when a frame is being received. The RX_AACK Extended Operating Mode is terminated by writing command PLL_ON to the register bits TRX_CMD. If the Atmel AT86RF212B is within a frame receive or acknowledgment procedure (BUSY_RX_AACK), the state change is executed after finishing. Alternatively, the commands FORCE_TRX_OFF or FORCE_PLL_ON can be used to cancel the RX_AACK transaction and switch to TRX_OFF or PLL_ON state respectively. TX_ARET - Transmit with Automatic Frame Retransmission and CSMA-CA Retry A state transition to TX_ARET_ON from PLL_ON or TRX_OFF is initiated by writing TX_ARET_ON command to register bits TRX_CMD (register 0x02, TRX_STATE). The radio transceiver is in the TX_ARET_ON state when register bits TRX_STATUS (register 0x01, TRX_STATUS) return TX_ARET_ON. The TX_ARET transaction (frame transmission) is actually started by a rising edge on pin 11 (SLP_TR) or by writing the command TX_START to register bits TRX_CMD. The TX_ARET Extended Operating Mode is terminated by writing the command PLL_ON to the TRX_CMD register bits. If the AT86RF212B is in the mids of a CSMA-CA transaction, a frame transmission or an acknowledgment procedure (BUSY_TX_ARET), the state change is executed after completing of the operation. Alternatively, the command FORCE_PLL_ON can be used to instantly terminate the TX_ARET transaction and change into transceiver state PLL_ON, respectively. Note: 48 AT86RF212B 1. A state change request from TRX_OFF to RX_AACK_ON or TX_ARET_ON internally passes through PLL_ON state to initiate the radio transceiver front end. Inserting PLL_ON state and associated delays while performing this transition are indicated in Table 7-1. State transitioning can be tracked when interrupt IRQ_0 (PLL_LOCK) is used as an indicator. 42002E–MCU Wireless–02/2015 AT86RF212B 7.2.2 Configuration As the usage of the Extended Operating Mode is based on Basic Operating Mode functionality, only features beyond the basic radio transceiver functionality are described in the following sections. For details of the Basic Operating Mode, refer to Section 7.1. When using the RX_AACK or TX_ARET modes, the following registers need to be configured. RX_AACK configuration steps: • Set the short address, PAN ID, and IEEE address registers 0x20 – 0x2B • Configure RX_AACK properties registers 0x2C, 0x2E o Handling of Frame Version Subfield o Handling of Pending Data Indicator o Characterization as PAN coordinator o Handling of Slotted Acknowledgement • Additional Frame Filtering Properties o Use of Promiscuous Mode o Use of automatic ACK generation o Handling of reserved frame types registers 0x17, 0x2E The configuration of the Frame Filter is described in Section 8.2.1. The addresses for the address match algorithm are to be stored in the appropriate address registers. Additional control of the RX_AACK mode is done with register 0x17 (XAH_CTRL_1) and register 0x2E (CSMA_SEED_1). As long as a short address is not set, only broadcast frames and frames matching the full 64-bit IEEE address can be received. Configuration examples for different device operating modes and handling of various frame types can be found in Section 7.2.3.1. TX_ARET configuration steps: • Set register bit TX_AUTO_CRC_ON = 1 register 0x04, TRX_CTRL_1 • Configure CSMA-CA o MAX_FRAME_RETRIES register 0x2C, XAH_CTRL_0 o MAX_CSMA_RETRIES register 0x2C, XAH_CTRL_0 o CSMA_SEED registers 0x2D, 0x2E o MAX_BE, MIN_BE register 0x2F, CSMA_BE • Configure CCA (see Section 8.6) MAX_FRAME_RETRIES (register 0x2C, XAH_CTRL_0) defines the maximum number of frame retransmissions. The register bits MAX_CSMA_RETRIES (register 0x2C, XAH_CTRL_0) configure the number of CSMA-CA retries after a busy channel is detected. The register bits CSMA_SEED (registers 0x2D, 0x2E) define a random seed for the backoff-time random-number generator in the Atmel AT86RF212B. The register bits MAX_BE and MIN_BE (register 0x2F, CSMA_BE) set the maximum and minimum CSMA backoff exponent (see [2]), respectively. 49 42002E–MCU Wireless–02/2015 7.2.3 RX_AACK_ON – Receive with Automatic ACK The RX_AACK Extended Operating Mode handles reception and automatic acknowledgement of IEEE 802.15.4 compliant frames. The general functionality of the RX_AACK procedure is shown in Figure 7-11. The gray shaded area is the standard flow of an RX_AACK transaction for IEEE 802.15.4 compliant frames, refer to Section 7.2.3.2. All other procedures are exceptions for specific operating modes or frame formats, refer to Section 7.2.3.3. In RX_AACK_ON state, the Atmel AT86RF212B listens for incoming frames. After detecting a valid PHR, the radio transceiver changes into BUSY_RX_AACK state and parses the frame content of the MAC header (MHR), refer to Section 8.1.2. If the content of the MAC addressing fields of the received frame (refer to IEEE 802.15.4 Section 7.2.1) matches one of the configured addresses, dependent on the addressing mode, an address match interrupt IRQ_5 (AMI) is issued, refer to Section 8.2. The reference address values are to be stored in registers 0x20 – 0x2B (Short address, PAN-ID and IEEE address). Frame filtering as described in Section 8.2 is also applied in Basic Operating Mode. However, in Basic Operating Mode, the result of frame filtering or FCS check do not affect the generation of an interrupt IRQ_3 (TRX_END). Generally, at nodes configured as a normal device or a PAN coordinator, a frame is indicated by interrupt IRQ_3 (TRX_END) if the frame passes the Frame Filter and the FCS is valid. The interrupt is issued after the completion of the frame reception. The microcontroller can then read the frame data. An exception applies if promiscuous mode is enabled, see Section 7.2.3.2. In this case, an interrupt IRQ_3 (TRX_END) is issued for all frames. During reception AT86RF212B parses bit[5] (ACK Request) of the frame control field of the received data or MAC command frame to check if an acknowledgement (ACK) reply is expected. If the bit is set and if the frame passes the third level of filtering, see IEEE 802.15.4-2006, Section 7.5.6.2, the radio transceiver automatically generates and transmits an ACK frame. The sequence number is copied from the received frame. The content of the frame pending subfield of the ACK response is set by register bit AACK_SET_PD (register 0x2E, CSMA_SEED_1) when the ACK frame is sent in response to a data request MAC command frame, otherwise this subfield is set to zero. By default, the acknowledgment frame is transmitted aTurnaroundTime (12 symbol periods; see IEEE 802.15.4-2006, Section 6.4.1) after the reception of the last symbol of a data or MAC command frame. Optionally, for non-compliant networks, this delay can be reduced to two symbols by register bit AACK_ACK_TIME (register 0x2E, XAH_CTRL_1). If the register bit AACK_DIS_ACK (register 0x2E, CSMA_SEED_1) is set, no acknowledgement frame is sent even if an acknowledgment frame is requested. This is useful for operating the MAC hardware accelerator in promiscuous mode, see Section 7.2.3.2. For slotted operation, the start of the transmission of acknowledgement frames is controlled by pin 11 (SLP_TR), refer to Section 7.2.3.5. The status of the RX_AACK transaction is indicated by register bits TRAC_STATUS (register 0x02, TRX_STATE), see Section 7.2.7. During the operations described above, the AT86RF212B remains in BUSY_RX_AACK state. 50 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 7-11. Flow Diagram of RX_AACK. TRX_STATE = RX_AACK_ON Detect SHR TRX_STATE = BUSY_RX_AACK Issue IRQ_2 (RX_START) Scan MHR Note 1 (Address match, Promiscuous Mode and Reserved Frames) : - A radio transceiver in promiscuous mode or configured to receive reserved frames handles received frames passing the third level of filtering. - For details, refer to the descritption of Promiscuous Mode and Reserved Frame Types. Address match? Promiscuous Mode N Y Issue IRQ_5 (AMI) Reserved Frames AACK_PROM_MODE == 1 ? N FCF[2:0] >3? Y Y Receive PSDU N Receive PSDU FCS valid || AACK_PROM_MODE ? Receive PSDU N Y Y Issue IRQ_3 (TRX_END) N N FCS valid ? Y ACK requested ? (see Note 2) Note 2: Additional conditions: - ACK requested & - ACK_DIS_ACK == 0 & - frame_version MAX_FRAME_RETRIES Y TRAC_STATUS = NO_ACK Data Pending N Y TRAC_STATUS = SUCCESS_DATA_PENDING TRAC_STATUS = SUCCESS TRAC_STATUS = CHANNEL_ACCESS_FAILURE Issue IRQ_3 (TRX_END) interrupt TRX_STATE = TX_ARET_ON 60 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Overview The implementation of TX_ARET algorithm is shown in Figure 7-14. The TX_ARET Extended Operating Mode supports the frame transmission process as defined by IEEE 802.15.4-2006. It is invoked as described in Section 7.2.1 by writing TX_ARET_ON to register subfield TRX_CMD (register 0x02, TRX_STATE). If a transmission is initiated in TX_ARET mode, the Atmel AT86RF212B executes the CSMA-CA algorithm as defined by IEEE 802.15.4-2006, Section 7.5.1.4. If the CCA reports IDLE, the frame is transmitted from the Frame Buffer. If an acknowledgement frame is requested, the radio transceiver checks for an ACK reply automatically. The CSMA-CA based transmission process is repeated until a valid acknowledgement is received or the number of frame retransmissions MAX_FRAME_RETRIES (register 0x2C, XAH_CTRL_0) is exceeded. The completion of the TX_ARET transaction is indicated by the IRQ_3 (TRX_END) interrupt, see Section 7.2.5. Description Prior to invoking AT86RF212B TX_ARET mode, the basic configuration steps as described in Section 7.2.2 shall be executed. It is further recommended to write the PSDU transmit data to the Frame Buffer in advance. The transmit start event may either come from a rising edge on pin 11 (SLP_TR), refer to Section 6.6, or by writing a TX_START command to register bits TRX_CMD (register 0x02, TRX_STATE). If the CSMA-CA detects a busy channel, it is retried as specified by the register bits MAX_CSMA_RETRIES (register 0x2C, XAH_CTRL_0). In case that CSMA-CA does not detect a clear channel after MAX_CSMA_RETRIES, it aborts the TX_ARET transaction, issues interrupt IRQ_3 (TRX_END), and sets the value of the register bits TRAC_STATUS to CHANNEL_ACCESS_FAILURE. During transmission of a frame the radio transceiver parses bit[5] (ACK Request) of the MAC header (MHR) frame control field of the PSDU data (PSDU octet #1) to be transmitted to check if an ACK reply is expected. If no ACK is expected, the radio transceiver issues IRQ_3 (TRX_END) directly after the frame transmission has been completed. The register bits TRAC_STATUS (register 0x02, TRX_STATE) are set to SUCCESS. If an ACK is expected, after transmission the radio transceiver automatically switches to receive mode waiting for a valid ACK reply (that is matching sequence number and correct FCS). After receiving a valid ACK frame, the “Frame Pending” subfield of this frame is parsed and the status register bits TRAC_STATUS are updated to SUCCESS or SUCCESS_DATA_PENDING accordingly, refer to Table 7-13. At the same time, the entire TX_ARET transaction is terminated and interrupt IRQ_3 (TRX_END) is issued. If no valid ACK is received within the timeout period (refer to Section 7.2.4.1), the radio transceiver retries the entire transaction (CSMA-CA based frame transmission) until the maximum number of frame retransmissions is exceeded, see register bits MAX_FRAME_RETRIES (register 0x2C, XAH_CTRL_0). In that case, the TRAC_STATUS is set to NO_ACK, the TX_ARET transaction is terminated, and interrupt IRQ_3 (TRX_END) is issued. 61 42002E–MCU Wireless–02/2015 Note: 1. The acknowledgment receive procedure does not overwrite the Frame Buffer content. Transmit data in the Frame Buffer is not modified during the entire TX_ARET transaction. Received frames, other than the expected ACK frame, are discarded automatically. After that, the microcontroller may read the value of the register bits TRAC_STATUS (register 0x02, TRX_STATE) to verify whether the transaction was successful or not. The register bits are set according to the following cases, additional exit codes are described in Section 7.2.6. Table 7-13 summarizes the Extended Operating Mode result codes in register subfield TRAC_STATUS (register 0x02, TRX_STATE) with respect to the TX_ARET transaction. Values are meaningful after an interrupt until the next frame transmit. Table 7-13. Interpretation of TRAC_STATUS Register Bits. Value Name Description 0 SUCCESS The transaction was responded to by a valid ACK, or, if no ACK is requested, after a successful frame transmission. 1 SUCCESS_DATA_PENDING Equivalent to SUCCESS and indicating that the “Frame Pending” bit (see Section 8.1.2.2) of the received acknowledgment frame was set. 3 CHANNEL_ACCESS_FAILURE Channel is still busy after attempting MAX_CSMA_RETRIES of CSMA-CA. 5 NO_ACK No acknowledgement frame was received during all retry attempts. 7 INVALID A value of MAX_CSMA_RETRIES = 7 initiates an immediate TX_ARET transaction without performing CSMA-CA. This can be used for example to transmit indirect data to a device. Further the value MAX_FRAME_RETRIES is ignored and the TX_ARET transaction is performed only once. 7.2.4.1 Acknowledgment Timeout If an acknowledgment (ACK) frame is expected following the frame transmission, the Atmel AT86RF212B sets a timeout for the ACK frame to arrive. This timeout macAckWaitDuration is defined according to [2] as follows: macAckWaitDuration [symbol periods] = aUnitBackoffPeriod + aTurnaroundTime + phySHRDuration + 6 x phySymbolsPerOctet where six represents the number of PHY header octets plus the number of PSDU octets in an acknowledgment frame. Specifically for the implemented PHY Modes (see Section 9.1), this formula results in the following values: • BPSK: macAckWaitDuration = 120 symbol periods • O-QPSK: macAckWaitDuration = 54 symbol periods Note: 62 AT86RF212B 1. For any PHY Mode the unit “symbol period” refers to the symbol duration of the appropriate synchronization header; see Section 9.1.3 for further information regarding symbol period. 42002E–MCU Wireless–02/2015 AT86RF212B 7.2.4.2 Timing A timing example of a TX_ARET transaction is shown in Figure 7-15. In the example shown, a data frame with an acknowledgment request is to be transmitted. The frame transmission is started by sending a pulse on pin 11 (SLP_TR). By setting register bits MIN_BE (register 0x2F, CSMA_BE) to zero, the initial CSMA-CA backoff period is configured to zero length. Thus, the CSMA-CA duration time tCSMA-CA consists only of eight symbols of CCA measurement period. If CCA returns IDLE (assumed here), the frame is transmitted. Upon frame transmission Atmel AT86RF212B switches to the receive mode and expects an acknowledgement response. This is indicated by register subfield TRAC_STATUS (register 0x02, TRX_STATE) set to SUCCESS_WAIT_FOR_ACK. After a period of aTurnaroundTime + aUnitBackoff, the transmission of the ACK frame must be started. During the entire transaction, including frame transmit, wait for ACK, and ACK receive, the radio transceiver status register bits TRX_STATUS (register 0x01, TRX_STATUS) are set to BUSY_TX_ARET state. A successful reception of the acknowledgment frame is indicated by triggering of IRQ_3 (TRX_END). The status register bits TRX_STATUS (register 0x01, TRX_STATUS) changes back to TX_ARET_ON state. When the frame pending subfield of the received ACK frame is set to one (more data is to follow) register bits TRAC_STATUS (register 0x02, TRX_STATE) are set either to SUCCESS_DATA_PENDING status instead of SUCCESS status. Figure 7-15. Timing Example of a TX_ARET Transaction (without Pending Data Bit set in ACK Frame). Frame Type Data Frame (ACK=1) Frame on Air Time ACK Frame ACK start timeout 20 symbols State TX_ARET_ON RX/TX BUSY_TX_ARET RX RX TX CSMA-CA TX_ARET_ON 32 μs SLP_TR IRQ TRX_END tCSMA-CA (8 symbols) Typ. Delays TRAC_STATUS 16 μs SUCC. / INVALID Register settings: 0x2C: MAX_FRAME_RETRIES = 0 aTurnaroundTime (12 symbols) tIRQ INVALID 0x2C: MAX_CSMA_RETRIES = 0 SUCCESS 0x2E: MIN_BE = 0 63 42002E–MCU Wireless–02/2015 7.2.5 Interrupt Handling The Atmel AT86RF212B interrupt handling in the Extended Operating Mode is similar to the Basic Operating Mode, refer to Section 7.1.3. Interrupts can be enabled by setting the appropriate bit in register 0x0E (IRQ_MASK). For RX_AACK and TX_ARET modes the following interrupts inform about the status of a frame reception and transmission: Table 7-14. Interrupt Handling in Extended Operating Mode. Mode Interrupt Description RX_AACK IRQ_2 (RX_START) Indicates a PHR reception IRQ_5 (AMI) Issued at address match IRQ_3 (TRX_END) Signals completion of RX_AACK transaction if successful - A received frame must pass the address filter - The FCS is valid TX_ARET IRQ_3 (TRX_END) Signals completion of TX_ARET transaction RX_AACK/ TX_ARET IRQ_0 (PLL_LOCK) Entering RX_AACK_ON or TX_ARET_ON state from TRX_OFF state, the PLL_LOCK interrupt signals that the transaction can be started RX_AACK For support of the RX_AACK functionality, it is recommended to enable IRQ_3 (TRX_END). This interrupt is issued only if frames pass the frame filtering, refer to Section 8.2, and have a valid FCS to reflect data validity. This functionality differs in Basic Operating Mode, refer to Section 7.1.3. The usage of other interrupts is optional. On reception of a valid PHR an IRQ_2 (RX_START) is issued. IRQ_5 (AMI) indicates address match, refer to filter rules in Section 8.2, and the completion of a frame reception with a valid FCS is indicated by interrupt IRQ_3 (TRX_END). Thus, it can happen that an IRQ_2 (RX_START) and/or IRQ_5 (AMI) are issued, but the IRQ_3 (TRX_END) interrupt is never triggered when a frame does not pass the FCS computation check. TX_ARET The IRQ_3 (TRX_END) interrupt is always generated after completing a TX_ARET transaction. Subsequently the transaction status can be read from register bits TRAC_STATUS (register 0x02, TRX_STATE). Several interrupts are automatically suppressed by the radio transceiver during TX_ARET transaction. In contrast to Section 8.6, the CCA algorithm (part of CSMA-CA) does not generate interrupt IRQ_4 (CCA_ED_DONE). Furthermore, the interrupts IRQ_2 (RX_START) and/or IRQ_5 (AMI) are not generated during the TX_ARET acknowledgment receive process. All other interrupts as described in Section 6.7, are also available in Extended Operating Mode. 64 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 7.2.6 Register Summary The following Atmel AT86RF212B registers are to be configured to control the Extended Operating Mode: Table 7-15. Register Summary. Reg.-Addr. Register Name Description 0x01 TRX_STATUS Radio transceiver status, CCA result 0x02 TRX_STATE Radio transceiver state control, TX_ARET status 0x04 TRX_CTRL_1 TX_AUTO_CRC_ON 0x08 PHY_CC_CCA CCA mode control, see Section 8.6.6 0x09 CCA_THRES CCA ED threshold settings, see Section 8.6.6 0x17 XAH_CTRL_1 TX_ARET and RX_AACK control 0x20 – 0x2B Frame Filter configuration - Short address, PAN ID, and IEEE address - See Section 8.2.3 and Section 8.2.4 0x2C XAH_CTRL_0 TX_ARET control, retries value control 0x2D CSMA_SEED_0 CSMA-CA seed value 0x2E CSMA_SEED_1 CSMA-CA seed value, RX_AACK control 0x2F CSMA_BE CSMA-CA backoff exponent control 7.2.7 Register Description Register 0x01 (TRX_STATUS): The read-only register TRX_STATUS signals the present state of the radio transceiver as well as the status of a CCA operation. Figure 7-16. Register TRX_STATUS. Bit 7 6 5 4 CCA_DONE CCA_STATUS reserved TRX_STATUS Read/Write Reset value R 0 R 0 R 0 R 0 Bit 3 2 1 0 R 0 R 0 0x01 0x01 Read/Write Reset value TRX_STATUS R 0 R 0 TRX_STATUS TRX_STATUS • Bit 4:0 - TRX_STATUS The register bits TRX_STATUS signal the current radio transceiver status. Table 7-16. TRX_STATUS. Register Bits Value Description TRX_STATUS 0x00 P_ON 0x01 BUSY_RX 0x02 BUSY_TX 0x06 RX_ON 0x08 TRX_OFF (CLK Mode) 65 42002E–MCU Wireless–02/2015 Register Bits Value Description 0x09 PLL_ON (TX_ON) (1) SLEEP 0x11 (2) BUSY_RX_AACK 0x12 (2) BUSY_TX_ARET 0x16 (2) RX_AACK_ON 0x19 (2) TX_ARET_ON 0x0F 0x1C RX_ON_NOCLK (2) RX_AACK_ON_NOCLK (2) BUSY_RX_AACK_NOCLK (3) STATE_TRANSITION_IN_PROGRESS 0x1D 0x1E 0x1F All other values are reserved Notes: 1. In SLEEP state register not accessible. 2. Extended Operating Mode only. 3. Do not try to initiate a further state change while the radio transceiver is in STATE_TRANSITION_IN_PROGRESS state. A read access to TRX_STATUS register signals the current radio transceiver state status. A state change is initiated by writing a state transition command to register bits TRX_CMD (register 0x02, TRX_STATE). Alternatively, some state transitions can be initiated by the rising edge of pin 11 (SLP_TR) in the appropriate state. Register 0x02 (TRX_STATE): The radio transceiver states are advanced via register TRX_STATE by writing a command word into register bits TRX_CMD. The read-only register bits TRAC_STATUS indicate the status or result of an Extended Operating Mode transaction. Figure 7-17. Register TRX_STATE. Bit 7 0x02 6 Read/Write Reset value R 0 R 0 Bit 3 2 0x02 Read/Write Reset value 66 AT86RF212B 5 TRAC_STATUS 4 TRX_CMD R 0 R/W 0 1 0 R/W 0 R/W 0 TRX_CMD R/W 0 R/W 0 TRX_STATE TRX_STATE 42002E–MCU Wireless–02/2015 AT86RF212B • Bit 7:5 – TRAC_STATUS Table 7-17. TRAC_STATUS. Register Bits Value TRAC_STATUS Description RX_AACK TX_ARET X X (1) SUCCESS 1 SUCCESS_DATA_PENDING 2 SUCCESS_WAIT_FOR_ACK 3 CHANNEL_ACCESS_FAILURE X 5 NO_ACK X (1) INVALID 0 7 X X X X All other values are reserved Note: 1. Even though the reset value for register bits TRAC_STATUS is zero, the RX_AACK and TX_ARET procedures set the register bits to TRAC_STATUS = 7 (INVALID) when they are started. The status of the RX_AACK and TX_ARET procedures is indicated by register bits TRAC_STATUS. Values are meaningful after an interrupt until the next frame transmit. Details of the algorithms and a description of the status information are given in Section 7.2.3 and Section 7.2.4. RX_AACK SUCCESS_WAIT_FOR_ACK: Indicates an ACK frame is about to be sent in RX_AACK slotted acknowledgement. Slotted acknowledgement operation must be enabled with register bit SLOTTED_OPERATION (register 0x2C, XAH_XTRL_0). The microcontroller must pulse pin 11 (SLP_TR) at the next backoff slot boundary in order to initiate a transmission of the ACK frame. For details refer to IEEE 802.15.4-2006, Section 7.5.6.4.2. TX_ARET SUCCESS_DATA_PENDING: Indicates a successful reception of an ACK frame with frame pending bit set to one. • Bit 4:0 - TRX_CMD A write access to register bits TRX_CMD initiate a radio transceiver state transition to the new state. Table 7-18. TRX_CMD. Register Bits TRX_CMD Value Description 0x00 (1) NOP 0x02 (2) TX_START 0x03 0x04 (3) FORCE_TRX_OFF FORCE_PLL_ON 0x06 RX_ON 0x08 TRX_OFF (CLK Mode) 67 42002E–MCU Wireless–02/2015 Register Bits Value Description 0x09 PLL_ON (TX_ON) 0x16 (4) RX_AACK_ON 0x19 (4) TX_ARET_ON All other values are reserved Notes: 1. TRX_CMD = “0” after power on reset (POR). 2. The frame transmission starts one symbol after TX_START command. 3. FORCE_PLL_ON command is not valid in states P_ON, SLEEP, RESET, and all *_NOCLK states, as well as STATE_TRANSITION_IN_PROGRES towards these states. 4. Extended Operating Mode only. A successful state transition shall be confirmed by reading register bits TRX_STATUS (register 0x01, TRX_STATUS). The register bits TRX_CMD are used for Basic and Extended Operating Modes, refer to Section 7.1. Register 0x04 (TRX_CTRL_1): The TRX_CTRL_1 register is a multi-purpose register to control various operating modes and settings of the radio transceiver. Figure 7-18. Register TRX_CTRL_1. Bit 7 0x04 Read/Write Reset value Bit 0x04 6 5 4 PA_EXT_EN IRQ_2_EXT_EN TX_AUTO_CRC_ ON RX_BL_CTRL R/W 0 R/W 0 R/W 1 R/W 0 3 2 SPI_CMD_MODE Read/Write Reset value R/W 0 1 0 IRQ_MASK_MODE IRQ_POLARITY R/W 0 R/W 0 R/W 0 TRX_CTRL_1 TRX_CTRL_1 • Bit 5 - TX_AUTO_CRC_ON The register bit TX_AUTO_CRC_ON controls the automatic FCS generation for transmit operations. Table 7-19. TX_AUTO_CRC_ON. Register Bits TX_AUTO_CRC_ON Note: 1. Value Description 0 Automatic FCS generation is disabled 1 Automatic FCS generation is enabled The TX_AUTO_CRC_ON function can be used within Basic and Extended Operating Modes. For further details refer to Section 8.3. 68 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Register 0x17 (XAH_CTRL_1): The XAH_CTRL_1 register is a multi-purpose control register for Extended Operating Mode. Figure 7-19. Register XAH_CTRL_1. Bit 7 0x17 reserved Read/Write Reset value Bit 0x17 Read/Write Reset value 6 5 4 AACK_FLTR_RES_ AACK_UPLD_RES_ CSMA_LBT_MODE FT FT R/W 0 R/W 0 R/W 0 R/W 0 3 2 1 0 reserved AACK_ACK_TIME AACK_PROM_ MODE reserved R 0 R/W 0 R/W 0 R 0 XAH_CTRL_1 XAH_CTRL_1 • Bit 5 - AACK_FLTR_RES_FT Filter reserved frame types like data frame type. The register bit AACK_FLTR_RES_FT shall only be set if register bit AACK_UPLD_RES_FT = 1. Table 7-20. AACK_FLTR_RES_FT. Register Bits AACK_FLTR_RES_FT Value Description 0 (1) Filtering reserved frame types is disabled 1 (2) Filtering reserved frame types is enabled Notes: 1. If AACK_FLTR_RES_FT = 0 the received reserved frame is only checked for a valid FCS. 2. If AACK_FLTR_RES_FT = 1 reserved frame types are filtered similar to data frames as specified in IEEE 802.15.4–2006. Reserved frame types are explained in IEEE 802.15.4 Section 7.2.1.1.1. • Bit 4 - AACK_UPLD_RES_FT Upload reserved frame types within RX_AACK mode. Table 7-21. AACK_UPLD_RES_FT. Register Bits AACK_UPLD_RES_FT Value 0 Upload of reserved frame types is disabled (1) Upload of reserved frame types is enabled 1 Note: 1. Description If AACK_UPLD_RES_FT = 1 received frames indicated as a reserved frame are further processed. For those frames, an IRQ_3 (TRX_END) interrupt is generated if the FCS is valid. In conjunction with the configuration bit AACK_FLTR_RES_FT, these frames are handled like IEEE 802.15.4 compliant data frames during RX_AACK transaction. An IRQ_5 (AMI) interrupt is issued, if the addresses in the received frame match the node’s addresses. That means, if a reserved frame passes the third level filter rules, an acknowledgement frame is generated and transmitted if it was requested by the received frame. If this is not wanted register bit AACK_DIS_ACK (register 0x2E, CSMA_SEED_1) has to be set. 69 42002E–MCU Wireless–02/2015 • Bit 2 - AACK_ACK_TIME The register bit AACK_ACK_TIME controls the acknowledgment frame response time within RX_AACK mode. Table 7-22. AACK_ACK_TIME. Register Bits AACK_ACK_TIME Value Description 0 Acknowledgment time is 12 symbol periods (aTurnaroundTime) 1 Two symbol periods: BPSK-20, OQPSK-{100,200,400}; Three symbol periods: BPSK-40, OQPSK-{250,500,1000} According to IEEE 802.15.4-2006, Section 7.5.6.4.2 the transmission of an acknowledgment frame shall commence 12 symbol periods (aTurnaroundTime) after the reception of the last symbol of a data or MAC command frame. This is achieved with the reset value of the register bit AACK_ACK_TIME. Alternatively, if AACK_ACK_TIME = 1, the acknowledgment response time is reduced according to Table 7-23. Table 7-23. Short ACK Response Time (AACK_ACK_TIME = 1). PHY Mode ACK response time [symbol periods] BPSK-20, OQPSK-{100,200,400} 2 BPSK-40, OQPSK-{250,500,1000} 3 The reduced ACK response time is particularly useful for the High Data Rate Modes, refer to Section 9.1.4. • Bit 1 - AACK_PROM_MODE The register bit AACK_PROM_MODE enables the promiscuous mode, within the RX_AACK mode. Table 7-24. AACK_PROM_MODE. Register Bits AACK_PROM_MODE Value Description 0 Promiscuous mode is disabled 1 Promiscuous mode is enabled Refer to IEEE 802.15.4-2006 Section 7.5.6.5. If this register bit is set, every incoming frame with a valid PHR finishes with IRQ_3 (TRX_END) interrupt even if the third level filter rules do not match or the FCS is not valid. However, register bit RX_CRC_VALID (register 0x06, PHY_RSSI) is set accordingly. In contrast to IEEE 802.15.4-2006, if a frame passes the third level filter rules, an acknowledgement frame is generated and transmitted unless disabled by register bit AACK_DIS_ACK (register 0x2E, CSMA_SEED_1), or use Basic Operating Mode instead. 70 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Register 0x2C (XAH_CTRL_0): The XAH_CTRL_0 register is a control register for Extended Operating Mode. Figure 7-20. Register XAH_CTRL_0. Bit 7 6 0x2C 5 4 MAX_FRAME_RETRIES Read/Write Reset value Bit R/W 0 R/W 0 R/W 1 3 2 1 0x2C R/W 1 R/W 0 0 SLOTTED_ OPERATION MAX_CSMA_RETRIES Read/Write Reset value XAH_CTRL_0 R/W 1 R/W 0 XAH_CTRL_0 R/W 0 • Bit 7:4 - MAX_FRAME_RETRIES Number of retransmission attempts in TX_ARET mode before the transaction gets cancelled. Table 7-25. MAX_FRAME_RETRIES. Register Bits MAX_FRAME_RETRIES Value 0x3 Description The setting of MAX_FRAME_RETRIES in TX_ARET mode specifies the number of attempts to retransmit a frame, when it was not acknowledged by the recipient, before the transaction gets cancelled. Valid values are [0x7, 0x6, …, 0x0]. • Bit 3:1 - MAX_CSMA_RETRIES Number of retries in TX_ARET mode to repeat the CSMA-CA procedure before the transaction gets cancelled. Table 7-26. MAX_CSMA_RETRIES. Register Bits MAX_CSMA_RETRIES Notes: 1. Value Description 0 (1) No retries 1 (1) One retry 2 (1) Two retries 3 (1) Three retries 4 (1) Four retries 5 (1) Five retries 7 (3) Immediate frame transmission without performing CSMACA MAX_CSMA_RETRIES specifies the number of retries in TX_ARET mode to repeat the CSMA-CA procedure before the transaction gets cancelled. According to IEEE 802.15.4 the valid range of MAX_CSMA_RETRIES is [5, 4, …, 0]. 2. MAX_CSMA_RETRIES = 6 is reserved. 3. A value of MAX_CSMA_RETRIES = 7 initiates an immediate frame transmission without performing CSMA-CA. No retry is performed. This may especially be required for slotted acknowledgement operation. 71 42002E–MCU Wireless–02/2015 • Bit 0 - SLOTTED_OPERATION For RX_AACK mode, the register bit SLOTTED_OPERATION determines, if the transceiver will require a time base for slotted operation. Table 7-27. SLOTTED_OPERATION. Register Bits SLOTTED_OPERATION Value Description 0 The radio transceiver operates in unslotted mode. An acknowledgment frame is automatically sent if requested. 1 The transmission of an acknowledgement frame has to be controlled by the microcontroller. Using RX_AACK mode in networks operating in beacon or slotted mode, refer to IEEE 802.15.4-2006, Section 5.5.1, register bit SLOTTED_OPERATION indicates that acknowledgement frames are to be sent on backoff slot boundaries (slotted acknowledgement), refer to Section 7.2.3.5. If this register bit is set the acknowledgement frame transmission has to be initiated by the microcontroller using the rising edge of pin 11 (SLP_TR). This waiting state is signaled in register bits TRAC_STATUS (register 0x02, TRX_STATE) with value SUCCESS_WAIT_FOR_ACK. 72 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Register 0x2D (CSMA_SEED_0): The register CSMA_SEED_0 contains the lower 8-bit of CSMA_SEED. Figure 7-21. Register CSMA_SEED_0. Bit 7 6 0x2D 5 4 R/W 1 R/W 0 1 0 R/W 1 R/W 0 CSMA_SEED_0 Read/Write Reset value Bit R/W 1 R/W 1 3 2 0x2D CSMA_SEED_0 CSMA_SEED_0 Read/Write Reset value R/W 1 R/W 0 CSMA_SEED_0 • Bit 7:0 - CSMA_SEED_0 Lower 8-bit of CSMA_SEED, bits[7:0]. Used as seed for random number generation in the CSMA-CA algorithm. Table 7-28. CSMA_SEED_0. Register Bits Value Description CSMA_SEED_0 0xEA This register contains the lower 8-bit of the CSMA_SEED, bits[7:0]. The higher 3-bit are part of register bits CSMA_SEED_1 (register 0x2E, CSMA_SEED_1). CSMA_SEED is the seed for the random number generation that determines the length of the backoff period in the CSMA-CA algorithm. Notes: 1. It is recommended to initialize register bits CSMA_SEED_0 and CSMA_SEED_1 with random values. This can be done using register bits RND_VALUE (register 0x06, PHY_RSSI), refer to Section 11.2. 2. The content of register bits CSMA_SEED_0 and CSMA_SEED_1 initializes the TX_ARET random backoff generator after wakeup from SLEEP state. It is recommended to reinitialize both registers before every SLEEP state with a random value. 73 42002E–MCU Wireless–02/2015 Register 0x2E (CSMA_SEED_1): The CSMA_SEED_1 register is a control register for RX_AACK and contains a part of the CSMA_SEED for the CSMA-CA algorithm. Figure 7-22. Register CSMA_SEED_1. Bit 7 0x2E 6 AACK_FVN_MODE Read/Write Reset value Bit 0x2E 4 AACK_DIS_ACK R/W 0 R/W 1 R/W 0 R/W 0 3 2 1 0 AACK_I_AM_ COORD Read/Write Reset value 5 AACK_SET_PD CSMA_SEED_1 R/W 0 R/W 0 R/W 1 CSMA_SEED_1 CSMA_SEED_1 R/W 0 • Bit 7:6 - AACK_FVN_MODE The register bits AACK_FVN_MODE control the ACK behavior dependent on FCF frame version number within RX_AACK mode. Table 7-29. AACK_FVN_MODE. Register Bits Value AACK_FVN_MODE Note: 1. Description 0 Accept frames with version number 0 1 Accept frames with version number 0 or 1 2 Accept frames with version number 0 or 1 or 2 3 Accept frames independent of frame version number AACK_FVN_MODE value one indicates frames according to IEEE 802.15.4–2006, a value of three indicates frames according to IEEE 802.15.4–2003 standard. The frame control field of the MAC header (MHR) contains a frame version subfield. The setting of register bits AACK_FVN_MODE specifies the frame filtering behavior of the Atmel AT86RF212B. According to the content of these register bits the radio transceiver passes frames with a specific frame version number, number group, or independent of the frame version number. Thus the register bits AACK_FVN_MODE defines the maximum acceptable frame version. Received frames with a higher frame version number than configured do not pass the frame filter and are not acknowledged. The frame version field of the acknowledgment frame is set to zero according to IEEE 802.15.4-2006, Section 7.2.2.3.1 Acknowledgment frame MHR fields. • Bit 5 - AACK_SET_PD The content of AACK_SET_PD bit is copied into the frame pending subfield of the acknowledgment frame if the ACK is the response to a data request MAC command frame. Table 7-30. AACK_SET_PD. Register Bits AACK_SET_PD 74 AT86RF212B Value Description 0 Pending data bit set to zero 1 Pending data bit set to one 42002E–MCU Wireless–02/2015 AT86RF212B In addition, if register bits AACK_FVN_MODE (register 0x2E, CSMA_SEED_1) are configured to accept frames with a frame version other than zero or one, the content of register bit AACK_SET_PD is also copied into the frame pending subfield of the acknowledgment frame for any MAC command frame with a frame version of two or three that have the security enabled subfield set to one. This is done with the assumption that a future version of the IEEE 802.15.4-2006 [2] standard might change the length or structure of the auxiliary security header. • Bit 4 - AACK_DIS_ACK If this bit is set no acknowledgment frames are transmitted in RX_AACK Extended Operating Mode, even if requested. Table 7-31. AACK_DIS_ACK. Register Bits AACK_DIS_ACK Value Description 0 Acknowledgment frames are transmitted 1 Acknowledgment frames are not transmitted • Bit 3 - AACK_I_AM_COORD This register bit has to be set if the node is a PAN coordinator. It is used for frame filtering in RX_AACK. Table 7-32. AACK_I_AM_COORD. Register Bits AACK_I_AM_COORD Value Description 0 PAN coordinator addressing is disabled 1 PAN coordinator addressing is enabled If AACK_I_AM_COORD = 1 and if only source addressing fields are included in a data or MAC command frame, the frame shall be accepted only if the device is the PAN coordinator and the source PAN identifier matches macPANId, for details refer to IEEE 802.15.4-2006, Section 7.5.6.2 (third-level filter rule six). • Bit 2:0 - CSMA_SEED_1 Higher 3-bit of CSMA_SEED, bits[10:8]. Seed for random number generation in the CSMA-CA algorithm. Table 7-33. CSMA_SEED_1. Register Bits CSMA_SEED_1 Value 2 Description These register bits are the higher 3-bit of the CSMA_SEED, bits [10:8]. The lower part is in register 0x2D (CSMA_SEED_0), see register CSMA_SEED_0 for details. 75 42002E–MCU Wireless–02/2015 Register 0x2F (CSMA_BE): The register CSMA_BE contains the backoff exponents for the CSMA-CA algorithm. Figure 7-23. Register CSMA_BE. Bit 7 6 0x2F Read/Write Reset value Bit R/W 0 R/W 1 3 2 0x2F 4 R/W 0 R/W 1 1 0 R/W 1 R/W 1 CSMA_BE MIN_BE Read/Write Reset value Note: 5 MAX_BE 1. R/W 0 R/W 0 CSMA_BE If MIN_BE = 0 and MAX_BE = 0 the CCA backoff period is always set to zero. • Bit 7:4 - MAX_BE Maximum backoff exponent in the CSMA-CA algorithm. Table 7-34. MAX_BE. Register Bits MAX_BE Value 0x5 Description Register bits MAX_BE defines the maximum backoff exponent used in the CSMA-CA algorithm to generate a pseudo random number for CCA backoff. Valid values are [0x8, 0x7, …, 0x0]. For details refer to IEEE 802.15.4-2006, Section 7.5.1.4. • Bit 3:0 - MIN_BE Minimum backoff exponent in the CSMA-CA algorithm. Table 7-35. MIN_BE. Register Bits MIN_BE Value 0x3 Description Register bits MIN_BE defines the minimum backoff exponent used in the CSMA-CA algorithm to generate a pseudo random number for CCA backoff. Valid values are [MAX_BE, (MAX_BE – 1), …, 0x0]. For details refer to IEEE 802.15.4-2006, Section 7.5.1.4. 76 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 8 Functional Description 8.1 Introduction – IEEE 802.15.4-2006 Frame Format Figure 8-1 provides an overview of the physical layer (PHY) frame structure as defined by the IEEE 802.15.4-2006 standard. Figure 8-2 shows the medium access control layer (MAC) frame structure. Figure 8-1. IEEE 802.15.4 Frame Format - PHY-Layer Frame Structure (PPDU). PHY Protocol Data Unit (PPDU) Preamble Sequence SFD Frame Length PHY Payload 5 octets 1 octet Maximum 127 octets Synchronization Header (SHR) (PHR) PHY Service Data Unit (PSDU) MAC Protocol Data Unit (MPDU) 8.1.1 PHY Protocol Data Unit (PPDU) 8.1.1.1 Synchronization Header (SHR) The SHR consists of a four-octet preamble field (all zero), followed by a single byte start-of-frame delimiter (SFD) which has the predefined value 0xA7. During transmission, the SHR is automatically generated by the Atmel AT86RF212B, thus the Frame Buffer shall contain PHR and PSDU only, see Section 6.3.2. The transmission of the SHR requires 40 symbols for a transmission with BPSK modulation and 10 symbols for a transmission with O-QPSK modulation. Table 8-2 illustrates the SHR duration depending on the selected data rate, see also Section 12.5. The fact that the SPI data rate is normally higher than over-the-air data rate, allows the microcontroller to first initiate a frame transmission and then as the SHR is transmitted write the frame data. This is to minimize frame buffer data fill overhead transmission delay. During a frame reception, the SHR is used for synchronization purposes. The matching SFD determines the beginning of the PHR and the following PSDU payload data. 8.1.1.2 PHY Header (PHR) The PHY header is a single octet following the SHR. The least significant seven bits denote the frame length of the following PSDU, while the most significant bit of that octet is reserved, and shall be set to zero for IEEE 802.15.4 compliant frames. On reception, the PHR is returned as the first octet during Frame Buffer read access. While the IEEE 802.15.4-2006 standard declares bit seven of the PHR octet as being reserved, the AT86RF212B preserves this bit upon transmission and reception so it can be used to carry additional information within proprietary networks. Nevertheless, this bit is not considered to be a part of the frame length, so only frames between one and 127 octets are possible. For IEEE 802.15.4 compliant operation bit[7] has to be masked by software. In transmit mode, the PHR needs to be supplied as the first octet during Frame Buffer write access, see Section 6.3.2. 77 42002E–MCU Wireless–02/2015 In receive mode, the PHR (that is frame length greater than zero) is returned as the first octet during Frame Buffer read access (see Section 6.3.2) and is signaled by an interrupt IRQ_2 (RX_START). 8.1.1.3 PHY Payload (PHY Service Data Unit, PSDU) The PSDU has a variable length between zero and aMaxPHYPacketSize (127, maximum PSDU size in octets). The length of the PSDU is signaled by the frame length field (PHR), refer to Table 8-1. The PSDU contains the MAC protocol data unit (MPDU), where the last two octets are used for the Frame Check Sequence (FCS), see Section 8.3. Received frames with a frame length field set to zero (invalid PHR) are not signaled to the microcontroller. Table 8-1 summarizes the type of payload versus the frame length value. Table 8-1. Frame Length Field – PHR. Frame Length Value Payload 0-4 Reserved 5 MPDU (Acknowledgement) 6–8 Reserved 9 - aMaxPHYPacketSize MPDU 8.1.1.4 Timing Summary Table 8-2 shows timing information for the above mentioned frame structure depending on the selected data rate. Table 8-2. PPDU Timing. PHY Mode BPSK (1) O-QPSK O-QPSK Notes: 78 AT86RF212B (1) (2) PSDU Bit Rate [kb/s] Header Bit Rate [kb/s] Duration SHR [µs] PHR [µs] Max. PSDU [ms] 20 20 2000 400 50.8 40 40 1000 200 25.4 100 100 300 80 10.16 250 250 160 32 4.064 200 100 300 80 5.08 400 100 300 80 2.54 500 250 160 32 2.032 1000 250 160 32 1.016 1. Compliant to IEEE 802.15.4-2006 [2]. 2. High Data Rate Modes, see Section 9.1.4. 42002E–MCU Wireless–02/2015 AT86RF212B 8.1.2 MAC Protocol Data Unit (MPDU) Figure 8-2 shows the frame structure of the MAC layer. Figure 8-2. IEEE 802.15.4-2006 Frame Format – MAC Layer Frame Structure (MPDU). MAC Protocol Data Unit (MPDU) Sequence Number FCF Addressing Fields MAC Payload MAC Service Data Unit (MSDU) MAC Header (MHR) Destination PAN ID 0 1 2 Frame Type Destination Source address PAN ID 0/4/6/8/10/12/14/16/18/20 octets 3 4 5 Sec. Enabled Frame Pending ACK Request FCS 6 7 Source address 8 Auxiliary Security Header CRC-16 0/5/6/10/14 octets 2 octets 9 PAN ID Reserved Comp. Frame Control Field 2 octets (MFR) 10 11 Destination addressing mode 12 13 14 Frame Version 15 Source addressing mode 8.1.2.1 MAC Header (MHR) Fields The MAC header consists of the Frame Control Field (FCF), a sequence number, and the addressing fields (which are of variable length, and can even be empty in certain situations). 8.1.2.2 Frame Control Field (FCF) The FCF consists of 16 bits, and occupies the first two octets of the MPDU or PSDU, respectively. Figure 8-3. IEEE 802.15.4-2006 Frame Control Field (FCF). 0 1 2 Frame Type 3 4 5 6 Sec. Enabled Frame Pending ACK Request PAN ID Comp. 7 8 9 Reserved 10 11 Destination addressing mode 12 13 Frame Version 14 15 Source addressing mode Frame Control Field 2 octets Bits [2:0]: describes the “Frame Type“. Table 8-3 summarizes frame types defined by IEEE 802.15.4-2006 [2], Section 7.2.1.1.1. Table 8-3. Frame Control Field – Frame Type Subfield. Frame Control Field Bit Assignments Description Frame Type Value b2 b1 b0 Value 000 0 Beacon 001 1 Data 010 2 Acknowledge 011 3 MAC command 100 – 111 4–7 Reserved 79 42002E–MCU Wireless–02/2015 This subfield is used for frame filtering by the third level filter rules. By default, only frame types 0 – 3 pass the third level filter rules, refer to Section 8.2. Automatic frame filtering by the Atmel AT86RF212B is enabled when using the RX_AACK mode, refer to Section 7.2.3. However, a reserved frame (frame type value > 3) can be received if register bit AACK_UPLD_RES_FT (register 0x17, XAH_CTRL_1) is set, for details refer to Section 7.2.3.3. Frame filtering is also provided in Basic Operating Mode, refer to Section 7.1. Bit 3: indicates whether security processing applies to this frame. This field is evaluated by the Frame Filter. Bit 4: is the “Frame Pending” subfield. This field can be set in an acknowledgment frame (ACK) in response to a data request MAC command frame. This bit indicates that the node, which transmitted the ACK, might have more data to send to the node receiving the ACK. Note: 1. For acknowledgment frames automatically generated by the AT86RF212B, this bit is set according to the content of register bit AACK_SET_PD in register 0x2E (CSMA_SEED_1) if the received frame was a data request MAC command frame. Bit 5: forms the “Acknowledgment Request” subfield. If this bit is set within a data or MAC command frame that is not broadcast, the recipient shall acknowledge the reception of the frame within the time specified by IEEE 802.15.4, that is within 12 symbol periods for nonbeacon-enabled networks. The radio transceiver parses this bit during RX_AACK mode and transmits an acknowledgment frame if necessary. In TX_ARET mode this bit indicates if an acknowledgement frame is expected after transmitting a frame. If this is the case, the receiver waits for the acknowledgment frame, otherwise the TX_ARET transaction is finished. Bit 6: the “PAN ID Compression” subfield, indicates that in a frame where both the destination and source addresses are present, the PAN ID is omitted from the source addressing field. This bit is evaluated by the Frame Filter of the Atmel AT86RF212B. This subfield was previously named “Intra-PAN”. Bits [11:10]: the “Destination Addressing Mode” subfield describes the format of the destination address of the frame. The values of the address modes are summarized in Table 8-4, according to IEEE 802.15.4. Table 8-4. Frame Control Field – Destination and Source Addressing Mode. Frame Control Field Bit Assignments 80 AT86RF212B Description Addressing Mode b11 b10 b15 b14 Value 00 0 PAN identifier and address fields are not present 01 1 Reserved 10 2 Address field contains a 16-bit short address 11 3 Address field contains a 64-bit extended address 42002E–MCU Wireless–02/2015 AT86RF212B If the destination address mode is either two or three (that is if the destination address is present), it always consists of a 16-bit PAN-ID first, followed by either the 16-bit or 64-bit address as described by the mode. Bits [13:12]: the “Frame Version” subfield specifies the version number corresponding to the frame, see Table 8-5. These bits are reserved in IEEE 802.15.4-2003. This subfield shall be set to zero to indicate a frame compatible with IEEE 802.15.4-2003 and one to indicate an IEEE 802.15.4-2006 frame All other subfield values shall be reserved for future use. RX_AACK register bits AACK_FVN_MODE (register 0x2E, CSMA_SEED_1) controls the behavior of frame acknowledgements. This register determines if, depending on the Frame Version Number, a frame is acknowledged or not. This is necessary for backward compatibility to IEEE 802.15.4-2003 and for future use. Even if frame version numbers two and three are reserved, it can be handled by the radio transceiver, for details refer to Section 7.2.7. See IEEE 802.15.4-2006 [2], Section 7.2.3, for details on frame compatibility. Table 8-5. Frame Control Field – Frame Version Subfield. Frame Control Field Bit Assignments Description Frame Version b13 b12 Value 00 0 Frames are compatible with IEEE 802.15.4-2003 01 1 Frames are compatible with IEEE 802.15.4-2006 10 2 Reserved 11 3 Reserved Bits [15:14]: the “Source Addressing Mode” subfield, with similar meaning as “Destination Addressing Mode”, see Table 8-4. The addressing field description bits of the FCF (Bits 0–2, 3, 6, 10–15) affect the Atmel AT86RF212B Frame Filter, see Section 8.2. 8.1.2.3 Frame Compatibility between IEEE 802.15.4-2003 and IEEE 802.15.4-2006 All unsecured frames according to IEEE 802.15.4-2006 are compatible with unsecured frames compliant with IEEE 802.15.4-2003 with two exceptions: a coordinator realignment command frame with the “Channel Page” field present (see IEEE 802.15.4-2006 [2], Section 7.3.8) and any frame with a MAC Payload field larger than aMaxMACSafePayloadSize octets. Compatibility for secured frames is shown in Table 8-6, which identifies the security operating modes for IEEE 802.15.4-2003 and IEEE 802.15.4-2006. 81 42002E–MCU Wireless–02/2015 Table 8-6. Frame Control Field – Security and Frame Version. Frame Control Field Bit Assignments Description Security Enabled b3 Frame Version b13 b12 0 00 No security. Frames are compatible between IEEE 802.15.4-2003 and IEEE 802.15.4-2006. 0 01 No security. Frames are not compatible between IEEE 802.15.4-2003 and IEEE 802.15.4-2006. 1 00 Secured frame formatted according to IEEE 802.15.4-2003. This frame type is not supported in IEEE 802.15.4-2006. 1 01 Secured frame formatted according to IEEE 802.15.4-2006. 8.1.2.4 Sequence Number The one-octet sequence number following the FCF identifies a particular frame, so that duplicated frame transmissions can be detected. While operating in RX_AACK mode, the content of this field is copied from the frame to be acknowledged into the acknowledgment frame. 8.1.2.5 Addressing Fields The addressing fields of the MPDU are used by the Atmel AT86RF212B for address matching indication. The destination address (if present) is always first, followed by the source address (if present). Each address field consists of the PAN-ID and a device address. If both addresses are present, and the “PAN ID compression” subfield in the FCF is set to one, the source PAN-ID is omitted. Note that in addition to these general rules, IEEE 802.15.4 further restricts the valid address combinations for the individual possible MAC frame types. For example, the situation where both addresses are omitted (source addressing mode = 0 and destination addressing mode = 0) is only allowed for acknowledgment frames. The address filter in the AT86RF212B has been designed to apply to IEEE 802.15.4 compliant frames. It can be configured to handle other frame formats and exceptions. 8.1.2.6 Auxiliary Security Header Field The Auxiliary Security Header specifies information required for security processing and has a variable length. This field determines how the frame is actually protected (security level) and which keying material from the MAC security PIB is used (see IEEE 802.15.4-2006 [2], Section 7.6.1). This field shall be present only if the Security Enabled subfield b3, see Section 8.1.2.3, is set to one. For details of its structure, see IEEE 802.15.4-2006, Section 7.6.2 Auxiliary security header. 8.1.2.7 MAC Service Data Unit (MSDU) This is the actual MAC payload. It is usually structured according to the individual frame type. A description can be found in IEEE 802.15.4-2006, Section 5.5.3.2. 8.1.2.8 MAC Footer (MFR) Fields The MAC footer consists of a two octet Frame Checksum (FCS), for details refer to Section 8.3. 82 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 8.2 Frame Filter Frame Filtering is a procedure that evaluates whether or not a received frame matches predefined criteria, like source or destination address or frame types. A filtering procedure as described in IEEE 802.15.4-2006 Section 7.5.6.2 (Third level of filtering) is applied to the frame to accept a received frame and to generate the address match interrupt IRQ_5 (AMI). The Atmel AT86RF212B Frame Filter passes only frames that satisfy all of the following requirements/rules (quote from IEEE 802.15.4-2006, Section 7.5.6.2): 1. The Frame Type subfield shall not contain a reserved frame type. 2. The Frame Version subfield shall not contain a reserved value. 3. If a destination PAN identifier is included in the frame, it shall match macPANId or shall be the broadcast PAN identifier (0xFFFF). 4. If a short destination address is included in the frame, it shall match either macShortAddress or the broadcast address (0xFFFF). Otherwise, if an extended destination address is included in the frame, it shall match aExtendedAddress. 5. If the frame type indicates that the frame is a beacon frame, the source PAN identifier shall match macPANId unless macPANId is equal to 0xFFFF, in which case the beacon frame shall be accepted regardless of the source PAN identifier. 6. If only source addressing fields are included in a data or MAC command frame, the frame shall be accepted only if the device is the PAN coordinator and the source PAN identifier matches macPANId. Moreover the AT86RF212B has two additional requirements: 7. The frame type shall indicate that the frame is not an acknowledgment (ACK) frame. 8. At least one address field must be present. Address match, indicated by interrupt IRQ_5 (AMI), is further controlled by the content of subfields of the frame control field of a received frame according to the following rule: If Destination Addressing Mode is 0/1 and Source Addressing Mode is zero (see Section 8.1.2.2), no interrupt IRQ_5 (AMI) is generated. This effectively causes all acknowledgement frames not to be announced, which would otherwise always pass the filter, regardless of whether they are intended for this device or not. For backward compatibility to IEEE 802.15.4-2003 third level filter rule two (Frame Version) can be disabled by register bits AACK_FVN_MODE (register 0x2E, CSMA_SEED_1). Frame filtering is available in Extended and Basic Operating Mode. A frame that passes the Frame Filter generates the interrupt IRQ_5 (AMI) if not masked. Notes: 1. Filter rule one is affected by register bits AACK_FLTR_RES_FT and AACK_UPLD_RES_FT, Section 8.2.3. 2. Filter rule two is affected by register bits AACK_FVN_MODE, Section 8.2.3. 83 42002E–MCU Wireless–02/2015 8.2.1 Configuration The Frame Filter is configured by setting the appropriate address variables and several additional properties as described in Table 8-7. Table 8-7. Frame Filter Configuration. Register Address Register Bits 0x20,0x21 0x22,0x23 0x24 … 0x2B Register Name Description SHORT_ADDR_0/1 PAN_ADDR_0/1 IEEE_ADDR_0 … IEEE_ADDR_7 Set macShortAddress, macPANId , and aExtendedAddress as described in [2]. 0x17 1 AACK_PROM_MODE 0: Disable promiscuous mode. 1: Enable promiscuous mode. 0x17 4 AACK_UPLD_RES_FT Enable reserved frame type reception, needed to receive non-standard compliant frames, see Section 8.2.2. 0: Disable reserved frame type reception. 1: Enable reserved frame type reception. 0x17 5 AACK_FLTR_RES_FT Filter reserved frame types like data frame type, needed for filtering of non-standard compliant frames. 0: Disable reserved frame types filtering. 1: Enable reserved frame types filtering. 0x2E 3 AACK_I_AM_COORD 0: Device is not PAN coordinator. 1: Device is PAN coordinator. 0x2E 7:6 AACK_FVN_MODE Controls the ACK behavior, depending on FCF frame version number. b00: Acknowledges only frames with version number 0, that is according to IEEE 802.15.4-2003 frames. b01: Acknowledges only frames with version number 0 or 1, that is frames according to IEEE 802.15.4-2006. b10: Acknowledges only frames with version number 0 or 1 or 2. b11: Acknowledges all frames, independent of the FCF frame version number. 8.2.2 Handling of Reserved Frame Types Reserved frame types (as described in Section 7.2.3.3) are treated according to bits AACK_UPLD_RES_FT and AACK_FLTR_RES_FT of register 0x17 (XAH_CTRL_1) with three options: 1. AACK_UPLD_RES_FT = 1, AACK_FLT_RES_FT = 0: Any non-corrupted frame with a reserved frame type is indicated by an IRQ_3 (TRX_END) interrupt. No further address filtering is applied on those frames. An IRQ_5 (AMI) interrupt is never generated and the acknowledgment subfield is ignored. 84 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 2. AACK_UPLD_RES_FT = 1, AACK_FLT_RES_FT = 1: If AACK_FLT_RES_FT = 1 any frame with a reserved frame type is filtered by the address filter similar to a data frame as described in the standard. This implies the generation of the IRQ_5 (AMI) interrupts upon address match. An IRQ_3 (TRX_END) interrupt is only generated if the address matched and the frame was not corrupted. An acknowledgment is only send, when the ACK request subfield was set in the received frame and an IRQ_3 (TRX_END) interrupt occurred. 3. AACK_UPLD_RES_FT = 0: Any received frame with a reserved frame type is discarded. 8.2.3 Register Description Register 0x17 (XAH_CTRL_1): The XAH_CTRL_1 register is a multi-purpose control register for Extended Operating Mode. Figure 8-4. Register XAH_CTRL_1. Bit 0x17 Read/Write Reset value Bit 0x17 Read/Write Reset value 7 6 5 4 reserved CSMA_LBT_MODE R/W 0 R/W 0 R/W 0 R/W 0 3 2 1 0 reserved AACK_ACK_TIME AACK_PROM_ MODE reserved R 0 R/W 0 R/W 0 R 0 AACK_FLTR_RES_ AACK_UPLD_RES_ FT FT XAH_CTRL_1 XAH_CTRL_1 • Bit 5 - AACK_FLTR_RES_FT Filter reserved frame types like data frame type. The register bit AACK_FLTR_RES_FT shall only be set if register bit AACK_UPLD_RES_FT = 1. Table 8-8. AACK_FLTR_RES_FT. Register Bits AACK_FLTR_RES_FT Value Description 0 (1) Filtering reserved frame types is disabled 1 (2) Filtering reserved frame types is enabled Notes: 1. If AACK_FLTR_RES_FT = 0 the received reserved frame is only checked for a valid FCS. 2. If AACK_FLTR_RES_FT = 1 reserved frame types are filtered similar to data frames as specified in IEEE 802.15.4–2006. Reserved frame types are explained in IEEE 802.15.4 Section 7.2.1.1.1. 85 42002E–MCU Wireless–02/2015 • Bit 4 - AACK_UPLD_RES_FT Upload reserved frame types within RX_AACK mode. Table 8-9. AACK_UPLD_RES_FT. Register Bits AACK_UPLD_RES_FT Value 0 Upload of reserved frame types is disabled (1) Upload of reserved frame types is enabled 1 Note: 1. Description If AACK_UPLD_RES_FT = 1 received frames indicated as a reserved frame are further processed. For those frames, an IRQ_3 (TRX_END) interrupt is generated if the FCS is valid. In conjunction with the configuration bit AACK_FLTR_RES_FT, these frames are handled like IEEE 802.15.4 compliant data frames during RX_AACK transaction. An IRQ_5 (AMI) interrupt is issued, if the addresses in the received frame match the node’s addresses. That means, if a reserved frame passes the third level filter rules, an acknowledgement frame is generated and transmitted if it was requested by the received frame. If this is not wanted register bit AACK_DIS_ACK (register 0x2E, CSMA_SEED_1) has to be set. • Bit 1 - AACK_PROM_MODE The register bit AACK_PROM_MODE enables the promiscuous mode, within the RX_AACK mode. Table 8-10. AACK_PROM_MODE. Register Bits AACK_PROM_MODE Value Description 0 Promiscuous mode is disabled 1 Promiscuous mode is enabled Refer to IEEE 802.15.4-2006 Section 7.5.6.5. If this register bit is set, every incoming frame with a valid PHR finishes with IRQ_3 (TRX_END) interrupt even if the third level filter rules do not match or the FCS is not valid. However, register bit RX_CRC_VALID (register 0x06, PHY_RSSI) is set accordingly. In contrast to IEEE 802.15.4-2006, if a frame passes the third level filter rules, an acknowledgement frame is generated and transmitted unless disabled by register bit AACK_DIS_ACK (register 0x2E, CSMA_SEED_1), or use Basic Operating Mode instead. 86 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Register 0x2E (CSMA_SEED_1): The CSMA_SEED_1 register is a control register for RX_AACK and contains a part of the CSMA_SEED for the CSMA-CA algorithm. Figure 8-5. Register CSMA_SEED_1. Bit 7 0x2E 6 AACK_FVN_MODE Read/Write Reset value Bit 0x2E 4 AACK_DIS_ACK R/W 0 R/W 1 R/W 0 R/W 0 3 2 1 0 AACK_I_AM_ COORD Read/Write Reset value 5 AACK_SET_PD CSMA_SEED_1 R/W 0 R/W 0 R/W 1 CSMA_SEED_1 CSMA_SEED_1 R/W 0 • Bit 7:6 - AACK_FVN_MODE The register bits AACK_FVN_MODE control the ACK behavior dependent on FCF frame version number within RX_AACK mode. Table 8-11. AACK_FVN_MODE. Register Bits AACK_FVN_MODE Note: 1. Value Description 0 Accept frames with version number 0 1 Accept frames with version number 0 or 1 2 Accept frames with version number 0 or 1 or 2 3 Accept frames independent of frame version number AACK_FVN_MODE value one indicates frames according to IEEE 802.15.4–2006, a value of three indicates frames according to IEEE 802.15.4–2003 standard. The frame control field of the MAC header (MHR) contains a frame version subfield. The setting of register bits AACK_FVN_MODE specifies the frame filtering behavior of the Atmel AT86RF212B. According to the content of these register bits the radio transceiver passes frames with a specific frame version number, number group, or independent of the frame version number. Thus the register bits AACK_FVN_MODE defines the maximum acceptable frame version. Received frames with a higher frame version number than configured do not pass the frame filter and are not acknowledged. The frame version field of the acknowledgment frame is set to zero according to IEEE 802.15.4-2006, Section 7.2.2.3.1 Acknowledgment frame MHR fields. 87 42002E–MCU Wireless–02/2015 • Bit 3 - AACK_I_AM_COORD This register bit has to be set if the node is a PAN coordinator. It is used for frame filtering in RX_AACK. Table 8-12. AACK_I_AM_COORD. Register Bits Value AACK_I_AM_COORD Description 0 PAN coordinator addressing is disabled 1 PAN coordinator addressing is enabled If AACK_I_AM_COORD = 1 and if only source addressing fields are included in a data or MAC command frame, the frame shall be accepted only if the device is the PAN coordinator and the source PAN identifier matches macPANId, for details refer to IEEE 802.15.4-2006, Section 7.5.6.2 (third-level filter rule six). 8.2.4 Register Description – Address Registers Register 0x20 (SHORT_ADDR_0): This register contains the lower 8-bit of the MAC short address for Frame Filter address recognition, bits[7:0]. Figure 8-6. Register SHORT_ADDR_0. Bit 7 6 0x20 Read/Write Reset value Bit 4 SHORT_ADDR_0 R/W 1 R/W 1 R/W 1 R/W 1 3 2 1 0 0x20 Read/Write Reset value 5 SHORT_ADDR_0 SHORT_ADDR_0 R/W 1 R/W 1 SHORT_ADDR_0 R/W 1 R/W 1 Register 0x21 (SHORT_ADDR_1): This register contains the higher 8-bit of the MAC short address for Frame Filter address recognition, bits[15:8]. Figure 8-7. Register SHORT_ADDR_1. Bit 7 6 0x21 Read/Write Reset value Bit 88 AT86RF212B 4 SHORT_ADDR_1 R/W 1 R/W 1 R/W 1 R/W 1 3 2 1 0 R/W 1 R/W 1 0x21 Read/Write Reset value 5 SHORT_ADDR_1 SHORT_ADDR_1 R/W 1 R/W 1 SHORT_ADDR_1 42002E–MCU Wireless–02/2015 AT86RF212B Register 0x22 (PAN_ID_0): This register contains the lower 8-bit of the MAC PAN ID for Frame Filter address recognition, bits[7:0]. Figure 8-8. Register PAN_ID_0. Bit 7 6 0x22 Read/Write Reset value Bit R/W 1 R/W 1 3 2 0x22 Read/Write Reset value 5 4 R/W 1 R/W 1 1 0 R/W 1 R/W 1 PAN_ID_0 PAN_ID_0 PAN_ID_0 R/W 1 R/W 1 PAN_ID_0 Register 0x23 (PAN_ID_1): This register contains the higher 8-bit of the MAC PAN ID for Frame Filter address recognition, bits[15:8]. Figure 8-9. Register PAN_ID_1. Bit 7 6 0x23 Read/Write Reset value Bit R/W 1 R/W 1 3 2 0x23 Read/Write Reset value 5 4 R/W 1 R/W 1 1 0 R/W 1 R/W 1 PAN_ID_1 PAN_ID_1 PAN_ID_1 R/W 1 R/W 1 PAN_ID_1 Register 0x24 (IEEE_ADDR_0): This register contains the lower 8-bit of the MAC IEEE address for Frame Filter address recognition, bits[7:0]. Figure 8-10. Register IEEE_ADDR_0. Bit 7 6 R/W 0 R/W 0 3 2 0x24 Read/Write Reset value Bit 4 R/W 0 R/W 0 1 0 R/W 0 R/W 0 IEEE_ADDR_0 0x24 Read/Write Reset value 5 IEEE_ADDR_0 IEEE_ADDR_0 R/W 0 R/W 0 IEEE_ADDR_0 89 42002E–MCU Wireless–02/2015 Register 0x25 (IEEE_ADDR_1): This register contains 8-bit of the MAC IEEE address for Frame Filter address recognition, bits[15:8]. Figure 8-11. Register IEEE_ADDR_1. Bit 7 6 0x25 Read/Write Reset value Bit R/W 0 R/W 0 3 2 0x25 Read/Write Reset value 5 4 R/W 0 R/W 0 1 0 R/W 0 R/W 0 IEEE_ADDR_1 IEEE_ADDR_1 IEEE_ADDR_1 R/W 0 R/W 0 IEEE_ADDR_1 Register 0x26 (IEEE_ADDR_2): This register contains 8-bit of the MAC IEEE address for Frame Filter address recognition, bits[23:16]. Figure 8-12. Register IEEE_ADDR_2. Bit 7 6 0x26 Read/Write Reset value Bit R/W 0 R/W 0 3 2 0x26 Read/Write Reset value 5 4 R/W 0 R/W 0 1 0 R/W 0 R/W 0 IEEE_ADDR_2 IEEE_ADDR_2 IEEE_ADDR_2 R/W 0 R/W 0 IEEE_ADDR_2 Register 0x27 (IEEE_ADDR_3): This register contains 8-bit of the MAC IEEE address for Frame Filter address recognition, bits[31:24]. Figure 8-13. Register IEEE_ADDR_3. Bit 7 6 0x27 Read/Write Reset value Bit R/W 0 R/W 0 3 2 0x27 Read/Write Reset value 90 AT86RF212B 5 4 R/W 0 R/W 0 1 0 R/W 0 R/W 0 IEEE_ADDR_3 IEEE_ADDR_3 IEEE_ADDR_3 R/W 0 R/W 0 IEEE_ADDR_3 42002E–MCU Wireless–02/2015 AT86RF212B Register 0x28 (IEEE_ADDR_4): This register contains 8-bit of the MAC IEEE address for Frame Filter address recognition, bits[39:32]. Figure 8-14. Register IEEE_ADDR_4. Bit 7 6 0x28 Read/Write Reset value Bit R/W 0 R/W 0 3 2 0x28 Read/Write Reset value 5 4 R/W 0 R/W 0 1 0 R/W 0 R/W 0 IEEE_ADDR_4 IEEE_ADDR_4 IEEE_ADDR_4 R/W 0 R/W 0 IEEE_ADDR_4 Register 0x29 (IEEE_ADDR_5): This register contains 8-bit of the MAC IEEE address for Frame Filter address recognition, bits[47:40]. Figure 8-15. Register IEEE_ADDR_5. Bit 7 6 0x29 Read/Write Reset value Bit R/W 0 R/W 0 3 2 0x29 Read/Write Reset value 5 4 R/W 0 R/W 0 1 0 R/W 0 R/W 0 IEEE_ADDR_5 IEEE_ADDR_5 IEEE_ADDR_5 R/W 0 R/W 0 IEEE_ADDR_5 Register 0x2A (IEEE_ADDR_6): This register contains 8-bit of the MAC IEEE address for Frame Filter address recognition, bits[55:48]. Figure 8-16. Register IEEE_ADDR_6. Bit 7 6 R/W 0 R/W 0 3 2 0x2A Read/Write Reset value Bit 4 R/W 0 R/W 0 1 0 R/W 0 R/W 0 IEEE_ADDR_6 0x2A Read/Write Reset value 5 IEEE_ADDR_6 IEEE_ADDR_6 R/W 0 R/W 0 IEEE_ADDR_6 91 42002E–MCU Wireless–02/2015 Register 0x2B (IEEE_ADDR_7): This register contains the higher 8-bit of the MAC IEEE Frame Filter address for address recognition, bits[63:56]. Figure 8-17. Register IEEE_ADDR_7. Bit 7 6 0x2B Read/Write Reset value Bit R/W 0 R/W 0 3 2 0x2B Read/Write Reset value 92 AT86RF212B 5 4 R/W 0 R/W 0 1 0 R/W 0 R/W 0 IEEE_ADDR_7 IEEE_ADDR_7 IEEE_ADDR_7 R/W 0 R/W 0 IEEE_ADDR_7 42002E–MCU Wireless–02/2015 AT86RF212B 8.3 Frame Check Sequence (FCS) The Frame Check Sequence (FCS) is characterized by: • Indication of bit errors, based on a cyclic redundancy check (CRC) of length 16 bit • A use of International Telecommunication Union (ITU) CRC polynomial • Automatical evaluation during reception • Automatical generation during transmission 8.3.1 Overview The FCS is intended for use at the MAC layer to detect corrupted frames at a first level of filtering. It is computed by applying an ITU CRC polynomial to all transferred bytes following the length field (MHR and MSDU fields). The frame check sequence has a length of 16 bit and is located in the last two bytes of a frame (MAC footer, see Figure 8-2). The Atmel AT86RF212B applies an FCS check on each received frame. The FCS check result is stored in register bit RX_CRC_VALID (register 0x06, PHY_RSSI). On transmission the radio transceiver generates and appends the FCS bytes during the frame transmission. This behavior can be disabled by setting register bit TX_AUTO_CRC_ON = 0 (register 0x04, TRX_CTRL_1). 8.3.2 CRC Calculation The CRC polynomial used in IEEE 802.15.4 networks is defined by G16 ( x) = x 16 + x 12 + x 5 + 1 . The FCS shall be calculated for transmission using the following algorithm: Let M ( x) = b0 x k −1 + b1 x k −2 +  + bk −2 x + bk −1 be the polynomial representing the sequence of bits for which the checksum is to be 16 computed. Multiply M(x) by x , giving the polynomial N ( x) = M ( x) ⋅ x16 . Divide N (x) modulo two by the generator polynomial, G16 ( x) , to obtain the remainder polynomial, R ( x) = r0 x 15 + r1 x 14 + ... + r14 x + r15 . The FCS field is given by the coefficients of the remainder polynomial, R(x). Example: Considering a five octet ACK frame. The MHR field consists of 0100 0000 0000 0000 0101 0110. The leftmost bit (b0) is transmitted first in time. The FCS is in this case 0010 0111 1001 1110. The leftmost bit (r0) is transmitted first in time. 93 42002E–MCU Wireless–02/2015 8.3.3 Automatic FCS Generation The automatic FCS generation is enabled with register bit TX_AUTO_CRC_ON = 1. This allows the Atmel AT86RF212B to compute the FCS autonomously. For a frame with a frame length specified as N (3 ≤ N ≤ 127), the FCS is calculated on the first N-2 octets in the Frame Buffer, and the resulting FCS field is transmitted in place of the last two octets from the Frame Buffer. In RX_AACK mode, when a received frame needs to be acknowledged, the FCS of the ACK frame is always automatically generated by the AT86RF212B, independent of the TX_AUTO_CRC_ON setting. Example: A frame transmission of length five with TX_AUTO_CRC_ON set, is started with a Frame Buffer write access of five bytes (the last two bytes can be omitted). The first three bytes are used for FCS generation; the last two bytes are replaced by the internally calculated FCS. 8.3.4 Automatic FCS Check An automatic FCS check is applied on each received frame with a frame length N ≥ 2. Register bit RX_CRC_VALID (register 0x06, PHY_RSSI) is set if the FCS of a received frame is valid. The register bit is updated when issuing interrupt IRQ_3 (TRX_END) and remains valid until the next TRX_END interrupt caused by a new frame reception. In addition, bit[7] of byte RX_STATUS is set accordingly, refer to Section 6.3.2. In Extended Operating Mode, the RX_AACK procedure does not accept a frame if the corresponding FCS is not valid, that is no IRQ_3 (TRX_END) interrupt is issued. When operating in TX_ARET mode, the FCS of a received ACK is automatically checked. If it is not correct, the ACK is not accepted; refer to Section 7.2.4 for automated retries. 8.3.5 Register Description Register 0x04 (TRX_CTRL_1): The TRX_CTRL_1 register is a multi-purpose register to control various operating modes and settings of the radio transceiver. Figure 8-18. Register TRX_CTRL_1. Bit 0x04 Read/Write Reset value Bit 0x04 Read/Write Reset value 94 AT86RF212B 7 6 5 4 PA_EXT_EN IRQ_2_EXT_EN TX_AUTO_CRC_ ON RX_BL_CTRL R/W 0 R/W 0 R/W 1 R/W 0 3 2 1 0 IRQ_MASK_MODE IRQ_POLARITY R/W 0 R/W 0 SPI_CMD_MODE R/W 0 R/W 0 TRX_CTRL_1 TRX_CTRL_1 42002E–MCU Wireless–02/2015 AT86RF212B • Bit 5 - TX_AUTO_CRC_ON The register bit TX_AUTO_CRC_ON controls the automatic FCS generation for transmit operations. Table 8-13. TX_AUTO_CRC_ON. Register Bits Value TX_AUTO_CRC_ON Note: 1. Description 0 Automatic FCS generation is disabled 1 Automatic FCS generation is enabled The TX_AUTO_CRC_ON function can be used within Basic and Extended Operating Modes. Register 0x06 (PHY_RSSI): The PHY_RSSI register is a multi-purpose register that indicates FCS validity, to provide random numbers, and a RSSI value. Figure 8-19. Register PHY_RSSI. Bit 0x06 7 6 5 RX_CRC_VALID RND_VALUE Read/Write Reset value R 0 R 0 Bit 3 2 0x06 Read/Write Reset value 4 RSSI R 0 R 0 1 0 R 0 R 0 RSSI R 0 R 0 PHY_RSSI PHY_RSSI • Bit 7 - RX_CRC_VALID The register bit RX_CRC_VALID signals the FCS check status for a received frame. Table 8-14. RX_CRC_VALID. Register Bits RX_CRC_VALID Value Description 0 FCS is not valid 1 FCS is valid Reading this register bit indicates whether the last received frame has a valid FCS or not. The register bit is updated at the same time the IRQ_3 (TRX_END) is issued and remains valid until the next SHR detection. 95 42002E–MCU Wireless–02/2015 8.4 Received Signal Strength Indicator (RSSI) The Received Signal Strength Indicator is characterized by: • Minimum RSSI level is RSSIBASE_VAL • Dynamic range is 87dB • Minimum RSSI value is 0 • Maximum RSSI value is 28 8.4.1 Overview The RSSI is a 5-bit value indicating the receive power in the selected channel, in steps of 3.1dB. No attempt is made to distinguish IEEE 802.15.4 signals from others, only the received signal strength is evaluated. The RSSI provides the basis for an ED measurement, see Section 8.5. 8.4.2 Reading RSSI In Basic Operating Modes, the RSSI value is valid in any receive state and is updated at time intervals according to Table 8-15 (see parameter tRSSI on Table 7-2). The current RSSI value can be accessed by reading register bits RSSI (register 0x06, PHY_RSSI). Table 8-15. RSSI Update Interval. PHY Mode Update Interval [µs] BPSK-20 32 BPSK-40 24 O-QPSK 8 It is not recommended reading the RSSI value when using the Extended Operating Modes. Instead, the automatically generated ED value should be used, see Section 8.5. 8.4.3 Data Interpretation The RSSI value is a 5-bit value in a range of zero to 28, indicating the receiver input power in steps of about 3.1dB. A RSSI value of zero indicates a receiver RF input power less than or equal to PRF ≤ RSSIBASE_VAL. For a RSSI value in the range of one to 28, the RF input power can be calculated as follows: PRF[dBm] = RSSIBASE_VAL[dBm] + 3.1[dB] x RSSI The value RSSIBASE_VAL itself depends on the PHY mode, refer to Section 9.1. For typical conditions, it is shown in Table 8-16. Table 8-16. RSSI_BASE_VAL. PHY Mode 96 RSSIBASE_VAL [dBm] BPSK with 300kchip/s -100 BPSK with 600kchip/s -99 O-QPSK with 400kchip/s, SIN and RC-0.2 shaping -98 O-QPSK with 400kchip/s, RC-0.2 shaping -98 O-QPSK with 1000kchip/s, SIN shaping -98 O-QPSK with 1000kchip/s, RC-0.8 shaping -97 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 8-20. Mapping between RSSI Value and Receiver Input Power. 30 25 RSSI 20 15 10 BPSK with 300 kchip/s BPSK with 600 kchip/s 5 O-QPSK with 400 kchip/s O-QPSK with 1000 kchip/s (SIN) 0 -100 -80 -60 -40 -20 0 Receiver Input Power [dBm] 8.4.4 Register Description Register 0x06 (PHY_RSSI): The PHY_RSSI register is a multi-purpose register that indicates FCS validity, to provide random numbers, and a RSSI value. Figure 8-21. Register PHY_RSSI. Bit 0x06 7 6 5 RX_CRC_VALID RND_VALUE Read/Write Reset value R 0 R 0 Bit 3 2 0x06 Read/Write Reset value 4 RSSI R 0 R 0 1 0 RSSI R 0 R 0 PHY_RSSI PHY_RSSI R 0 R 0 • Bit 4:0 - RSSI Received signal strength as a linear curve on a logarithmic input power scale with a resolution of 3.1dB. Table 8-17. RSSI. Register Bits RSSI Value Description 0x00 Minimum RSSI value 0x1C Maximum RSSI value The result of the automated RSSI measurement is stored in register bits RSSI (register 0x06, PHY_RSSI). The value is updated at time intervals according to Table 8-15 in any receive state. RSSI is a number between zero and 28, representing the received signal strength. 97 42002E–MCU Wireless–02/2015 8.5 Energy Detection (ED) The Atmel AT86RF212B Energy Detection (ED) module is characterized by • 85 unique energy levels defined • 1dB resolution • A measurement time of eight symbol periods for IEEE 802.15.4 compliant data rates 8.5.1 Overview The receiver ED measurement (ED scan procedure) can be used as a part of a channel selection algorithm. It is an estimation of the received signal power within the bandwidth of an IEEE 802.15.4 channel. No attempt is made to identify or decode signals on the channel. The ED value is calculated by averaging RSSI values over eight symbol periods, with the exception of the High Data Rate Modes (refer to Section 9.1.4). 8.5.2 Measurement Description There are two ways to initiate an ED measurement, • Manually by writing an arbitrary value to register 0x07 (PHY_ED_LEVEL), or • Automatically after detection of a valid SHR of an incoming frame. Manually: For manually initiated ED measurements, the radio transceiver needs to be either in the state RX_ON or BUSY_RX. The end of the ED measurement time (eight symbol periods plus a processing time) is indicated by the interrupt IRQ_4 (CCA_ED_DONE) and the measurement result is stored in register 0x07 (PHY_ED_LEVEL), refer to tED in Table 7-2. In order to avoid interference with an automatically initiated ED measurement, the SHR detection can be disabled by setting register bit RX_PDT_DIS (register 0x15, RX_SYN), refer to Section 9.2. Note: 1. It is not recommended to manually initiate an ED measurement when using the Extended Operating Mode. Automatically: An automated ED measurement is started upon SHR detection. The end of the automated measurement is not signaled by an interrupt. When using the Basic Operating Mode and standard compliant data rates, a valid ED value (register 0x07, PHY_ED_LEVEL) of the currently received frame is accessible not later than eight symbol periods after IRQ_2 (RX_START) plus a processing time of 12µs. For High Data Rate Modes (refer to Section 9.1.4), the measurement duration is reduced to two symbol periods plus a processing time of 12µs. The ED value remains valid until a new RX_START interrupt is generated by the next incoming frame or until another ED measurement is initiated. When using the Extended Operating Mode, it is useful to mask IRQ_2 (RX_START), thus the interrupt cannot be used as timing reference. A successful frame reception is signalized by interrupt IRQ_3 (TRX_END). In this case, the ED value needs to be read within the time span of a next SHR 98 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B detection plus the ED measurement time in order to avoid overwrite of the current ED value. Note: 2. The ED result is not updated during the rest of the frame reception, even by requesting an ED measurement manually. 8.5.3 Data Interpretation The PHY_ED_LEVEL is an 8-bit register. The ED_LEVEL value of the Atmel AT86RF212B has a valid range from 0x00 to 0x54 with a resolution of 1.03dB. Values 0x55 to 0xFE do not occur and a value of 0xFF indicates the reset value. Due to environmental conditions (temperature, voltage, semiconductor parameters, etc.) the calculated ED_LEVEL value has a maximum tolerance of ±6dB, this is to be considered as constant offset over the measurement range. An ED_LEVEL value of zero indicates a receiver RF input power less than or equal to RSSIBASE_VAL (refer to Table 8-16); a value of 84 indicates an input power equal to or larger than RSSIBASE_VAL + 87dB. The receiver input power can be calculated as follows: PRF[dBm] = RSSIBASE_VAL[dBm] +1.03[dB] x ED_LEVEL Figure 8-22. Mapping between ED Value and Receiver Input Power. 90 80 70 ED_LEVEL 60 50 40 30 20 BPSK with 300 kchip/s BPSK with 600 kchip/s 10 O-QPSK with 400 kchip/s O-QPSK with 1000 kchip/s (SIN) 0 -100 -80 -60 -40 -20 0 Receiver Input Power [dBm] 8.5.4 Interrupt Handling Interrupt IRQ_4 (CCA_ED_DONE) is issued at the end of a manually initiated ED measurement. Note: 1. An ED measurement should only be initiated in RX states but not in RX_AACK states. Otherwise, the radio transceiver generates an IRQ_4 (CCA_ED_DONE) without actually performing an ED measurement. 99 42002E–MCU Wireless–02/2015 8.5.5 Register Description Register 0x07 (PHY_ED_LEVEL): The PHY_ED_LEVEL register contains the result of an ED measurement. Figure 8-23. Register PHY_ED_LEVEL. Bit 7 6 0x07 Read/Write Reset value R 1 R 1 Bit 3 2 0x07 Read/Write Reset value 5 4 R 1 R 1 1 0 R 1 R 1 ED_LEVEL PHY_ED_LEVEL ED_LEVEL R 1 R 1 PHY_ED_LEVEL • Bit 7:0 - ED_LEVEL The register bits ED_LEVEL signals the ED level for the current channel. Table 8-18. ED_LEVEL. Register Bits Value Description ED_LEVEL 0x00 Minimum ED level value 0x54 Maximum ED level value 0xFF Reset value The measured ED value has a valid range from 0x00 to 0x54 (zero to 84). The value 0xFF signals that no measurement has been started yet (reset value). A manual ED measurement can be initiated by a write access to the register. 100 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 8.6 Clear Channel Assessment (CCA) The main features of the Clear Channel Assessment (CCA) module are: • All four modes are available as defined by IEEE 802.15.4-2006 in Section 6.9.9 • Adjustable threshold for energy detection algorithm 8.6.1 Overview A CCA measurement is used to detect a clear channel. Four CCA modes are specified by IEEE 802.15.4-2006: Table 8-19. CCA Mode Overview. CCA Mode Description 1 Energy above threshold. CCA shall report a busy medium upon detecting any energy above the ED threshold. 2 Carrier sense only. CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of an IEEE 802.15.4 compliant signal. The signal strength may be above or below the ED threshold. 0, 3 Carrier sense with energy above threshold. CCA shall report a busy medium using a logical combination of - Detection of a signal with the modulation and spreading characteristics of this standard and - Energy above the ED threshold. Where the logical operator may be configured as either OR (mode 0) or AND (mode 3). 8.6.2 Configuration and Request The CCA modes are configurable via register 0x08 (PHY_CC_CCA). When in Basic Operating Mode, a CCA request can be initiated manually by setting CCA_REQUEST = 1 (register 0x08, PHY_CC_CCA), if the Atmel AT86RF212B is in any RX state. The current channel status (CCA_STATUS) and the CCA completion status (CCA_DONE) are accessible through register 0x01 (TRX_STATUS). The end of a manually initiated CCA (eight symbol periods plus 12µs processing delay) is indicated by the interrupt IRQ_4 (CCA_ED_DONE). The register bits CCA_ED_THRES (register 0x09, CCA_THRES) defines the receive power threshold of the “energy above threshold” algorithm. The threshold is calculated by: PCCA_ED_THRES[dBm] = RSSIBASE_VAL[dBm] + 2.07[dB] x CCA_ED_THRES. Any received power above this level is interpreted as a busy channel. Note: 1. It is not recommended to manually initiate a CCA measurement when using the Extended Operating Mode. 101 42002E–MCU Wireless–02/2015 8.6.3 Data Interpretation The Atmel AT86RF212B current channel status (CCA_STATUS) and the CCA completion status (CCA_DONE) are accessible through register 0x01 (TRX_STATUS). Note: 1. The register bits CCA_DONE and CCA_STATUS are cleared in response to a CCA_REQUEST. The completion of a measurement cycle is indicated by CCA_DONE = 1. If the radio transceiver detects no signal (idle channel) during the CCA evaluation period, the CCA_STATUS bit is set to one; otherwise, it is set to zero. When using the “energy above threshold” algorithm, a received power above PCCA_ED_THRES is interpreted as a busy channel. When using the “carrier sense” algorithm (that is CCA_MODE = 0, 2, and 3), the AT86RF212B reports a busy channel upon detection of a PHY mode specific IEEE 802.15.4 signal above RSSIBASE_VAL (see Table 8-16). The AT86RF212B is also capable of detecting signals below this value, but the detection probability decreases with decreasing signal power. It is almost zero at the radio transceivers sensitivity level (see parameter PSENS on Section 12.7). 8.6.4 Interrupt Handling Interrupt IRQ_4 (CCA_ED_DONE) is issued at the end of a manually initiated CCA measurement. Note: 1. A CCA request should only be initiated in Basic Operating Mode receive states. Otherwise the radio transceiver generates an IRQ_4 (CCA_ED_DONE) and sets the register bit CCA_DONE = 1, even though no CCA measurement was performed. 8.6.5 Measurement Time The response time of a manually initiated CCA measurement depends on the receiver state. In RX_ON state, the CCA measurement is done over eight symbol periods and the result is accessible upon the event IRQ_4 (CCA_ED_DONE) or upon CCA_DONE = 1 (register 0x01, TRX_STATUS). In BUSY_RX state, the CCA measurement duration depends on the CCA mode and the CCA request relative to the detection of the SHR. The end of the CCA measurement is indicated by IRQ_4 (CCA_ED_DONE). The variation of a CCA measurement period in BUSY_RX state is described in Table 8-20. It is recommended to perform CCA measurements in RX_ON state only. To avoid switching accidentally to BUSY_RX state, the SHR detection can be disabled by setting register bit RX_PDT_DIS (register 0x15, RX_SYN), refer to Section 9.2. The receiver remains in RX_ON state to perform a CCA measurement until the register bit RX_PDT_DIS is set back to continue the frame reception. In this case, the CCA measurement duration is eight symbol periods. 102 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Table 8-20. CCA Measurement Period and Access in BUSY_RX State. CCA Mode 1 Request within ED measurement (1) Request after ED measurement Energy above threshold. CCA result is available after finishing automated ED measurement period. 2 CCA result is immediately available after request. Carrier sense only. CCA result is immediately available after request. 3 Carrier sense with Energy above threshold (AND). CCA result is available after finishing automated ED measurement period. 0 CCA result is immediately available after request. Carrier sense with Energy above threshold (OR). CCA result is available after finishing automated ED measurement period. Note: 1. CCA result is immediately available after request. After detecting the SHR, an automated ED measurement is started with a length of eight symbol periods (two symbol periods for high rate PHY modes, refer to Section 9.1.4). This automated ED measurement must be finished to provide a result for the CCA measurement. Only one automated ED measurement per frame is performed. 8.6.6 Register Description Register 0x01 (TRX_STATUS): The read-only register TRX_STATUS signals the present state of the radio transceiver as well as the status of a CCA operation. Figure 8-24. Register TRX_STATUS. Bit 7 6 5 4 CCA_DONE CCA_STATUS reserved TRX_STATUS Read/Write Reset value R 0 R 0 R 0 R 0 Bit 3 2 1 0 R 0 R 0 0x01 0x01 Read/Write Reset value TRX_STATUS R 0 R 0 TRX_STATUS TRX_STATUS • Bit 7 - CCA_DONE Table 8-21. CCA_DONE. Register Bits CCA_DONE Value Description 0 CCA calculation not finished 1 CCA calculation finished The register bit CCA_DONE indicates if a CCA request is completed. This is also indicated by an interrupt IRQ_4 (CCA_ED_DONE). The register bit CCA_DONE is cleared in response to a CCA_REQUEST. 103 42002E–MCU Wireless–02/2015 • Bit 6 - CCA_STATUS Table 8-22. CCA_STATUS. Register Bits Value Description CCA_STATUS 0 Channel indicated as busy 1 Channel indicated as idle After a CCA request is completed, the result of the CCA measurement is available in register bit CCA_STATUS. The register bit CCA_STATUS is cleared in response to a CCA_REQUEST. Register 0x08 (PHY_CC_CCA): The PHY_CC_CCA register is a multi-purpose register that controls CCA configuration, CCA measurement, and the IEEE 802.15.4 channel setting. Figure 8-25. Register PHY_CC_CCA. Bit 7 0x08 6 5 CCA_REQUEST Read/Write Reset value Bit CCA_MODE R/W 0 R/W 0 3 2 0x08 4 CHANNEL R/W 1 R/W 0 1 0 R/W 0 R/W 1 CHANNEL Read/Write Reset value R/W 0 R/W 1 PHY_CC_CCA PHY_CC_CCA • Bit 7 - CCA_REQUEST The register bit CCA_REQUEST initiates a manual started CCA measurement. Table 8-23. CCA_REQUEST. Register Bits CCA_REQUEST Notes: 1. 2. Value Description 0 Reset value 1 Starts a CCA measurement The read value returns always with zero. If a CCA request is initiated in states others than RX_ON or RX_BUSY the PHY generates an IRQ_4 (CCA_ED_DONE) and sets the register bit CCA_DONE, however no CCA was carried out. A manual CCA measurement is initiated with setting CCA_REQUEST = 1. The end of the CCA measurement is indicated by interrupt IRQ_4 (CCA_ED_DONE). Register bits CCA_DONE and CCA_STATUS (register 0x01, TRX_STATUS) are updated after a CCA_REQUEST. The register bit is automatically cleared after requesting a CCA measurement with CCA_REQUEST = 1. 104 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B • Bit 6:5 - CCA_MODE The CCA mode can be selected using register bits CCA_MODE. Table 8-24. CCA_MODE. Register Bits Value Description CCA_MODE 0 Mode 3a, Carrier sense OR energy above threshold 1 Mode 1, Energy above threshold 2 Mode 2, Carrier sense only 3 Mode 3b, Carrier sense AND energy above threshold Notes: 1. IEEE 802.15.4–2006 CCA mode 3 defines the logical combination of CCA mode 1 and 2 with the logical operators AND or OR. 2. If register bit CSMA_LBT_MODE is set, CCA_MODE configures the LBT measurement. Register 0x09 (CCA_THRES): The CCA_THRES register sets the CS and ED threshold level for CCA. Figure 8-26. Register CCA_THRES. Bit 7 6 0x09 5 4 CCA_CS_THRES Read/Write Reset value CCA_THRES R/W 0 R/W 1 R/W 1 R/W 1 3 2 1 0 R/W 1 R/W 1 Bit 0x09 CCA_ED_THRES Read/Write Reset value R/W 0 R/W 1 CCA_THRES • Bit 7:4 - CCA_CS_THRES The register bits CCA_CS_THRES are used for CCA carrier sense algorithm. Table 8-25. CCA_CS_THRES. Register Bits CCA_CS_THRES Value Description 0x7 Default value 0xF A threshold of 15 always signals an empty channel All other values are reserved Note: 1. A value of seven (reset value) corresponds to normal CCA_CS operation. A value of 15 results in always sensing an empty channel if CCA_MODE = 2 (carrier sense only). This can be useful in combination with TX_ARET, that is allowing retries with actually performing CSMA-CA. 105 42002E–MCU Wireless–02/2015 • Bit 3:0 - CCA_ED_THRES An ED value above the threshold signals the channel as busy during a CCA_ED measurement. Table 8-26. CCA_ED_THRES. Register Bits CCA_ED_THRES Note: 106 AT86RF212B 1. Value 0x7 Description For CCA_MODE = 1, a busy channel is indicated if the measured received power is above P_THRES [dBm] = RSSI_BASE_VAL[dBm] + 2.07[dB] x CCA_ED_THRES. CCA modes 0 and 3 are logically related to this result. If CSMA_LBT_MODE is enabled, CCA_ED_THRES is used for the LBT measurement. 42002E–MCU Wireless–02/2015 AT86RF212B 8.7 Listen Before Talk (LBT) 8.7.1 Overview Equipment using the Atmel AT86RF212B shall conform to the established regulations. With respect to the regulations in Europe, CSMA-CA based transmission according to IEEE 802.15.4 is not appropriate. In principle, transmission is subject to low duty cycles (0.1% to 1%). However, according to [6], equipment employing listen before talk (LBT) and adaptive frequency agility (AFA) does not have to comply with duty cycle conditions. Hence, LBT can be attractive in order to reduce network latency. Minimum Listening Time A device with LBT needs to comply with a minimum listening time, refer to Section 9.1.1.2 of [6]. Prior transmission, the device must listen for a receive signal at or above the LBT threshold level to determine whether the intended channel is available for use, unless transmission is pursuing acknowledgement. A device using LBT needs to listen for a fixed period of at least 5ms. If the channel is free after this period, transmission may immediately commence (that is no CSMA is required). Otherwise, a new minimum listening period of a randomly selected time span between 5ms and 10ms is required. The time resolution shall be approximately 0.5ms. The last step needs to be repeated until a free channel is available. LBT Threshold According to [6], the maximum LBT threshold for an IEEE 802.15.4 signal is presumably -82dBm, assuming a channel spacing of 1MHz. 8.7.2 LBT Mode The AT86RF212B supports the previously described LBT specific listening mode when operating in the Extended Operating Mode. In particular, during TX_ARET (see Section 7.2.4), the CSMA-CA algorithm can be replaced by the LBT listening mode when setting register bit CSMA_LBT_MODE (register 0x17, XAH_CTRL_1). In this case, however, the register bits MAX_CSMA_RETRIES (register 0x2C, XAH_CTRL_0) as well as register bits MIN_BE and MAX_BE (register 0x2F, CSMA_BE) are ignored, implying that the listening mode will sustain unless a clear channel has been found or the TX_ARET transaction will be canceled. The latter can be achieved by setting register bits TRX_CMD (register 0x02, TRX_STATE) to either FORCE_PLL_ON or FORCE_TRX_OFF, the value of register bits TRAC_STATUS is not meaningful in this case. All other aspects of TX_ARET remain unchanged, refer to Section 7.2.4. The LBT threshold can be configured in the same way as for CCA, that is via register bits CCA_MODE (register 0x08, PHY_CC_CCA) and register bits CCA_ED_THRES (register 0x09, CCA_THRES), refer to Section 8.6. 107 42002E–MCU Wireless–02/2015 8.7.3 Register Description Register 0x08 (PHY_CC_CCA): The PHY_CC_CCA register is a multi-purpose register that controls CCA configuration, CCA measurement, and the IEEE 802.15.4 channel setting. Figure 8-27. Register PHY_CC_CCA. Bit 7 0x08 6 5 CCA_REQUEST Read/Write Reset value Bit CCA_MODE R/W 0 R/W 0 3 2 0x08 4 CHANNEL R/W 1 R/W 0 1 0 R/W 0 R/W 1 CHANNEL Read/Write Reset value R/W 0 R/W 1 PHY_CC_CCA PHY_CC_CCA • Bit 6:5 - CCA_MODE The CCA mode can be selected using register bits CCA_MODE. Table 8-27. CCA_MODE. Register Bits Value Description CCA_MODE 0 Mode 3a, Carrier sense OR energy above threshold 1 Mode 1, Energy above threshold 2 Mode 2, Carrier sense only 3 Mode 3b, Carrier sense AND energy above threshold Notes: 1. IEEE 802.15.4–2006 CCA mode 3 defines the logical combination of CCA mode 1 and 2 with the logical operators AND or OR. 2. If register bit CSMA_LBT_MODE is set, CCA_MODE configures the LBT measurement. Register 0x09 (CCA_THRES): The CCA_THRES register sets the CS and ED threshold level for CCA. Figure 8-28. Register CCA_THRES. Bit 7 6 0x09 Read/Write Reset value Bit 108 AT86RF212B 4 CCA_THRES R/W 0 R/W 1 R/W 1 R/W 1 3 2 1 0 R/W 1 R/W 1 0x09 Read/Write Reset value 5 CCA_CS_THRES CCA_ED_THRES R/W 0 R/W 1 CCA_THRES 42002E–MCU Wireless–02/2015 AT86RF212B • Bit 3:0 - CCA_ED_THRES An ED value above the threshold signals the channel as busy during a CCA_ED measurement. Table 8-28. CCA_ED_THRES. Register Bits Value CCA_ED_THRES Note: 1. Description 0x7 For CCA_MODE = 1, a busy channel is indicated if the measured received power is above P_THRES [dBm] = RSSI_BASE_VAL[dBm] + 2.07[dB] x CCA_ED_THRES. CCA modes 0 and 3 are logically related to this result. If CSMA_LBT_MODE is enabled, CCA_ED_THRES is used for the LBT measurement. Register 0x17 (XAH_CTRL_1): The XAH_CTRL_1 register is a multi-purpose control register for Extended Operating Mode. Figure 8-29. Register XAH_CTRL_1. Bit 0x17 Read/Write Reset value Bit 0x17 Read/Write Reset value 7 reserved 6 5 4 AACK_FLTR_RES_ AACK_UPLD_RES_ CSMA_LBT_MODE FT FT R/W 0 R/W 0 R/W 0 R/W 0 3 2 1 0 reserved AACK_ACK_TIME AACK_PROM_ MODE reserved R 0 R/W 0 R/W 0 R 0 XAH_CTRL_1 XAH_CTRL_1 • Bit 6 - CSMA_LBT_MODE The register bit CSMA_LBT_MODE switched between CSMA-CA or Listen Before Talk (LBT) algorithm within TX_ARET mode. Table 8-29. CSMA_LBT_MODE. Register Bits CSMA_LBT_MODE Value Description 0 CSMA-CA algorithm is used 1 LBT algorithm is used If set to zero (default), CSMA-CA algorithm is used during TX_ARET for clear channel assessment. Otherwise, the LBT specific listening mode is applied. 109 42002E–MCU Wireless–02/2015 8.8 Link Quality Indication (LQI) The IEEE 802.15.4 standard defines the LQI as a characterization of the strength and/or quality of a received frame. The use of the LQI result by the network or application layer is not specified in this standard. The LQI value shall be an integer ranging from zero to 255, with at least eight unique values. The minimum and maximum LQI values (0x00 and 0xFF) should be associated with the lowest and highest quality compliant signals, respectively, and LQI values in between should be uniformly distributed between these two limits. 8.8.1 Overview During symbol detection within frame reception, the Atmel AT86RF212B uses correlation results of multiple symbols in order to compute an estimate of the LQI value. This is motivated by the fact that the mean value of the correlation result is inversely related to the probability of a detection error. LQI computation is automatically performed for each received frame, once the SHR has been detected. LQI values are integers ranging from zero to 255 as required by the IEEE 802.15.4 standard. 8.8.2 Obtaining the LQI Value The LQI value is available, once the corresponding frame has been completely received. This is indicated by the interrupt IRQ_3 (TRX_END). The value can be obtained by means of a frame buffer read access, see Section 6.3.2. 8.8.3 Data Interpretation The reason for a low LQI value can be twofold: a low signal strength and/or high signal distortions, for example by interference and/or multipath propagation. High LQI values, however, indicate a sufficient signal strength and low signal distortions. Notes: 1. The LQI value is almost always 255 for scenarios with very low signal distortions and a signal strength much greater than the sensitivity level. In this case, the packet error rate tends towards zero and increase of the signal strength, that is by increasing the transmission power, cannot decrease the error rate any further. Received signal strength indication (RSSI) or energy detection (ED) can be used to evaluate the signal strength and the link margin. 2. The received signal power as indicated by received signal strength indication (RSSI) value or energy detection (ED) value of the Atmel AT86RF212B do not characterize the signal quality and the ability to decode a signal. ZigBee networks often require identification of the “best” routing between two nodes. LQI and RSSI/ED can be applied, depending on the optimization criteria. If a low frame error rate (corresponding to a high throughput) is the optimization criteria, then the LQI value should be taken into consideration. If, however, the target is a low transmission power, then the RSSI/ED value is also helpful. Various combinations of LQI and RSSI/ED are possible for routing decisions. As a rule of thumb, information on RSSI/ED is useful in order to differentiate between links with high LQI values. However, transmission links with low LQI values should be discarded for routing decisions, even if the RSSI/ED values are high, since it is merely an information about the received signal strength, whereas the source can be an interferer. 110 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 9 Module Description 9.1 Physical Layer Modes 9.1.1 Spreading, Modulation, and Pulse Shaping The Atmel AT86RF212B supports various physical layer (PHY) modes independent of the RF channel selection. Symbol mapping along with chip spreading, modulation, and pulse shaping is part of the digital base band processor, see Figure 9-1. Figure 9-1. Base Band Transmitter Architecture. PPDU Symbol Mapping & Chip Spreading Modulation BPSK/O-QPSK Pulse Shaping DAC The combination of spreading, modulation, and pulse shaping are restricted to several combinations as shown in Table 9-1. The AT86RF212B is fully compliant to the IEEE 802.15.4 low data rate modes of 20kb/s or 40kb/s, employing binary phase-shift keying (BPSK) and spreading with a fixed chip rate of 300kchip/s or 600kchip/s, respectively. The symbol rate is 20ksymbol/s or 40ksymbol/s, respectively. In both cases, pulse shaping is approximating a raised cosine filter with roll-off factor 1.0 (RC-1.0). For optional data rates according to IEEE 802.15.4-2006, offset quadrature phase-shift keying (O-QPSK) is supported by the AT86RF212B with a fixed chip rate of either 400kchip/s or 1000kchip/s. At a chip rate of 400kchip/s, there is a choice between two different pulse shaping modes. One pulse shaping uses a combination of both, half-sine shaping (SIN) and raised cosine filtering with roll-off factor 0.2 (RC-0.2) according to IEEE 802.15.4-2006 [2] for the 868.3MHz band. The other, uses raised cosine filtering with roll-off factor 0.2 (RC-0.2). At a chip rate of 1000kchip/s, pulse shaping is either half-sine filtering (SIN) as specified in IEEE 802.15.4-2006 [2], or, alternatively, raised cosine filtering with roll-off factor 0.8 (RC-0.8) as specified in IEEE 802.15.4c-2009 [3] and IEEE 802.15.4-2011 [4]. For O-QPSK, the AT86RF212B supports spreading according to IEEE 802.15.4-2006 with data rates of either 100kb/s or 250kb/s depending on the chip rate, leading to a symbol rate of either 25ksymbol/s or 62.5ksymbol/s, respectively. Additionally, the AT86RF212B supports two more spreading codes for O-QPSK with shortened code lengths. This leads to higher but non IEEE 802.15.4 compliant data rates for PSDU transmission at 200, 400, 500, and 1000kb/s. The proprietary High Data Rate Modes are outlined in more detail in Section 9.1.4. 111 42002E–MCU Wireless–02/2015 Table 9-1. Modulation and Pulse Shaping. Modulation BPSK O-QPSK Note: 1. Chip Rate [kchip/s] Supported Data Rate for PPDU Header [kb/s] Supported Data Rates for PSDU [kb/s] 300 20 20 600 40 400 100 40 Pulse Shaping RC-1.0 (1) RC-1.0 100, 200, 400 SIN and RC-0.2 400 100 1000 250 250, 500 100, 200, 400 (1) , 1000 SIN RC-0.2 1000 250 250, 500 (1) , 1000 RC-0.8 Support of two different spreading codes. 9.1.2 Configuration The PHY mode can be selected by setting appropriate register bits BPSK_OQPSK, SUB_MODE, OQPSK_DATA_RATE, and ALT_SPECTRUM (register 0x0C TRX_CTRL_2), refer to Section 9.1.5. During configuration, the transceiver needs to be in TRX_OFF state. 9.1.3 Symbol Period Within IEEE 802.15.4 and, accordingly, within this document, time references are often specified in units of symbol periods, leading to a PHY mode independent description. Table 9-2 shows the duration of the symbol period. Table 9-2. Duration of the Symbol Period. Modulation PSDU Data Rate [kb/s] Duration of Symbol Period [µs] 20 50 40 25 100, 200, 400 40 250, 500, 1000 16 BPSK O-QPSK Note: 1. For the proprietary High Data Rate Modes, the symbol period is (by definition) the same as the symbol period of the corresponding base mode. 9.1.4 Proprietary High Data Rate Modes The main features are: • High data rates up to 1000kb/s • Support of Basic and Extended Operating Mode • Reduced ACK timing (optional) 9.1.4.1 Overview The Atmel AT86RF212B supports alternative data rates of 200, 400, 500, and 1000kb/s for applications not necessarily targeting IEEE 802.15.4 compliant networks. The High Data Rate Modes utilize the same RF channel bandwidth as the IEEE 802.15.4-2006 sub-1GHz O-QPSK modes. Higher data rates are achieved by using the modified O-QPSK spreading codes having reduced code lengths. The lengths are reduced by the factor of two or by the factor of four. 112 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B For O-QPSK with 400kchip/s, this leads to a data rate of 200kb/s (2-fold) and 400kb/s (4-fold), respectively. For O-QPSK with 1000kchip/s, the resulting data rate is 500kb/s (2-fold) and 1000kb/s (4-fold), respectively. Due to the decreased spreading factor, the sensitivity of the receiver is reduced. Section 12.7, parameter PSENS, shows typical values of the sensitivity for different data rates. 9.1.4.2 High Data Rate Frame Structure In order to allow robust frame synchronization, the Atmel AT86RF212B high data rate modulation is restricted to the PSDU part only. The PPDU header (the preamble, the SFD, and the PHR field) are transmitted with a rate of either 100kb/s or 250kb/s (basic rates), see Figure 9-2. Figure 9-2. High Date Rate Frame Structure. Basic Rate Transmission: 100 kb/s 250 kb/s Preamble High Rate Transmission: {200, 400} kb/s {500, 1000} kb/s SFD PSDU PHR Due to the overhead caused by the PPDU header and the FCS, the effective data rate is less than the selected data rate, depending on the length of the PSDU. A graphical representation of the effective data rate is shown in Figure 9-3. Figure 9-3. Effective Data Rate “B” for O-QPSK High Data Rate Modes. 900 1000kb/s 800 700 B [kb/s] 600 500kb/s 500 400kb/s 250kb/s 400 200kb/s 300 100kb/s 200 100 0 0 20 40 60 80 PSDU length in octets 100 120 Consequently, high data rate transmission is useful for large PSDU lengths due to the higher effective data rate, or in order to reduce the power consumption of the system. 113 42002E–MCU Wireless–02/2015 9.1.4.3 High Date Rate Mode Options Reduced Acknowledgment Time If register bit AACK_ACK_TIME (register 0x17, XAH_CTRL_1) is set, the acknowledgment time is reduced to the duration of two symbol periods for 200 and 400kb/s data rates, and to three symbol periods for 500 and 1000kb/s data rates, refer to Table 7-23. The reduced acknowledgment time is untouched in IEEE 802.15.4. Otherwise, it defaults to 12 symbol periods according to IEEE 802.15.4. Receiver Sensitivity Control The different data rates between PPDU header (SHR and PHR) and PHY payload (PSDU) cause a different sensitivity between header and payload. This can be adjusted by defining sensitivity threshold levels of the receiver. With a sensitivity threshold level set, the Atmel AT86RF212B does not synchronize to frames with an RSSI level below that threshold. Refer to Section 9.2.4 for a configuration of the sensitivity threshold with register bits RX_PDT_LEVEL (register 0x15, RX_SYN). Scrambler For data rates 400kb/s and 1000kb/s, additional chip scrambling is applied per default in order to mitigate data dependent spectral properties. Scrambling can be disabled if register bit OQPSK_SCRAM_EN (register 0x0C, TRX_CTRL_2) is set to zero. Energy Detection The ED measurement time span is eight symbol periods according to IEEE 802.15.4. For frames operated at a higher data rate, the automated measurement duration (see Section 8.5.2) is reduced to two symbol periods taking reduced frame durations into account. This means, the ED measurement time is 80µs for modes 200kb/s and 400kb/s, and 32µs for modes 500kb/s and 1000kb/s. For manually initiated ED measurements in these modes, the measurement time is still eight symbol periods. Carrier Sense For clear channel assessment, IEEE 802.15.4-2006 specifies several modes which may either apply “energy above threshold” or “carrier sense” (CS) or a combination of both. Since signals of the High Data Rate Modes are not compliant to IEEE 802.15.4-2006, CS is not supported when the AT86RF212B is operating in these modes. However, “energy above threshold” is supported. Link Quality Indicator (LQI) For the High Data Rate Modes, the link quality value does not contain useful information and should be discarded. 114 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 9.1.5 Register Description Register 0x0C (TRX_CTRL_2): The TRX_CTRL_2 register is a multi-purpose control register to control various settings of the radio transceiver. Figure 9-4. Register TRX_CTRL_2. Bit 0x0C 7 6 5 4 RX_SAFE_MODE TRX_OFF_AVDD_ EN OQPSK_SCRAM_ EN ALT_SPECTRUM R/W 0 R/W 0 R/W 1 R/W 0 3 2 1 0 BPSK_OQPSK SUB_MODE R/W 0 R/W 1 Read/Write Reset value Bit 0x0C Read/Write Reset value OQPSK_DATA_RATE R/W 0 TRX_CTRL_2 TRX_CTRL_2 R/W 0 • Bit 5 - OQPSK_SCRAM_EN If register bit OQPSK_SCRAM_EN is enabled, an additional chip scrambling for OQPSK is applied for data rate 400kb/s and 1000kb/s. Table 9-3. OQPSK_SCRAM_EN. Register Bits OQPSK_SCRAM_EN Value Description 0 Scrambler is disabled 1 Scrambler is enabled • Bit 4 - ALT_SPECTRUM The register bit ALT_SPECTRUM controls an alternative spectrum for different modes. Table 9-4. ALT_SPECTRUM. Register Bits ALT_SPECTRUM Value Description 0 The alternative spectrum mode is disabled 1 The alternative spectrum mode is enabled BPSK with 40kb/s: If set to zero, a chip sequence according to IEEE 802.15.4 is used. If set to one, a modified chip sequence interoperable with IEEE 802.15.4 is used for TX and RX showing different spectrum properties (to ensure FCC 600kHz bandwidth requirement). This might be beneficial when using an external power amplifier and targeting high output power according to FCC 15.247 [5]. O-QPSK with 400kchip/s: If set to zero, pulse shaping is a combination of half-sine shaping and RC-0.2 shaping according to IEEE 802.15.4. If set to one, pulse shaping is RC-0.2 shaping. This avoids inter-chip interference which results in a significantly lower EVM, refer to Section 12.6. The peak to average ratio increases by about 1dB. O-QPSK with 1000kchip/s: If set to zero, pulse shaping is half-sine shaping. If set to one, pulse shaping is RC-0.8 shaping. Compared with half-sine shaping, side-lobes are reduced at the expense of an increased peak to average ratio (~1dB); refer to Figure 9-11 and Figure 9-12, respectively. This mode is particularly suitable for the Chinese 780MHz band, refer to IEEE 802.15.4c-2009 [3] or IEEE 802.15.4-2011 [4]. 115 42002E–MCU Wireless–02/2015 Notes: 1. The modulation BPSK-40 and modulation BPSK-40-ALT are interoperable together, with some performance degenerations. 2. During reception, this bit is not evaluated within the Atmel AT86RF212B, so it is not explicitly required to align different transceivers with ALT_SPECTRUM in order to assure interoperability. It is very likely that this also holds for any IEEE 802.15.4-2006 compliant O-QPSK transceiver in the 915MHz band, since the IEEE 802.15.4-2006 requirements are fulfilled for both types of shaping. • Bit 3 - BPSK_OQPSK The register bit BPSK_OQPSK controls the modulation scheme. Table 9-5. BPSK_OQPSK. Register Bits Value Description BPSK_OQPSK 0 BPSK modulation is active 1 O-QPSK modulation is active • Bit 2 - SUB_MODE Mode selection for European/North American/(Chinese) band. Table 9-6. SUB_MODE. Register Bits Value Description SUB_MODE 0 BPSK-20, OQPSK-{100,200,400} 1 BPSK-40, OQPSK-{250,500,1000} If set to one (reset value), the chip rate is 1000kchip/s for BPSK_OQPSK = 1 and 600kchip/s for BPSK_OQPSK = 0. It permits data rates out of {250, 500, 1000}kb/s or 40kb/s, respectively. This mode is particularly suitable for the 915MHz band. For O-QPSK transmission, pulse shaping is either half-sine shaping or RC-0.8 shaping, depending on ALT_SPECTRUM. If set to zero, the chip rate is 400kchip/s for BPSK_OQPSK = 1 and 300kchip/s for BPSK_OQPSK = 0. It permits data rates out of {100, 200, 400}kb/s or 20kb/s, respectively. This mode is particularly suitable for the 868.3MHz band. For O-QPSK transmission, pulse shaping is always the combination of half-sine shaping and RC-0.2 shaping. • Bit 1:0 - OQPSK_DATA_RATE A write access to these register bits set the O-QPSK PSDU data rate used by the radio transceiver. The reset value OQPSK_DATA_RATE = 0 is the PSDU data rate according to IEEE 802.15.4. Table 9-7. OQPSK_DATA_RATE. Register Bits OQPSK_DATA_RATE 116 AT86RF212B Value Description 0 SUB_MODE = 0: 100kb/s or SUB_MODE = 1: 250kb/s 1 SUB_MODE = 0: 200kb/s or SUB_MODE = 1: 500kb/s 2 SUB_MODE = 0: 400kb/s or SUB_MODE = 1: 1000kb/s 3 SUB_MODE = 0: Reserved or SUB_MODE = 1: 500kb/s 42002E–MCU Wireless–02/2015 AT86RF212B The Atmel AT86RF212B supports two different modes with an PSDU data rate of 500kb/s. Using OQPSK_DATA_RATE = 3 might be beneficial when using an external power amplifier and targeting high output power according to FCC 15.247 [5]. In Table 9-8 all PHY modes supported by the AT86RF212B are summarized with the relevant setting for each bit of register TRX_CTRL_2. The “-“ (minus) character means that the bit entry is not relevant for the particular PHY mode. Table 9-8. Register 0x0C (TRX_CTRL_2) Bit Alignment. PHY Mode Bits of Register 0x0C Compliance 7 6 5 4 3 2 1 0 BPSK-20 - - - 0 0 0 0 0 IEEE 802.15.4-2003/2006/2011: channel page 0, channel 0 BPSK-40 - - - 0 0 1 0 0 IEEE 802.15.4-2003/2006/2011: channel page 0, channel 1 to 10 BPSK-40-ALT - - - 1 0 1 0 0 Proprietary, alternative spreading code OQPSK-SIN-RC-100 - - - 0 1 0 0 0 IEEE 802.15.4-2006/2011: channel page 2, channel 0 OQPSK-SIN-RC-200 - - - 0 1 0 0 1 Proprietary OQPSK-SIN-RC-400-SCR-ON - - 1 0 1 0 1 0 Proprietary, scrambler on OQPSK-SIN-RC-400-SCR-OFF - - 0 0 1 0 1 0 Proprietary, scrambler off OQPSK-RC-100 - - - 1 1 0 0 0 Proprietary OQPSK-RC-200 - - - 1 1 0 0 1 Proprietary OQPSK-RC-400-SCR-ON - - 1 1 1 0 1 0 Proprietary, scrambler on OQPSK-RC-400-SCR-OFF - - 0 1 1 0 1 0 Proprietary, scrambler off OQPSK-SIN-250 - - - 0 1 1 0 0 IEEE 802.15.4-2006/2011: channel page 2, channel 1 to 10 OQPSK-SIN-500 - - - 0 1 1 0 1 Proprietary OQPSK-SIN-500-ALT - - - 0 1 1 1 1 Proprietary, alternative spreading code OQPSK-SIN-1000-SCR-ON - - 1 0 1 1 1 0 Proprietary, scrambler on OQPSK-SIN-1000-SCR-OFF - - 0 0 1 1 1 0 Proprietary, scrambler off OQPSK-RC-250 - - - 1 1 1 0 0 IEEE 802.15.4-2011: channel page 5, channel 0 to 3 OQPSK-RC-500 - - - 1 1 1 0 1 Proprietary OQPSK-RC-500-ALT - - - 1 1 1 1 1 Proprietary, alternative spreading code OQPSK-RC-1000-SCR-ON - - 1 1 1 1 1 0 Proprietary, scrambler on OQPSK-RC-1000-SCR-OFF - - 0 1 1 1 1 0 Proprietary, scrambler off 117 42002E–MCU Wireless–02/2015 9.2 Receiver (RX) 9.2.1 Overview The Atmel AT86RF212B transceiver is split into an analog radio front-end and a digital domain, see Figure 4-1. Referring to the receiver part of the analog domain, the differential RF signal is amplified by a low noise amplifier (LNA) and split into quadrature signals by a poly-phase filter (PPF). Two mixer circuits convert the quadrature signal down to an intermediate frequency. Channel selectivity is achieved by an integrated band-pass filter (BPF). The subsequent analog-to-digital converter (ADC) samples the receive signal and additionally generates a digital RSSI signal, see Section 6.4. The ADC output is then further processed by the digital baseband receiver (RX BBP), which is part of the digital domain. The BBP performs further filtering and signal processing. In RX_ON state, the receiver searches for the synchronization header. Once the synchronization is established and the SFD is found, the received signal is demodulated and provided to the Frame Buffer. Upon sychronization the receiver performs a state change from RX_ON to BUSY_RX which is indicated by register bits TRX_STATUS (register 0x01, TRX_STATUS). Once the frame is received, the receiver switches back to RX_ON in the listen mode on the selected channel. A similar scheme applies to the Extended Operating Mode. The receiver is designed to handle reference oscillator accuracies up to ±60ppm; refer to Section 12.5, parameter fSRD. This results in the estimation and correction of frequency and symbol rate errors up to ±120ppm. Several status information are generated during the receive process: LQI, ED, and RX_STATUS. They are automatically appended during Frame Read Access, refer to Section 6.3.2. Some information is also available through register access, for example ED_LEVEL (register 0x07, PHY_ED_LEVEL) and FCS correctness RX_CRC_VALID (register 0x06, PHY_RSSI). The Extended Operating Mode of the AT86RF212B supports frame filtering and pending data indication. 9.2.2 Frame Receive Procedure The frame receive procedure, including the radio transceiver setup for reception and reading PSDU data from the Frame Buffer, is described in Section 10.1 Frame Receive Procedure. 9.2.3 Configuration In Basic Operating Mode, the receiver is enabled by writing command RX_ON to register bits TRX_CMD (register 0x02, TRX_STATE) in states TRX_OFF or PLL_ON. In Extended Operating Mode, the receiver is enabled for RX_AACK operation from state PLL_ON by writing the command RX_AACK_ON. There is no additional configuration required to receive IEEE 802.15.4 compliant frames in Basic Operating Mode. However, the frame reception in the Atmel AT86RF212B Extended Operating Mode requires further register configurations, for details refer to Section 7.2.2. For specific applications, the receiver can additionaly be configured to handle critical environment to simplify the interaction with the microcontroller, or to operate in different data rates. 118 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B There are scenarios where CSMA-CA is not used before a transmission or where CSMA-CA is not really reliable, for example in hidden node scenarios. As two transceivers compete for the use of one channel they may interfere with each other which may produce unreliable transmission. Receiver Override can be used to cope with such scenarios. The level of interference (which can be caused by a new incoming frame) is continuously measured while decoding a frame. The synchronization to the potential new frame starts if the interference level does not allow for a reliable detection. The Atmel AT86RF212B receiver has an outstanding sensitivity performance. At certain environmental conditions or for High Data Rate Modes, refer to Section 9.1.4, it may be useful to manually decrease this sensitivity. This is achieved by adjusting the synchronization header detector threshold using register bits RX_PDT_LEVEL (register 0x15, RX_SYN). Received signals with a RSSI value below the threshold do not activate the demodulation process. Furthermore, at times it may be useful to protect a received frame against overwriting by a new subsequent data frame, when the receive data buffer has not been read on time. A Dynamic Frame Buffer Protection is enabled with register bit RX_SAFE_MODE (register 0x0C, TRX_CTRL_2) set, see Section 11.7. The receiver remains in RX_ON or RX_AACK_ON state until the whole frame is uploaded by the microcontroller, indicated by pin 23 (/SEL) = H during the SPI Frame Receive Mode. The Frame Buffer content is only protected if the FCS is valid. A Static Frame Buffer Protection is enabled with register bit RX_PDT_DIS (register 0x15, RX_SYN) set. The receiver remains in RX_ON or RX_AACK_ON state and no further SHR is detected until the register bit RX_PDT_DIS is set back. 9.2.4 Register Description Register 0x15 (RX_SYN): The register RX_SYN controls parameters related to the synchronization unit of the receiver. Figure 9-5. Register RX_SYN. Bit 0x15 7 6 5 RX_PDT_DIS Read/Write Reset value Bit RX_OVERRIDE R/W 0 R/W 0 3 2 0x15 Read/Write Reset value 4 RX_SYN R/W 0 R/W 0 1 0 R/W 0 R/W 0 RX_PDT_LEVEL R/W 0 R/W 0 RX_SYN • Bit 7 - RX_PDT_DIS The register bit RX_PDT_DIS prevents the reception of a frame during RX phase. Table 9-9. RX_PDT_DIS. Register Bits Value Description RX_PDT_DIS 0 RX path is enabled 1 RX path is disabled RX_PDT_DIS = 1 prevents the reception of a frame even if the radio transceiver is in receive modes. An ongoing frame reception is not affected. This operation mode is independent of the setting of register bits RX_PDT_LEVEL. 119 42002E–MCU Wireless–02/2015 • Bit 6:4 - RX_OVERRIDE The register bits RX_OVERRIDE control the RXO functions during RX phase. During the receive process the validity of the current frame and the occurrence of a strong interferer is checked continuously. In either of those cases the reception is automatically restarted to increase the overall system availability and throughput with respect to correct received packets. Table 9-10. RX_OVERRIDE. Register Bits RX_OVERRIDE Value Description 0 (1) All RX override functions are disabled (default) 6 (2) IPAN scanning is enabled, 9dB Energy Detection (ED) check is enabled, Link Quality (LQ) check is enabled All other values are reserved Notes: 1. Frames are decoded up to the length specified in the PHR field, independent of any interference while receiving this frame. 2. Detection of strong interference while receiving a frame (where the frame is destroyed anyway) and fast re-synchronization to a potential new frame. 3. There is no TRX_END interrupt for an ongoing frame reception when resynchronization is forced by strong interference. The Receiver Override can be used without performance degradation in combination with any modulation scheme and data rate. • Bit 3:0 - RX_PDT_LEVEL The register bits RX_PDT_LEVEL desensitize the receiver in steps of 3.1dB. Table 9-11. RX_PDT_LEVEL. Register Bits Value Description RX_PDT_LEVEL 0x00 Maximum RX sensitivity 0x0F RX input level > RSSI_BASE_VAL + 3.1[dB] x 14 These register bits desensitize the receiver such that frames with an RSSI level below the RX_PDT_LEVEL threshold level (if RX_PDT_LEVEL > 0) are not received. For a RX_PDT_LEVEL > 0 value the threshold level can be calculated according to the following formula: PRF[dBm] > RSSIBASE_VAL[dBm] + 3.1[dB] x (RX_PDT_LEVEL - 1). The RSSIBASE_VAL is described in Section 8.4.3. If register bits RX_PDT_LEVEL = 0 (reset value) all frames with a valid SHR and PHR are received, independently of their signal strength. If register bits RX_PDT_LEVEL > 0, the current consumption of the receiver in all RX listening states is reduced by 500µA, refer to parameter IRX_ON in Section 12.8. 120 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 9.3 Transmitter (TX) 9.3.1 Overview The Atmel AT86RF212B transmitter utilizes a direct up-conversion topology. The digital transmitter (TX BBP) generates the in-phase (I) and quadrature (Q) component of the modulation signal. A digital-to-analog converter (DAC) forms the analog modulation signal. A quadrature mixer pair converts the analog modulation signal to the RF domain. The power amplifier (PA) provides signal power delivered to the differential antenna pins (RFP, RFN). Both, the LNA of the receiver input and the PA of the transmitter output are internally connected to the bidirectional differential antenna pins so that no external antenna switch is needed. Using the default settings, the PA incorporates an equalizer to improve its linearity. The enhanced linearity keeps the spectral side lobes of the transmit spectrum low in order to meet the requirements of the European 868.3MHz band. If the PA boost mode is turned on, the equalizer is disabled. This allows to deliver a higher transmit power of up to +11dBm at the cost of higher spectral side lobes and higher harmonic power. In Basic Operating Mode, a transmission is started from PLL_ON state by either writing TX_START to register bits TRX_CMD (register 0x02, TRX_STATE) or by a rising edge of pin 11 (SLP_TR). In Extended Operating Modes, a transmission might be started automatically depending on the transaction phase of either RX_AACK or TX_ARET, refer to Section 7.2. 9.3.2 Frame Transmit Procedure The frame transmit procedure, including writing PSDU data into the Frame Buffer and initiating a transmission, is described in Section 10.2. 9.3.3 Spectrum Masks The AT86RF212B can be operated in different frequency bands, using different power levels, modulation schemes, chip rates, and pulse shaping filters. The occupied bandwidth of the transmit signal depends on the chosen mode of operation. Values listed in Table 9-12 are based on a default power setting of +5dBm and usage of the Continuous Transmission Test Mode with Frame Buffer content {0x01, 0x00}, refer to Appendix A – Continuous Transmission Test Mode on page 203. Knowledge of modulation bandwidth, power spectrum, and side lobes is essential for proper system setup that produces non-overlapping channel spacing. 121 42002E–MCU Wireless–02/2015 Table 9-12. Physical Layer Mode and Occupied Bandwidth. PHY Mode 99% Occupied Bandwidth [kHz] 6dB Bandwidth [kHz] 20dB Bandwidth [kHz] ETSI EN 300 220 [6] RMS 2 MHz 100 kHz 1 MHz 500 ms FCC 15.247 [5] Peak/MaxHold 2 MHz 5 % of bandwidth 3 x RBW AUTO FCC 15.247 [5] Peak/MaxHold 2 MHz 1% of bandwidth 3 x RBW AUTO BPSK-20 445 295 430 BPSK-40 775 570 850 BPSK-40-ALT 805 620 815 OQPSK-SIN-RC-100 450 260 340 OQPSK -RC-100 490 355 365 OQPSK-SIN-250 1190 645 1210 OQPSK-RC-250 1245 850 1220 Reference Detector Span RBW VBW Sweep Figure 9-6 to Figure 9-12 show power spectra for different modes listed in Table 9-12. The spectra were captured using default settings of Atmel AT86RF212B. The resolution bandwidth of the spectrum analyzer was set to 30kHz; the video bandwidth was set to 10kHz. For the OQPSK-SIN-250 modulation and OQPSK-RC-250 modulation the resolution bandwidth of the spectrum analyzer was set to 100kHz; the video bandwidth was set to 30kHz. Figure 9-6. Spectrum of BPSK-20. 0 -10 Power [dBm] -20 -30 -40 -50 -60 -70 912 913 913 914 914 915 915 916 916 Frequency [MHz] 122 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 9-7. Spectrum of BPSK-40. 0 -10 Power [dBm] -20 -30 -40 -50 -60 -70 912 913 913 914 914 915 915 916 916 915 916 916 Frequency [MHz] Figure 9-8. Spectrum of BPSK-40-ALT. 0 -10 Power [dBm] -20 -30 -40 -50 -60 -70 912 913 913 914 914 915 Frequency [MHz] 123 42002E–MCU Wireless–02/2015 Figure 9-9. Spectrum of OQPSK-SIN-RC-100. 0 -10 Power [dBm] -20 -30 -40 -50 -60 -70 912 913 913 914 914 915 915 916 916 915 916 916 Frequency [MHz] Figure 9-10. Spectrum of OQPSK-RC-100. 0 -10 Power [dBm] -20 -30 -40 -50 -60 -70 912 913 913 914 914 915 Frequency [MHz] 124 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 9-11. Spectrum of OQPSK-SIN-250. 0 -10 Power [dBm] -20 -30 -40 -50 -60 -70 910 912 914 916 918 916 918 Frequency [MHz] Figure 9-12. Spectrum of OQPSK-RC-250. 0 -10 Power [dBm] -20 -30 -40 -50 -60 -70 910 912 914 Frequency [MHz] 125 42002E–MCU Wireless–02/2015 Figure 9-6 to Figure 9-12 illustrate typical spectra of the transmitted signals of the Atmel AT86RF212B and do not claim any limits. Refer to the local authority bodies (FCC, ETSI, etc.) for further details about definition of power spectral density masks, definition of spurious emission, allowed modulation bandwidth, transmit power, and its limits. 9.3.4 TX Output Power The maximum output power of the transmitter is typically +5dBm in normal mode and +11dBm in boost mode. The TX output power can be set via register bits TX_PWR (register 0x05, PHY_TX_PWR). The output power of the transmitter can be controlled down to -25dBm with 1dB resolution. To meet the spectral requirements of the European and Chinese bands, it is necessary to limit the TX power by appropriate setting of register bits TX_PWR, GC_PA (register 0x05, PHY_TX_PWR), and GC_TX_OFFS (register 0x16, RF_CTRL_0). See Table 9-15 and Table 9-18. for recommended values. 9.3.5 TX Power Ramping To optimize the output power spectral density (PSD), individual transmitter blocks are enabled sequentially. A transmit action is started by either the rising edge of pin 11 (SLP_TR) or by writing TX_START command to register bits TRX_CMD (register 0x02, TRX_STATE). One symbol period later the data transmission begins. During this time period, the PLL settles to the frequency used for transmission. The PA is enabled prior to the data transmission start. This PA lead time can be adjusted with the register bits PA_LT (register 0x16, RF_CTRL_0). The PA is always enabled at the lowest gain value corresponding to GC_PA = 0. Then the PA gain is increased automatically to the value set by GC_PA (register 0x05, PHY_TX_PWR). After transmission is completed, TX power ramping down is performed in an inverse order. The control signals associated with TX power ramping are shown in Figure 9-13. In this example, the transmission is initiated with the rising edge of pin 11 (SLP_TR). The radio transceiver state changes from PLL_ON to BUSY_TX. Figure 9-13. TX Power Ramping Example (O-QPSK 250kb/s Mode). 0 4 2 6 8 10 12 16 14 18 Length [μs] SLP_TR State PLL_ON BUSY_TX PA PA_LT TX Data Modulation Using an external RF front-end (refer to Section 11.4), it may be required to adjust the startup time of the external PA relative to the internal building blocks to optimize the overall PSD. This can be achieved using register bits PA_LT (register 0x16, RF_CTRL_0). 126 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 9.3.6 Register Description Register 0x05 (PHY_TX_PWR): The PHY_TX_PWR register controls the output power of the transmitter. Figure 9-14. Register PHY_TX_PWR. Bit 0x05 Read/Write Reset value Bit 7 6 5 PA_BOOST GC_PA R/W 0 R/W 1 3 2 0x05 Read/Write Reset value 4 TX_PWR R/W 1 R/W 0 1 0 R/W 0 R/W 0 TX_PWR R/W 0 R/W 0 PHY_TX_PWR PHY_TX_PWR • Bit 7 - PA_BOOST The register bit PA_BOOST increases transmit gain by 5dB. Table 9-13. PA_BOOST. Register Bits PA_BOOST Value Description 0 PA boost mode is disabled 1 PA boost mode is enabled This register bit enables the PA boost mode where the TX output power is increased by approximately 5dB when PA_BOOST = 1. In PA boost mode, the PA linearity is decreased compared to the normal mode when PA_BOOST = 0. This leads to higher spectral side lobes of the TX power spectrum and higher power of the harmonics. Consequently, the higher TX power settings do not fulfill the regulatory requirements of the European 868.3MHz band regarding spurious emissions in adjacent frequency bands (see ETSI EN 300 220-1, ERC/REC 70-03, and ERC/DEC/(01)04). • Bit 6:5 - GC_PA The register bits GC_PA control the PA gain. Table 9-14. GC_PA. Register Bits GC_PA Value Description 0 -2.9dB 1 -1.3dB 2 -0.9dB 3 0dB These register bits control the gain of the PA by changing its bias current. GC_PA needs to be set in TRX_OFF mode only. It can be used to reduce the supply current in TX mode when a reduced TX power is selected with the TX_PWR control word. A reduced PA bias current causes lower RF gain and lowers the 1dB compression point of the PA. Hence, it is advisable to use a reduced bias current of the PA only in combination with lower values of TX_PWR. A reasonable combination of register bits TX_PWR and GC_PA is shown in Table 9-15. 127 42002E–MCU Wireless–02/2015 • Bit 4:0 – TX_PWR The register bits TX_PWR determine the TX output power of the radio transceiver. These register bits control the transmitter output power measured at pins RFP/RFN. The value of TX_PWR describes the power reduction relative to the maximum output power. The resolution is 1dB per step. Since TX_PWR adjusts the gain in the TX path prior to the PA, the PA bias setting is not optimal for increased values of TX_PWR regarding PA efficiency. The PA power efficiency can be improved when PA bias is reduced (decreased GC_PA value) along with the TX power setting (increased TX_PWR value). A recommended combination of TX power control (TX_PWR), PA bias control (GC_PA), and PA boost mode (PA_BOOST) is listed in Table 9-15. It is a recommended mapping of intended TX power to the 8-bit word in register 0x05 (PHY_TX_PWR). Table 9-15. Recommended Mapping PHY_TX_PWR (register 0x05). of TX Power, Frequency Band, and PHY_TX_PWR (register 0x05) TX Power [dBm] 128 AT86RF212B 915MHz North American Band 868.3MHz European Band 780MHz Chinese Band PHY Modes: BPSK-40 (GC_TX_OFFS=3), BPSK-40-ALT (GC_TX_OFFS=3), OQPSK-SIN{250,500,1000} (GC_TX_OFFS=2) PHY Modes: BPSK-20 (GC_TX_OFFS=3), OQPSK-SIN-RC{100,200,400} (GC_TX_OFFS=2) OQPSK-RC-{100,200,400} (GC_TX_OFFS=3) PHY Modes: OQPSK-RC{250,500,1000} (GC_TX_OFFS=2) 11 0xC0 0xA0 0xC1 10 0xC1 0x80 0xE3 9 0x80 0xE4 0xE4 8 0x82 0xE6 0xC5 7 0x83 0xE7 0xE7 6 0x84 0xE8 0xE8 5 0x40 0xE9 0xE9 4 0x86 0xEA 0xEA 3 0x00 0xCB 0xCB 2 0x01 0xCC 0xCC 1 0x02 0xCD 0xCD 0 0x03 0xAD 0xCE -1 0x04 0x47 0xCF -2 0x27 0x48 0xAF -3 0x05 0x49 0x26 -4 0x07 0x29 0x27 Note 1 Note 2 42002E–MCU Wireless–02/2015 AT86RF212B PHY_TX_PWR (register 0x05) -5 0x08 0x90 0x28 -6 0x91 0x91 0x29 -7 0x09 0x93 0x07 -8 0x0B 0x94 0x08 -9 0x0C 0x2F 0x09 -10 0x0D 0x30 0x0A -11 0x0E 0x31 0x0B -12 0x0F 0x0F 0x0C -13 0x10 0x10 0x0D -14 0x11 0x11 0x0E -15 0x12 0x12 0x0F -16 0x13 0x13 0x10 -17 0x14 0x14 0x11 -18 0x15 0x15 0x13 -19 0x16 0x17 0x14 -20 0x17 0x18 0x15 -21 0x19 0x19 0x16 -22 0x1A 0x1A 0x17 -23 0x1B 0x1B 0x18 -24 0x1C 0x1C 0x19 -25 0x1D 0x1D 0x1A Notes: 1. Spectral side lobes remain < -54dBm / 100kHz measured with an RMS detector outside Fc ± 3MHz. Power settings may be used at channel 1 and 2 according to IEEE802.15.4c. 2. Spectral side lobes remain < -54dBm / 100kHz measured with an RMS detector outside Fc ± 1MHz. Power settings may be used at channel 0 and 3 according to IEEE802.15.4c. Values of Table 9-15 are based on a mode dependent setting of register bits GC_TX_OFFS (register 0x16, RF_CTRL_0) which is shown in Table 9-18. 129 42002E–MCU Wireless–02/2015 Register 0x16 (RF_CTRL_0): The register RF_CTRL_0 contains control settings to configure the transmit path. Figure 9-15. Register RF_CTRL_0. Bit 7 0x16 Read/Write Reset value Bit R/W 0 3 0x16 Read/Write Reset value 6 5 PA_LT R/W 0 R/W 1 2 1 reserved R/W 0 4 reserved RF_CTRL_0 R/W 1 0 GC_TX_OFFS R/W 0 R/W 0 RF_CTRL_0 R/W 1 • Bit 7:6 - PA_LT The register bits PA_LT control lead time of the PA (relative to first chip of TX data). Table 9-16. PA_LT. Register Bits Value PA_LT Description 0 2µs 1 4µs 2 6µs 3 8µs These register bits control the lead time of the PA enable signal relative to the TX data start, see Figure 9-13. This allows to enable the PA 2, 4, 6, or 8µs before the transmit signal starts. The PA enable signal can also be output at differential pin pair DIG3/DIG4 to provide a control signal for an external RF front-end; for details, refer to Section 11.4. • Bit 1:0 - GC_TX_OFFS The register bits GC_TX_OFFS control the TX power offset. Table 9-17. GC_TX_OFFS. Register Bits Value Description GC_TX_OFFS 1 0dB 2 +1dB 3 +2dB All other values are reserved These register bits provide an offset between the TX power control word TX_PWR (register 0x05, PHY_TX_PWR) and the actual TX power. This 2-bit word is added to the TX power control word before it is applied to the circuit block which adjusts the TX power. It can be used to compensate differences of the average TX power depending of the modulation format, see Table 9-18. Table 9-18. Mode-dependent setting of GC_TX_OFFS. Mode GC_TX_OFFS BPSK O-QPSK 3 2 Exception for OQPSK-RC-{100,200,400}, see Table 9-15. 130 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 9-16 shows supply currents for O-QPSK modulation based on Table 9-15. Figure 9-16. Supply Currents for O-QPSK Modulation depending on TX Power Setting (according to Table 9-15). 26.0 24.0 Supply Current [mA] 22.0 20.0 18.0 16.0 14.0 North America EU 12.0 China 10.0 -11 -9 -7 -5 -3 -1 1 3 5 7 9 11 TX Power [dBm] The North American mapping table is optimized for lowest supply current. The more relaxed spectral side lobe requirements of the IEEE 802.15.4 standard are fulfilled. The European mapping tables take into account that linearity is needed to keep the outof-band spurious emissions below the ETSI requirements, refer to [6]. Regulatory requirements with respect to power density (depending on the frequency band used) are not considered, refer to [7]. The European mapping takes more supply current than the North American map and uses the normal (linearized) PA mode to provide medium output power up to 3dBm for OQPSK-SIN-RC-{100/200/400} modes and 6dBm for BPSK-20 mode. The Chinese mapping uses the boost mode to provide higher TX power levels at the expense of higher supply current. As a result, the maximum TX power is 11dBm for OQPSK-RC-{250/500) modes. Due to great regional distinctions of regulatory requirements, it is not possible to cover all restrictions in this datasheet. Manufactures must take the responsibility to check measurement results against the latest regulations of nations into which they market. 131 42002E–MCU Wireless–02/2015 9.4 Frame Buffer The Atmel AT86RF212B contains a 128 byte dual port SRAM. One port is connected to the SPI interface, the other one to the internal transmitter and receiver modules. For data communication, both ports are independent and simultaneously accessible. The Frame Buffer utilizes the SRAM address space 0x00 to 0x7F for RX and TX operation of the radio transceiver and can keep a single IEEE 802.15.4 RX or a single TX frame of maximum length at a time. Frame Buffer access modes are described in Section 6.3.2. Frame Buffer access conflicts are indicated by an underrun interrupt IRQ_6 (TRX_UR). Note: 1. The IRQ_6 (TRX_UR) interrupt also occurs on the attempt to write frames longer than 127 octets to the Frame Buffer (overflow). In that case the content of the Frame Buffer cannot be guaranteed. Frame Buffer access is only possible if the digital voltage regulator (DVREG) is turned on. This is valid in all device states except in SLEEP state. An access in P_ON state is possible if pin 17 (CLKM) provides the 1MHz master clock. 9.4.1 Data Management Data in Frame Buffer (received data or data to be transmitted) remains valid as long as: • No new frame or other data are written into the buffer over SPI • No new frame is received (in any BUSY_RX state) • No state change into SLEEP state is made • No RESET took place By default, there is no protection of the Frame Buffer against overwriting. Therefore, if a frame is received during Frame Buffer read access of a previously received frame, interrupt IRQ_6 (TRX_UR) is issued and the stored data might be overwritten. Even so, the old frame data can be read, if the SPI data rate is higher than the effective over air data rate. For a data rate of 250kb/s, a minimum SPI clock rate of 1MHz is recommended. Finally, the microcontroller should check the transferred frame data integrity by an FCS check. To protect the Frame Buffer content against being overwritten by newly incoming frames, the radio transceiver state should be changed to PLL_ON state after reception. This can be achieved by writing immediately the command PLL_ON to register bits TRX_CMD (register 0x02, TRX_STATE) after receiving the frame, indicated by IRQ_3 (TRX_END). Alternatively, Dynamic Frame Buffer Protection can be used to protect received frames against overwriting; for details, refer to Section 11.7. Both procedures do not protect the Frame Buffer from overwriting by the microcontroller. In Extended Operating Mode during TX_ARET operation (see Section 7.2.4), the radio transceiver switches to receive state if an acknowledgement of a previously transmitted frame was requested. During this period, received frames are evaluated but not stored in the Frame Buffer. This allows the radio transceiver to wait for an acknowledgement frame and retry the frame transmission without writing the frame again. A radio transceiver state change, except a transition to SLEEP state or a reset, does not affect the Frame Buffer content. If the radio transceiver is taken into SLEEP, the Frame Buffer is powered off and the stored data get lost. 132 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 9.4.2 User accessible Frame Content The Atmel AT86RF212B supports an IEEE 802.15.4 compliant frame format as shown in Figure 9-17. Figure 9-17. AT86RF212B Frame Structure. 0 Frame Duration Access Length [octets] 4 5 Preamble Sequence SFD 4 octets 1 SHR not accessible, PHY generated 6 PHR n+3 Payload n+5 FCS n+6 LQI n octets (n 0 before changing the register bits CLKM_CTRL), the new clock rate is supplied when leaving the SLEEP state the next time. To reduce power consumption and spurious emissions, it is recommended to turn off the CLKM clock when not in use or to reduce its driver strength to a minimum, refer to Section 1.3. Note: 1. During reset procedure, see Section 7.1.4.5, register bits CLKM_CTRL are shadowed. Although the clock setting of CLKM remains after reset, a read access to register bits CLKM_CTRL delivers the reset value one. For that reason, it is recommended to write the previous configuration (before reset) to register bits CLKM_CTRL (after reset) to align the radio transceiver behavior and register configuration. Otherwise, the CLKM clock rate is set back to the reset value (1MHz) after the next SLEEP cycle. For example, if the CLKM clock rate is configured to 16MHz, the CLKM clock rate remains at 16MHz after a reset, however, the register bits CLKM_CTRL are set back to one. Since CLKM_SHA_SEL reset value is one, the CLKM clock rate changes to 1MHz after the next SLEEP cycle if the CLKM_CTRL setting is not updated. 9.7.5 Clock Jitter The Atmel AT86RF212B provides receiver sensitivities up to -110dBm. Detection of such small RF signals requires very clean scenarios with respect to noise and interference. Harmonics of digital signals may degrade the performance if they interfere with the wanted RF signal. A small clock jitter of digital signals can spread harmonics over a wider frequency range, thus reducing the power of certain spectral lines. AT86RF212B provides such a clock jitter as an optional feature. The jitter module is working for the receiver part and all I/O signals, for example CLKM if enabled. The transmitter part and RF frequency generation are not influenced. 9.7.6 Register Description Register 0x03 (TRX_CTRL_0): The TRX_CTRL_0 register controls the driver current of the digital output pads and the CLKM clock rate. Figure 9-26. Register TRX_CTRL_0. Bit 7 0x03 Read/Write Reset value Bit 0x03 Read/Write Reset value 144 AT86RF212B 6 5 PAD_IO R/W 0 R/W 0 3 2 CLKM_SHA_SEL R/W 1 4 PAD_IO_CLKM TRX_CTRL_0 R/W 0 R/W 1 1 0 CLKM_CTRL R/W 0 R/W 0 TRX_CTRL_0 R/W 1 42002E–MCU Wireless–02/2015 AT86RF212B • Bit 5:4 - PAD_IO_CLKM These register bits set the output driver current of pin CLKM. It is recommended to reduce the driver strength to 2mA (PAD_IO_CLKM = 0) if possible. This reduces power consumption and spurious emissions. Table 9-27. PAD_IO_CLKM. Register Bits Value PAD_IO_CLKM Description 0 2mA 1 4mA 2 6mA 3 8mA • Bit 3 - CLKM_SHA_SEL The register bit CLKM_SHA_SEL defines whether a new clock rate (defined by CLKM_CTRL) is set immediately or gets effective after the next SLEEP cycle. Table 9-28. CLKM_SHA_SEL. Register Bits Value CLKM_SHA_SEL Description 0 CLKM clock rate change appears immediately 1 CLKM clock rate change appears after SLEEP cycle • Bit 2:0 - CLKM_CTRL The register bits CLKM_CTRL set the clock rate of pin 17 (CLKM). Table 9-29. CLKM_CTRL. Register Bits Value CLKM_CTRL 0 No clock at pin 17 (CLKM), pin set to logic low 1 1MHz 2 2MHz 3 4MHz 4 8 MHz 5 16MHz 6 250kHz 7 IEEE 802.15.4 symbol rate frequency Note: 1. Description If a clock rate is selected between 1MHz and 16MHz and pin SLP_TR is set to logic high in state TRX_OFF, the TRX delivers additional 35 clock cycles before entering state SLEEP. The CLKM_CTRL setting seven has special behavior, for details refer to Table 9-30. 145 42002E–MCU Wireless–02/2015 Table 9-30. IEEE 802.15.4 symbol rate frequencies. (1) (1) BPSK_OQPSK Note: SUB_MODE Frequency 0 0 20kHz 0 1 40kHz 1 0 25kHz 1 1 62.5kHz 1. Refer to Section 9.1.5. Register 0x0A (RX_CTRL): The register RX_CTRL configures the clock jitter module. Figure 9-27. Register RX_CTRL. Bit 7 0x0A 6 reserved Read/Write Reset value Bit R/W 0 R/W 0 3 2 0x0A 5 4 JCM_EN reserved R/W 0 R/W 1 1 0 R/W 1 R/W 1 reserved Read/Write Reset value R/W 0 R/W 1 RX_CTRL RX_CTRL • Bit 5 - JCM_EN The register bit JCM_EN controls digital clock jitter module. Table 9-31. JCM_EN. Register Bits JCM_EN Note: 146 AT86RF212B 1. Value Description 0 Digital clock jitter module is disabled 1 Digital clock jitter module is enabled JCM_EN will be always disabled within transmitting and filter tuning. 42002E–MCU Wireless–02/2015 AT86RF212B Register 0x12 (XOSC_CTRL): The XOSC_CTRL register controls the operation of the crystal oscillator. Figure 9-28. Register XOSC_CTRL. Bit 7 6 0x12 Read/Write Reset value Bit R/W 1 R/W 1 3 2 0x12 Read/Write Reset value 5 4 R/W 1 R/W 1 1 0 R/W 0 R/W 0 XTAL_MODE XOSC_CTRL XTAL_TRIM R/W 0 R/W 0 XOSC_CTRL • Bit 7:4 - XTAL_MODE The register bits XTAL_MODE set the operating mode of the crystal oscillator. Table 9-32. XTAL_MODE. Register Bits Value XTAL_MODE 0x4 Description Internal crystal oscillator disabled, use external reference frequency 0xF Internal crystal oscillator enabled and XOSC voltage regulator enabled All other values are reserved For normal operation the default value is set to XTAL_MODE = 0xF after reset. Using an external clock source it is recommended to set XTAL_MODE = 0x4. • Bit 3:0 - XTAL_TRIM The register bits XTAL_TRIM control internal capacitance arrays connected to pin 26 (XTAL1) and pin 25 (XTAL2). Table 9-33. XTAL_TRIM. Register Bits XTAL_TRIM Value 0x0 Description A capacitance value in the range from 0pF to 4.5pF is selectable with a resolution of 0.3pF. Valid values are [0xF, 0xE, …, 0x0]. 147 42002E–MCU Wireless–02/2015 9.8 Frequency Synthesizer (PLL) The main PLL features are: • Generate RX/TX frequencies for all supported channels • Autonomous calibration loops for stable operation within the operating range • Two PLL interrupts for status indication • Fast PLL settling to support frequency hopping 9.8.1 Overview The PLL generates the RF frequencies for the Atmel AT86RF212B. During receive and transmit operations, the frequency synthesizer operates as a local oscillator. The frequency synthesizer is implemented as a fractional-N PLL with analog compensation of the fractional phase error. The voltage-controlled oscillator (VCO) is running at double of the RF frequency. Two calibration loops ensure correct PLL functionality within the specified operating limits. 9.8.2 RF Channel Selection The PLL is designed to support: • One channel in the European SRD band from 863MHz to 870MHz at 868.3MHz according to IEEE 802.15.4 (channel k = 0) • 10 channels in the North American ISM band from 902MHz to 928MHz with a channel spacing of 2MHz according to IEEE 802.15.4. The center frequency of these channels is defined as: Fc[MHz] = 906[MHz] + 2[MHz] x (k – 1), for k = 1, 2, ..., 10 where k is the channel number. • Four channels in the Chinese WPAN band from 779MHz to 787MHz with a channel spacing of 2MHz according to IEEE 802.15.4c-2009 and IEEE 802.15.4-2011. Center frequencies are 780MHz, 782MHz, 784MHz, and 786MHz. Additionally, the PLL supports all frequencies from 769MHz to 935MHz with 1MHz frequency spacing and four bands with 100kHz spacing from 769.0MHz to 794.5MHz, 857.0MHz to 882.5MHz, and 902.0MHz to 928.5MHz. The frequency is selected by register bits CC_BAND (register 0x14, CC_CTRL_1) and register bits CC_NUMBER of (register 0x13, CC_CTRL_0). 148 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Table 9-34 shows the settings of CC_BAND and CC_NUMBER. Table 9-34. Frequency Bands and Numbers. CC_BAND 0 CC_NUMBER Description Not used European and North American channels according to IEEE 802.15.4; Frequency selected by register bits CHANNEL (register 0x08, PHY_CC_CCA), refer to Section 9.8.6 1 0x00 – 0xFF 769.0MHz – 794.5MHz Fc [MHz] = 769.0[MHz] + 0.1[MHz] x CC_NUMBER 2 0x00 – 0xFF 857.0MHz – 882.5MHz Fc [MHz] = 857.0[MHz] + 0.1[MHz] x CC_NUMBER 3 0x00 – 0xFF 903.0MHz – 928.5MHz Fc [MHz] = 903.0[MHz] + 0.1[MHz] x CC_NUMBER 4 0x00 – 0x5E 769MHz – 863MHz Fc [MHz] = 769[MHz] + 1[MHz] x CC_NUMBER 5 0x00 – 0x66 833MHz – 935MHz Fc [MHz] = 833[MHz] + 1[MHz] x CC_NUMBER 6 0x00 – 0xFF 902.0MHz – 927.5MHz Fc [MHz] = 902.0[MHz] + 0.1[MHz] x CC_NUMBER 7 0x00 – 0xFF Reserved 9.8.3 PLL Settling Time and Frequency Agility When the PLL is enabled during state transition from TRX_OFF to PLL_ON or RX_ON, the settling time is typically tTR4 = 170µs, including PLL self calibration. For more information, refer to Table 7-2 and Section 9.8.4. A lock of the PLL is indicated with an interrupt IRQ_0 (PLL_LOCK). Switching between channels within a frequency band in PLL_ON or RX_ON states is typically done within tPLL_SW = 11µs. This makes the radio transceiver highly suitable for frequency hopping applications. The PLL frequency in PLL_ON and receive states is 1MHz below the PLL frequency in transmit states. When starting the transmit procedure, the PLL frequency is changed to the transmit frequency within a period of tRX_TX = 16µs before really starting the transmission. After the transmission, the PLL settles back to the receive frequency within a period of tTX_RX = 32µs. This frequency step does not generate an interrupt IRQ_0 (PLL_LOCK) or IRQ_1 (PLL_UNLOCK) within these periods. 9.8.4 Calibration Loops Due to variation of temperature, supply voltage and part-to-part variations of the radio transceiver the VCO characteristics may vary. To ensure a stable operation, two automated control loops are implemented, center frequency (CF) tuning and delay cell (DCU) calibration. Both calibration loops are initiated automatically when the PLL is enabled during state transition from TRX_OFF to PLL_ON or RX_ON state. Additionally, both calibration loops are initiated when the PLL changes to a different frequency setting. If the PLL operates for a long time on the same channel, for example more than five minutes, or the operating temperature changes significantly, it is recommended to initiate the calibration loops manually. Both Atmel AT86RF212B calibration loops can be initiated manually by SPI command. To start the calibration, the device should be in state PLL_ON. The center frequency 149 42002E–MCU Wireless–02/2015 calibration can be initiated by setting PLL_CF_START = 1 (register 0x1A, PLL_CF). The calibration loop is completed when the IRQ_0 (PLL_LOCK) occurs, if enabled. The duration of the center frequency calibration loop depends on the difference between the current CF value and the final CF value. During the calibration, the CF value is incremented or decremented. Each step takes tPLL_CF = 8µs. The minimum time is 8µs; the maximum time is 270µs. The recommended procedure to start the center frequency calibration is to read the register 0x1A (PLL_CF), to set the PLL_CF_START register bit to one, and to write the value back to the register. The delay cell calibration can be initiated by setting the bit PLL_DCU_START of register 0x1B (PLL_DCU) to one. The delay time of the programmable delay unit is adjusted to the correct value. The calibration works as successive approximation and is independent of the values in the register 0x1B (PLL_DCU). The duration of the calibration is tPLL_DCU = 10µs. During both calibration processes, no correct receive or transmit operation is possible. The recommended state for the calibration is therefore PLL_ON, but calibration is not blocked at receive or transmit states. Both calibrations can be executed concurrently. 9.8.5 Interrupt Handling Two different interrupts indicate the PLL status (refer to register 0x0F). IRQ_0 (PLL_LOCK) indicates that the PLL has locked. IRQ_1 (PLL_UNLOCK) interrupt indicates an unexpected unlock condition. A PLL_LOCK interrupt clears any preceding PLL_UNLOCK interrupt automatically and vice versa. An IRQ_0 (PLL_LOCK) interrupt is supposed to occur in the following situations: • State change from TRX_OFF to PLL_ON / RX_ON • Frequency setting change in states PLL_ON / RX_ON • A manually started center frequency calibration has been completed All other PLL_LOCK interrupt events indicate that the PLL locked again after a prior unlock happened. An IRQ_1 (PLL_UNLOCK) interrupt occurs in the following situations: • A manually initiated center frequency calibration in states PLL_ON / (RX_ON) • Frequency setting change in states PLL_ON / RX_ON Any other occurrences of IRQ_1 (PLL_UNLOCK) indicate erroneous behavior and require checking of the actual device status. PLL_LOCK and PLL_UNLOCK affect the behavior of the transceiver: In states BUSY_TX and BUSY_TX_ARET the transmission is stopped and the transceiver returns into state PLL_ON. During BUSY_RX and BUSY_RX_AACK, the transceiver returns to state RX_ON and RX_AACK_ON, respectively, once the PLL has locked. Notes: 150 AT86RF212B 1. An Atmel AT86RF212B interrupt IRQ_0 (PLL_LOCK) clears any preceding IRQ_1 (PLL_UNLOCK) interrupt automatically and vice versa. 2. The state transition from BUSY_TX / BUSY_TX_ARET to PLL_ON / TX_ARET_ON after successful transmission does not generate an IRQ_0 (PLL_LOCK) within the settling period. 42002E–MCU Wireless–02/2015 AT86RF212B 9.8.6 Register Description Register 0x08 (PHY_CC_CCA): The PHY_CC_CCA register is a multi-purpose register that controls CCA configuration, CCA measurement, and the IEEE 802.15.4 channel setting. Figure 9-29. Register PHY_CC_CCA. Bit 0x08 7 6 5 CCA_REQUEST Read/Write Reset value Bit CCA_MODE R/W 0 R/W 0 3 2 0x08 Read/Write Reset value 4 CHANNEL R/W 1 R/W 0 1 0 R/W 0 R/W 1 CHANNEL R/W 0 R/W 1 PHY_CC_CCA PHY_CC_CCA The register PHY_CC_CCA contains register bits to set the channel center frequency according to channel page 0 of IEEE 802.15.4 for the European and North American band. A write access to the register bits CHANNEL sets the channel number; a read access shows the current channel number. It is necessary to set register bits CC_BAND (register 0x14, CC_CTRL_1) to zero in order to enable the above described channel selection, see Table 9-34. • Bit 4:0 - CHANNEL The register bits CHANNEL define the RX/TX channel. The channel assignment is according to IEEE 802.15.4. Channel center frequency according to channel page 0 of IEEE 802.15.4–2003/2006/2011 for the European and North American band. Table 9-35. CHANNEL. Register Bits Value Description CHANNEL 0x00 868.3MHz 0x01 906MHz 0x02 908MHz 0x03 910MHz 0x04 912 MHz 0x05 914MHz 0x06 916MHz 0x07 918MHz 0x08 920MHz 0x09 922MHz 0x0A 924MHz All other values are reserved 151 42002E–MCU Wireless–02/2015 Register 0x13 (CC_CTRL_0): The CC_CTRL_0 register controls the frequency selection, if the selection by CHANNEL (register 0x08, PHY_CC_CCA) is not used. Figure 9-30. Register CC_CTRL_0. Bit 7 6 0x13 Read/Write Reset value R/W 0 R/W 0 3 2 Bit 0x13 Read/Write Reset value 5 4 R/W 0 R/W 0 1 0 R/W 0 R/W 0 CC_NUMBER CC_CTRL_0 CC_NUMBER R/W 0 R/W 0 CC_CTRL_0 Register 0x13 (CC_CTRL_0): This register controls the center frequency if the selection by channel number according to IEEE 802.15.4 is not used. Table 9-36. Register 0x13 (CC_CTRL_0). Bit 7 6 5 Name 4 2 1 0 0 0 0 CC_NUMBER[7:0] Read/Write Reset Value 3 R/W 0 0 0 0 0 • Bit 7:0 - CC_NUMBER Table 9-37. CC_NUMBER. 152 Register Bits Value Description CC_NUMBER 0x00 Alternative frequency selection with 100kHz or 1MHz frequency spacing. CC_BAND = 0x0: Not used CC_BAND = 0x1: Valid values are [0xFF, 0xFE, …,0x00] CC_BAND = 0x2: Valid values are [0xFF, 0xFE, …,0x00] CC_BAND = 0x3: Valid values are [0xFF, 0xFE, …,0x00] CC_BAND = 0x4: Valid values are [0x5E, 0x5D, …,0x00] CC_BAND = 0x5: Valid values are [0x66, 0x65, …,0x00] CC_BAND = 0x6: Valid values are [0xFF, 0xFE, …,0x00] All other values are reserved AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Register 0x14 (CC_CTRL_1): The CC_CTRL_1 register controls the selection of the frequency bands. Figure 9-31. Register CC_CTRL_1. Bit 7 6 0x14 5 4 R/W 0 R 0 1 0 reserved Read/Write Reset value Bit 0x14 R/W 0 R/W 0 3 2 reserved Read/Write Reset value CC_CTRL_1 CC_BAND R 0 R/W 0 R/W 0 CC_CTRL_1 R/W 0 • Bit 2:0 - CC_BAND The register bits CC_BAND control the selection for IEEE 802.15.4 channel band and additional frequencies bands. Table 9-38. CC_BAND. Register Bits Value CC_BAND Description 0 The IEEE 802.15.4 channel within register bits CHANNEL is selected 1 The frequency band one is selected 2 The frequency band two is selected 3 The frequency band three is selected 4 The frequency band four is selected 5 The frequency band five is selected 6 The frequency band six is selected All other values are reserved If the register bits CC_BAND and CC_NUMBER are used, the frequency mapping is described in Table 9-34. Register 0x1A (PLL_CF): The PLL_CF register controls the operation of the center frequency calibration loop. Figure 9-32. Register PLL_CF. Bit 0x1A Read/Write Reset value Bit 7 6 4 reserved PLL_CF R/W 0 R/W 1 R/W 0 R/W 0 3 2 1 0 R/W 1 R/W 0 R/W 0 R/W 0 0x1A Read/Write Reset value 5 PLL_CF_START reserved PLL_CF 153 42002E–MCU Wireless–02/2015 • Bit 7 - PLL_CF_START Manual start of center frequency calibration cycle. Table 9-39. PLL_CF_START. Register Bits Value PLL_CF_START Description 0 Center frequency calibration cycle is finished 1 Initiates center frequency calibration cycle PLL_CF_START = 1 initiates the center frequency calibration. The calibration cycle has finished after tPLL_CF = 8µs (typ.). The register bit is cleared immediately after finishing the calibration. Register 0x1B (PLL_DCU): The PLL_DCU register controls the operation of the delay cell calibration loop. Figure 9-33. Register PLL_DCU. Bit 0x1B 7 6 5 PLL_DCU_START Read/Write Reset value PLL_DCU R/W 0 R/W 1 R/W 0 R/W 0 3 2 1 0 R/W 0 R/W 0 R/W 0 R/W 0 Bit 0x1B Read/Write Reset value 4 reserved reserved PLL_DCU • Bit 7 - PLL_DCU_START Manual start of delay cell calibration cycle. Table 9-40. PLL_DCU_START. Register Bits PLL_DCU_START Value Description 0 Delay cell calibration cycle is finished 1 Initiates delay cell calibration cycle PLL_DCU_START = 1 initiates the delay cell calibration. The calibration cycle has finished after tPLL_DCU = 10µs. The register bit is cleared immediately after finishing the calibration. 154 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Register 0x11 (BATMON): The BATMON register configures the battery monitor to compare the supply voltage at pin 28 (EVDD) to the threshold. Additionally, the supply voltage status at pin 28 (EVDD) can be read from register bit BATMON_OK according to the actual BATMON settings. Figure 9-34. Register BATMON. Bit 0x11 7 6 5 4 PLL_LOCK_CP reserved BATMON_OK BATMON_HR Read/Write Reset value R 0 R/W 0 R 0 R/W 0 Bit 3 2 1 0 R/W 1 R/W 0 0x11 Read/Write Reset value BATMON_VTH R/W 0 R/W 0 BATMON BATMON • Bit 7 - PLL_LOCK_CP The register bit PLL_LOCK_CP signals the current status of PLL lock comparator output. Table 9-41. PLL_LOCK_CP. Register Bits PLL_LOCK_CP Value Description 0 PLL is currently unlocked 1 PLL is currently locked 155 42002E–MCU Wireless–02/2015 9.9 Automatic Filter Tuning (FTN) 9.9.1 Overview The Atmel AT86RF212B FTN is incorporated to compensate device tolerances for temperature, supply voltage variations as well as part-to-part variations of the radio transceiver. The filter-tuning result is used to correct the analog baseband filter transfer function and the PLL loop-filter time constant, refer to Chapter 4. An FTN calibration cycle is initiated automatically when entering the TRX_OFF state from the P_ON, SLEEP, or RESET state. Although receiver and transmitter are very robust against these variations, it is recommended to initiate the FTN manually if the radio transceiver does not use the SLEEP state. If necessary, a calibration cycle is to be initiated in states TRX_OFF, PLL_ON or RX_ON. This applies in particular for the High Data Rate Modes with a much higher sensitivity against BPF transfer function variations. The recommended calibration interval is five minutes or less, if the AT86RF212B operates always in an active state (PLL_ON, TX_ARET_ON, RX_ON, and RX_AACK_ON). 9.9.2 Register Description Register 0x18 (FTN_CTRL): The FTN_CTRL register controls the operation of the filter tuning network calibration loop. Figure 9-35. Register FTN_CTRL. Bit 0x18 Read/Write Reset value Bit 7 6 5 FTN_START R/W 0 R/W 1 3 2 0x18 Read/Write Reset value 4 reserved FTN_CTRL R/W 0 R/W 1 1 0 R/W 0 R/W 0 reserved R/W 1 R/W 0 FTN_CTRL • Bit 7 - FTN_START Manual start of a filter calibration cycle. Table 9-42. FTN_START. Register Bits Value FTN_START 0 Description Filter calibration is finished 1 Initiates filter calibration cycle FTN_START = 1 initiates the filter tuning network calibration. When the calibration cycle has finished after tFTN = 25µs (typ.). The register bit is cleared immediately after finishing the calibration. 156 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 10 Radio Transceiver Usage This section describes basic procedures to receive and transmit frames using the Atmel AT86RF212B. For a detailed programming description refer to reference [11]. 10.1 Frame Receive Procedure A frame reception comprises of two actions: The transceiver listens for, receives, and demodulates the frame to the Frame Buffer and signals the reception to the microcontroller. After or during that process, the microcontroller can read the available frame data from the Frame Buffer via the SPI interface. While being in state RX_ON or RX_AACK_ON, the radio transceiver searches for incoming frames with the selected modulation scheme and data rate on the selected channel. Assuming the appropriate interrupts are enabled, the detection of a frame is indicated by interrupt IRQ_2 (RX_START). When the frame reception is completed, interrupt IRQ_3 (TRX_END) is issued. Different Frame Buffer read access scenarios are recommended for: • Non-time critical applications read access starts after IRQ_3 (TRX_END) • Time-critical applications read access starts after IRQ_2 (RX_START) For non-time-critical operations, it is recommended to wait for interrupt IRQ_3 (TRX_END) before starting a Frame Buffer read access. Figure 10-1 illustrates the frame receive procedure using IRQ_3 (TRX_END). Figure 10-1. Transactions between AT86RF212B and Microcontroller during Receive. Read IRQ status, pin 24 (IRQ) deasserted IRQ issued (IRQ_3) Read IRQ status, pin 24 (IRQ) deasserted Microcontroller AT86RF212B IRQ issued (IRQ_2) Read frame data (Frame Buffer access) Critical protocol timing could require starting the Frame Buffer read access after interrupt IRQ_2 (RX_START). The first byte of the frame data can be read 32µs after the IRQ_2 (RX_START) interrupt. The microcontroller must ensure to read slower than the frame is received. Otherwise a Frame Buffer under run occurs, IRQ_6 (TRX_UR) is issued, and the frame data may be not valid. To avoid this, the Frame Buffer read access can be controlled by using a Frame Buffer Empty indicator, refer to Section 11.6. 157 42002E–MCU Wireless–02/2015 10.2 Frame Transmit Procedure A frame transmission comprises of two actions, a write to Frame Buffer and the transmission of its contents. Both actions can be run in parallel if required by critical protocol timing. Figure 10-2 illustrates the Atmel AT86RF212B frame transmit procedure, when writing and transmitting the frame consecutively. After a Frame Buffer write access, the frame transmission is initiated by asserting pin 11 (SLP_TR) or writing command TX_START to register bits TRX_CMD (register 0x02, TRX_STATE). The transceiver must be either in PLL_ON state for basic operating mode or TX_ARET_ON state for extended operating mode. The completion of the transaction is indicated by interrupt IRQ_3 (TRX_END). Figure 10-2. Transaction between AT86RF212B and Microcontroller during Transmit. Write TRX_CMD = TX_START, or assert pin 11 (SLP_TR) IRQ_3 (TRX_END) issued Microcontroller AT86RF212B Write frame data (Frame Buffer access) Read IRQ_STATUS register, pin 24 (IRQ) deasserted Alternatively for time critical applications when the frame start transmission time needs to be minimized, a frame transmission task can be started first. Then it can be followed by the Frame Buffer write access event (populating PSDU data). This way the data to be transmitted is needs to be written in the transmit frame buffer as the transceiver initializes and begins SHR transmission; refer to Figure 10-3. By initiating a transmission, either by asserting pin 11 (SLP_TR) or writing a TX_START command to register bits TRX_CMD (register 0x02, TRX_STATE), the radio transceiver starts transmitting the SHR, which is internally generated. Front end initialization takes one symbol period to settle PLL and ramp up the PA. SHR transmission takes another 40 symbol periods for BPSK or 10 symbol periods delay for O-QPSK. By this time the PHR must be available in the Frame Buffer. Furthermore, the SPI data rate must be higher than the PHY data rate to avoid a Frame Buffer underrun, which is indicated by IRQ_6 (TRX_UR), refer to Section 9.1. Figure 10-3. Time Optimized Frame Transmit Procedure. Write frame data (Frame Buffer access) IRQ_3 (TRX_END) issued Microcontroller AT86RF212B Write TRX_CMD = TX_START, or assert pin 11 (SLP_TR) Read IRQ_STATUS register, pin 24 (IRQ) deasserted 158 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 11 AT86RF212B Extended Feature Set 11.1 Security Module (AES) The security module (AES) features include: • Hardware accelerated encryption and decryption • Compatible with AES-128 standard (128-bit key and data block size) • ECB (encryption/decryption) mode and CBC (encryption) mode support • Stand-alone operation, independent of other blocks 11.1.1 Overview The security module is based on an AES-128 core according to FIPS197 standard, refer to [10]. The security module works independently of other building blocks of the Atmel AT86RF212B. Encryption and decryption can be performed in parallel with a frame transmission or reception. The control of the security block is implemented as an SRAM access to address space 0x82 to 0x94. A Fast SRAM access mode allows for simultaneous new data writes and reads of processed data within the same SPI transfer. This access procedure is used to reduce the turnaround time for ECB and CBC modes, see Section 11.1.5. In addition, the security module contains another 128-bit register to store the initial key used for security operations. This initial key is not modified by the security module. 11.1.2 Security Module Preparation The use of the security module requires a configuration of the security engine before starting a security operation. The following steps are required: Table 11-1. AES Engine Configuration Steps. Step Description Description Section 1 Key Setup Write encryption or decryption key to SRAM 11.1.3 2 AES mode Select AES mode: ECB or CBC Select encryption or decryption 11.1.4.1 11.1.4.2 3 Write Data Write plaintext or cipher text to SRAM 11.1.5 4 Start operation Start AES operation 5 Read Data Read cipher text or plaintext from SRAM 11.1.5 Before starting any security operation, a key must be written to the security engine, refer to Section 11.1.3. The key set up requires the configuration of the AES engine KEY mode using register bits AES_MODE (SRAM address 0x83, AES_CTRL). The following step selects the AES mode, either electronic code book (ECB) or cipher block chaining (CBC). These modes are explained in more detail in Section 11.1.4. Further, encryption or decryption must be selected with register bit AES_DIR (SRAM address 0x83, AES_CTRL). After this, the 128-bit plain text or cipher text data has to be provided to the AES hardware engine. The data uses the SRAM address range 0x84 – 0x93. 159 42002E–MCU Wireless–02/2015 An encryption or decryption is initiated with register bit AES_REQUEST = 1 (SRAM address 0x83, that is AES_CTRL, or the mirrored version SRAM address 0x94, that is AES_CTRL_MIRROR). The AES module control registers are only accessible using SRAM read and write accesses on address space 0x82 to 0x94. Configuring the AES mode, providing the data, and starting a decryption or encryption operation can be combined in a single SRAM access. Notes: 1. No additional register access is required to operate the security block. 2. Access to the security block is not possible while the radio transceiver is in SLEEP, or RESET state. 3. All configurations of the security module, the SRAM content, and keys are reset during RESET state. 4. A read or write access to register 0x83 (AES_CTRL) during AES operation terminates the current processing. 11.1.3 Security Key Setup The setup of the key is prepared by setting register bits AES_MODE = 1 (SRAM address 0x83, AES_CTRL). Afterwards the 128-bit key must be written to SRAM addresses 0x84 through 0x93 (registers AES_KEY). It is recommended to combine the setting of control register 0x83 (AES_CTRL) and the 128-bit key transfer using only one SRAM access starting from address 0x83. The address space for the 128-bit key and 128-bit data is identical from programming point of view. However, both use different pages which are selected by register bit AES_MODE before storing the data. A read access to registers AES_KEY (0x84 – 0x93) returns the last round key of the preceding security operation. After an ECB encryption operation, this is the key that is required for the corresponding ECB decryption operation. However, the initial AES key, written to the security module in advance of an AES run, see step one in Table 11-1, is not modified during the AES operation. This initial key is used for the next AES run even it cannot be read from AES_KEY. Note: 1. ECB decryption is not required for IEEE 802.15.4 or ZigBee security processing. The Atmel AT86RF212B provides this functionality as an additional feature. 11.1.4 Security Operation Modes 11.1.4.1 Electronic Code Book (ECB) ECB is the basic operating mode of the security module. After setting up the initial AES key, register bits AES_MODE = 0 (SRAM address 0x83, AES_CTRL) sets up ECB mode. Register bit AES_DIR (SRAM address 0x83, AES_CTRL) selects the direction, either encryption or decryption. The data to be processed has to be written to SRAM addresses 0x84 through 0x93 (registers AES_STATE). An example for a programming sequence is shown in Figure 11-1. This example assumes a suitable key has been loaded before. A security operation can be started within one SRAM access by appending the start command AES_REQUEST = 1 (register 0x94, AES_CTRL_MIRROR) to the SPI sequence. Register AES_CTRL_MIRROR is a mirrored version of register 0x83 (AES_CTRL). 160 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 11-1. ECB Programming SPI Sequence – Encryption. byte 0 (cmd.) byte 1 (address) byte 2 (AES cmd) byte 3 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 SRAM write 0x83 data_0[7:0] …. byte 18 byte 19 (AES cmd) data_15[7:0] 1 0 0 0 0 0 0 0 ECB, encryption AES start Summarizing, the following steps are required to perform a security operation using only one Atmel AT86RF212B SPI access: 1. Configure SPI access a) SRAM write, refer to Section 6.3.3 b) Start address 0x83 2. Configure AES operation address 0x83: select ECB mode, direction 3. Write 128-bit data block addresses 0x84 – 0x93: either plain or ciphertext 4. Start AES operation address 0x94: start AES operation, ECB mode This sequence is recommended because the security operation is configured and started within one SPI transaction. The ECB encryption operation is illustrated in Figure 11-2. Figure 11-3 shows the ECB decryption mode, which is supported in a similar way. Figure 11-2. ECB Mode – Encryption. Plaintext Encryption Key Block Cipher Encryption Plaintext Encryption Key Ciphertext Block Cipher Encryption Ciphertext Figure 11-3. ECB Mode – Decryption. Ciphertext Decryption Key Block Cipher Decryption Plaintext Ciphertext Decryption Key Block Cipher Decryption Plaintext 161 42002E–MCU Wireless–02/2015 When decrypting, due to the nature of AES algorithm, the initial key to be used is not the same as the one used for encryption, but rather the last round key instead. This last round key is the content of the key address space stored after running one full encryption cycle, and must be saved for decryption. If the decryption key has not been saved, it has to be recomputed by first running a dummy encryption (of an arbitrary plaintext) using the original encryption key, then fetching the resulting round key from the key memory, and writing it back into the key memory as the decryption key. ECB decryption is not used by either IEEE 802.15.4 or ZigBee frame security. Both of these standards do not directly encrypt the payload, but rather a nonce instead, and protect the payload by applying an XOR operation between the resulting (AES-) cipher text and the original payload. As the nonce is the same for encryption and decryption only ECB encryption is required. Decryption is performed by XORing the received cipher text with its own encryption result respectively, which results in the original plaintext payload upon success. 11.1.4.2 Cipher Block Chaining (CBC) In CBC mode, the result of a previous AES operation is XORed with the new incoming vector forming the new plaintext to encrypt, see Figure 11-4. This mode is used for the computation of a cryptographic checksum (message integrity code, MIC). Figure 11-4. CBC Mode – Encryption. Plaintext Encryption Key Initialization Vector (IV) Block Cipher Encryption Encryption Key Plaintext Block Cipher Encryption Ciphertext Ciphertext ECB mode CBC mode After preparing the AES key and defining the AES operation direction using Atmel AT86RF212B SRAM register bit AES_DIR, the data has to be provided to the AES engine and the CBC operation can be started. The first CBC run has to be configured as ECB to process the initial data (plaintext XORed with an initialization vector provided by the microcontroller). All succeeding AES runs are to be configured as CBC by setting register bits AES_MODE = 2 (register 0x83, AES_CTRL). Register bit AES_DIR (register 0x83, AES_CTRL) must be set to AES_DIR = 0 to enable AES encryption. The data to be processed has to be transferred to the SRAM starting with address 0x84 to 0x93 (register AES_STATE). Setting register bit AES_REQUEST = 1 (register 0x94, AES_CTRL_MIRROR) as described in Section 11.1.4 starts the first encryption within one SRAM access. This causes the next 128 bits of plaintext data to be XORed with the previous cipher text data, see Figure 11-4. According to IEEE 802.15.4 the input for the very first CBC operation has to be prepared by a XORing a plaintext with an initialization vector (IV). The value of the 162 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B initialization vector is zero. However, for non-compliant usage any other initialization vector can be used. This operation has to be prepared by the microcontroller. Note: 1. The IEEE 802.15.4-2006 standard MIC algorithm requires CBC mode encryption only, as it implements a one-way hash function. 11.1.5 Data Transfer – Fast SRAM Access The ECB and CBC modules including the AES core are clocked with 16MHz. One AES operation takes tAES = 23.4µs to execute, refer to Table 7-2. That means that the processing of the data is usually faster than the transfer of the data via the SPI interface. To reduce the overall processing time, the AT86RF212B provides a Fast SRAM access for the address space 0x82 to 0x94. Figure 11-5. Packet Structure – Fast SRAM Access Mode. AES run #n AES run #0 MOSI cmd add cfg P0 P1 MISO stat xx Address xx xx 0x83 xx ... P14 P15 start ... AES access #n+1 AES access #1 xx xx ... xx cmd add cfg P0 P1 ... P14 P15 start xx C0 ... C13 C14 C15 stat xx xx 0x83 0x94 ... byte 1 (addr.) byte 2 (cfg) byte 3 byte 4 MOSI SRAM write address 0x83 P0[7:0] P1[7:0] MISO PHY_STATUS XX XX XX C0[7:0] 0x83 0x84 0x85 Note: cmd add cfg xx stat xx xx 0x83 0x94 byte 0 (cmd) Address ... AES access #0 xx xx C0 ... xx xx start ... C13 C14 C15 ... byte 18 byte 19 (start) ... P15[7:0] (1) ... C14[7:0] C15[7:0] 0x93 0x94 0x94 1. Byte 19 is the mirrored version of register AES_CTRL on SRAM address 0x94, see register description AES_CTRL_MIRROR for details. In contrast to a standard SRAM access, refer to Section 6.3.3, the Fast SRAM access allows writing and reading of data simultaneously during one SPI access for consecutive AES operations (AES run). For each byte P0 transferred to pin 22 (MOSI) for example in “AES access #1”, see Figure 11-5 (lower part), the previous content of the respective AES register C0 is clocked out at pin 20 (MISO) with an offset of one byte. In the example shown in Figure 11-5 the initial plaintext P0 – P15 is written to the SRAM within “AES access #0”. The last command on address 0x94 (AES_CTRL_MIRROR) starts the AES operation (“AES run #0”). In the next “AES access #1” new plaintext data P0 – P15 is written to the SRAM for the second AES run, in parallel the ciphertext C0 – C15 from the first AES run is clocked out at pin MISO. To read the ciphertext from the last “AES run #(n)” one dummy “AES access #(n+1)” is needed. Note: 2. The SRAM write access always overwrites the previous processing result. 163 42002E–MCU Wireless–02/2015 The Fast SRAM access automatically applies to all write operations to SRAM addresses 0x82 to 0x94. 11.1.6 Start of Security Operation and Status A security operation is started within one Atmel AT86RF212B SRAM access by appending the start command AES_REQUEST = 1 (register 0x94, AES_CTRL_MIRROR) to the SPI sequence. Register AES_CTRL_MIRROR is a mirrored version of register 0x83 (AES_CTRL). The status of the security processing is indicated by register 0x82 (AES_STATUS). After tAES = 24µs (max.) AES processing time register bit AES_DONE changes to one (register 0x82, AES_STATUS) indicating that the security operation has finished. 11.1.7 SRAM Register Summary The following registers are required to control the security module: Table 11-2. SRAM Security Module Address Space Overview. SRAM-Addr. Register Name Description 0x80 – 0x81 Reserved 0x82 AES_STATUS AES status 0x83 AES_CTRL Security module control, AES mode 0x84 – 0x93 Depends on AES_MODE setting: AES_MODE = 1: - Contains AES_KEY (key) AES_MODE = 0 or 2: - Contains AES_STATE (128 bit data block) AES_KEY AES_STATE 0x94 AES_CTRL_MIRROR 0x95 – 0xFF Mirror of register 0x83 (AES_CTRL) Reserved These registers are only accessible using SRAM write and read; for details, refer to Section 6.3.3. 11.1.8 Register Description Register 0x82 (AES_STATUS): The read-only register AES_STATUS signals the status of the security module and operation. Figure 11-6. Register AES_STATUS. Bit 0x82 7 Read/Write Reset value R 0 Bit 3 0x82 Read/Write Reset value 164 AT86RF212B 6 AES_ER 5 R 0 R 0 2 1 reserved R 0 4 reserved R 0 AES_STATUS R 0 0 AES_DONE R 0 AES_STATUS R 0 42002E–MCU Wireless–02/2015 AT86RF212B • Bit 7 - AES_ER This SRAM register bit indicates an error of the AES module. An error may occur for instance after an access to SRAM register 0x83 (AES_CTRL) while an AES operation is running or after reading less than 128-bits from SRAM register space 0x84 – 0x93 (AES_STATE). Table 11-3. AES_ER. Register Bits Value AES_ER Description 0 No error of the AES module 1 AES module error • Bit 0 - AES_DONE The bit AES_DONE signals the status of AES operation. Table 11-4. AES_DONE. Register Bits Value AES_DONE Description 0 AES operation has not been completed 1 AES operation has been completed Register 0x83 (AES_CTRL): The AES_CTRL register controls the operation of the security module. Figure 11-7. Register AES_CTRL. Bit 7 0x83 6 5 AES_REQUEST Read/Write Reset value Bit 0x83 W 0 R/W 0 3 2 AES_DIR Read/Write Reset value 4 AES_MODE AES_CTRL R/W 0 R/W 0 1 0 reserved R/W 0 R 0 R 0 AES_CTRL R 0 Notes: 1. Do not access this register during AES operation to read the AES core status. A read or write access during AES operation stops the actual processing. 2. To read the AES status use register bit AES_DONE (register 0x82, AES_STATUS). • Bit 7 - AES_REQUEST A write access with AES_REQUEST = 1 initiates the AES operation. Table 11-5. AES_REQUEST. Register Bits AES_REQUEST Value Description 0 Security module, AES core idle 1 A write access starts the AES operation 165 42002E–MCU Wireless–02/2015 • Bit 6:4 - AES_MODE This register bit sets the AES operation mode. Table 11-6. AES_MODE. Register Bits AES_MODE Value Description 0 ECB mode 1 KEY mode 2 CBC mode All other values are reserved • Bit 3 - AES_DIR The register bit AES_DIR sets the AES operation direction, either encryption or decryption. Table 11-7. AES_DIR. Register Bits AES_DIR Value Description 0 AES encryption (ECB, CBC) 1 AES decryption (ECB) Register 0x94 (AES_CTRL_MIRROR): Register 0x94 is a mirrored version of register 0x83 (AES_CTRL), for details refer to register 0x83 (AES_CTRL). This register could be used to start a security operation within a single SRAM access by appending it to the data stream and setting register bit AES_REQUEST = 1. 166 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 11.2 Random Number Generator 11.2.1 Overview The Atmel AT86RF212B incorporates a two bit truly random number generator by observation of noise. This random number can be used to: • Generate random seeds for CSMA-CA algorithm see Section 7.2 • Generate random values for AES key generation see Section 11.1 Random numbers are stored in register bits RND_VALUE (register 0x06, PHY_RSSI). The random number is updated at every read access in Basic Operating Mode receive states (RX_ON, BUSY_RX). The Random Number Generator does not work if the preamble detector is disabled (RX_PDT_DIS = 1, refer to Section 9.2.4). 11.2.2 Register Description Register 0x06 (PHY_RSSI): The PHY_RSSI register is a multi-purpose register that indicates FCS validity, to provide random numbers, and a RSSI value. Figure 11-8. Register PHY_RSSI. Bit 7 0x06 6 5 RX_CRC_VALID RND_VALUE Read/Write Reset value R 0 R 0 Bit 3 2 0x06 4 RSSI R 0 R 0 1 0 R 0 R 0 RSSI Read/Write Reset value R 0 R 0 PHY_RSSI PHY_RSSI • Bit 6:5 - RND_VALUE The 2-bit random value can be retrieved by reading register bits RND_VALUE. Table 11-8. RND_VALUE. Register Bits Value RND_VALUE 0 Note: 1. Description Deliver two bit noise value within receive state. Valid values are [3, 2, …, 0]. The radio transceiver shall be in Basic Operating Mode receive state. 167 42002E–MCU Wireless–02/2015 11.3 Antenna Diversity The Antenna Diversity implementation is characterized by: • Improves signal path robustness between nodes • Atmel AT86RF212B self-contained TX antenna diversity algorithm • Direct register based antenna selection 11.3.1 Overview Due to multipath propagation effects between network nodes, the receive signal strength may vary and affect the link quality, even for small variance of the antenna location. These fading effects can result in an increased error floor or loss of the connection between devices. To improve the reliability of an RF connection between network nodes Antenna Diversity can be applied to reduce effects of multipath propagation and fading. Antenna Diversity uses two antennas to select the most reliable RF signal path. To ensure highly independent receive signals on both antennas, the antennas should be carefully separated from each other. The AT86RF212B supports PHY controlled antenna diversity in TX_ARET mode and software controlled antenna diversity (that is the microcontroller controls which antenna is used for transmission and reception) in Basic and Extended Operating Modes. 11.3.2 Antenna Diversity Application Example A block diagram for an application using an antenna switch is shown in Figure 11-9. Figure 11-9. Antenna Diversity – Block Diagram. ANT0 1 DIG3 AT86RF212B B1 3 AVSS 4 RFP 6 AVSS DIG2 5 RFN DIG1 RFSwitch SW1 Balun 2 DIG4 9 10 ... ANT1 Generally, when the external RF-Switch (SW1) is to be controlled by antenna diversity algorithm, the antenna diversity enable must be activated by register bit ANT_EXT_SW_EN (register 0x0D, ANT_DIV). Then the digital control pins pin 9 (DIG1) and pin 10 (DIG2) are enabled (refer to Section 1.3) to drive the antenna switch control signals to the differential inputs of the RF Switch (SW1) to switch between ANT0 and ANT1. 168 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 11.3.3 Register Description Register 0x0D (ANT_DIV): The ANT_DIV register controls Antenna Diversity. Figure 11-10. Register ANT_DIV. Bit 7 0x0D 5 ANT_SEL Read/Write Reset value R 0 R 0 1 3 2 ANT_DIV_EN ANT_EXT_SW_EN R/W 0 R/W 0 Read/Write Reset value 4 reserved R 0 Bit 0x0D 6 ANT_DIV R 0 0 ANT_CTRL R/W 0 ANT_DIV R/W 1 • Bit 7 - ANT_SEL Signals status of antenna at the time of the last IRQ_2 (RX_START) interrupt, IRQ_3 (TRX_END) interrupt, or TX_START event. Table 11-9. ANT_SEL. Register Bits ANT_SEL Value Description 0 Antenna 0 1 Antenna 1 The register bit signals the status of the selected antenna at the time of the last IRQ_2 (RX_START) interrupt, IRQ_3 (TRX_END) interrupt, or TX_START event. This information can be used to build up a history of the antenna used for successful transmission (indicated by an acknowledgement frame) in TX_ARET mode. • Bit 3 - ANT_DIV_EN The register bit ANT_DIV_EN controls TX antenna diversity. Table 11-10. ANT_DIV_EN. Register Bits Value Description ANT_DIV_EN 0 TX antenna diversity is disabled 1 TX antenna diversity is enabled If set to one, antenna diversity is enabled in TX_ARET mode with expected ACK reply, refer to Section 7.2.4. The transceiver automatically selects the antenna with the aim to minimize the number of retransmissions. • Bit 2 - ANT_EXT_SW_EN The register bit ANT_EXT_SW_EN controls the external antenna switch. Table 11-11. ANT_EXT_SW_EN. Register Bits ANT_EXT_SW_EN Value Description 0 Antenna Diversity RF switch control is disabled 1 Antenna Diversity RF switch control is enabled If enabled, pin 9 (DIG1) and pin 10 (DIG2) become output pins and provide a differential control signal for an antenna diversity switch. The selection of an antenna within 169 42002E–MCU Wireless–02/2015 TX_ARET mode is done automatically if ANT_DIV_EN = 1, or, if ANT_DIV_EN = 0, according to register bits ANT_CTRL. If RX Frame Time Stamping (refer to Section 11.5) is used in combination with Antenna Diversity, pin 9 (DIG1) is used for Antenna Diversity and pin 10 (DIG2) is used for RX Frame Time Stamping. Atmel AT86RF212B does not provide a differential control signal in this case, see Figure 5-2. If the register bit is set, the control pins DIG1/DIG2 are activated in all radio transceiver states as long as register bit ANT_EXT_SW_EN is set. If the AT86RF212B is not in a receive or transmit state, it is recommended to disable register bit ANT_EXT_SW_EN to reduce the power consumption or avoid leakage current of an external RF switch, especially during SLEEP state. If register bit ANT_EXT_SW_EN = 0, output pins DIG1 and DIG2 are internally connected to digital ground. • Bit 1:0 - ANT_CTRL These register bits provide a static control of an Antenna Diversity switch. Table 11-12. ANT_CTRL. Register Bits ANT_CTRL Value Description 1 Antenna 0 DIG1 = L DIG2 = H 2 Antenna 1 DIG1 = H DIG2 = L All other values are reserved These register bits provide a static control of an Antenna Diversity switch if ANT_DIV_EN = 0 and ANT_EXT_SW_EN = 1. Although it is possible to change register bits ANT_CTRL in state TRX_OFF, this change will be effective at pin 9 (DIG1) and pin 10 (DIG2) in states PLL_ON and RX_ON. 170 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 11.4 RX/TX Indicator The main features are: • RX/TX indicator to control an external RF front-end • Microcontroller independent RF front-end control • Providing TX timing information 11.4.1 Overview While IEEE 802.15.4 is targeting low cost and low power applications, solutions supporting higher transmit output power are occasionally desirable. To simplify the control of an optional external RF front-end, a differential control pin pair can indicate that the Atmel AT86RF212B is currently in transmit mode. The control of an external RF front-end is done via digital control pins DIG3/DIG4. The function of this pin pair is enabled with register bit PA_EXT_EN (register 0x04, TRX_CTRL_1). While the transmitter is turned off, pin 1 (DIG3) is set to low level and pin 2 (DIG4) to high level. If the radio transceiver starts to transmit, the two pins change the polarity. This differential pin pair can be used to control PA, LNA, and RF switches. If the AT86RF212B is not in a receive or transmit state, it is recommended to disable register bit PA_EXT_EN (register 0x04, TRX_CTRL_1) to reduce the power consumption or avoid leakage current of external RF switches and other building blocks, especially during SLEEP state. If register bits PA_EXT_EN = 0, output pins DIG3/DIG4 are pulled-down to analog ground. 11.4.2 External RF-Front End Control When using an external RF front-end including a power amplifier (PA), it may be required to adjust the setup time of the external PA relative to the internal building blocks to optimize the overall power spectral density (PSD) mask. The start-up sequence of the individual building blocks of the internal transmitter is shown in Figure 11-11 where transmission is actually initiated by the rising edge of pin 11 (SLP_TR). The radio transceiver state changes from PLL_ON to BUSY_TX and the PLL settles to the transmit frequency within one symbol period. The modulation starts one symbol period after the rising edge of SLP_TR. During this time, the internal PA is initialized. The control of the external PA is done via the differential pin pair DIG3/DIG4. DIG3 = H / DIG4 = L indicates that the transmission starts and can be used to enable the external PA. The timing of pins DIG3/DIG4 can be adjusted relative to the start of the frame using register bits PA_LT (register 0x16, RF_CTRL_0). For details, refer to Section 9.3.5. 171 42002E–MCU Wireless–02/2015 Figure 11-11. TX Power Up Ramping Control of RF Front-End for 250kb/s O-QPSK mode. 0 State 2 6 4 8 10 PLL_ON 12 14 16 18 Length [μs] BUSY_TX SLP_TR PA PA_LT TX Data Modulation DIG3 DIG4 11.4.3 Register Description Register 0x04 (TRX_CTRL_1): The TRX_CTRL_1 register is a multi-purpose register to control various operating modes and settings of the radio transceiver. Figure 11-12. Register TRX_CTRL_1. Bit 7 0x04 6 5 4 PA_EXT_EN IRQ_2_EXT_EN TX_AUTO_CRC_ ON RX_BL_CTRL R/W 0 R/W 0 R/W 1 R/W 0 3 2 Read/Write Reset value Bit 0x04 SPI_CMD_MODE Read/Write Reset value R/W 0 1 0 IRQ_MASK_MODE IRQ_POLARITY R/W 0 R/W 0 R/W 0 TRX_CTRL_1 TRX_CTRL_1 • Bit 7 – PA_EXT_EN This register bit PA_EXT_EN enables pin 1 (DIG3) and pin 2 (DIG4) to indicate the transmit state of the radio transceiver. Table 11-13. RF Front-End Control Pins. PA_EXT_EN 0 1 State n/a (1) TX_BUSY Other Note: 172 AT86RF212B 1. Pin Value DIG3 L DIG4 L DIG3 H DIG4 L DIG3 L DIG4 H Description External RF front-end control disabled External RF front-end control enabled It is recommended to set PA_EXT_EN = 1 only in receive or transmit states to reduce the power consumption or avoid leakage current of external RF switches or other building blocks, especially during SLEEP state. 42002E–MCU Wireless–02/2015 AT86RF212B 11.5 RX Frame Time Stamping 11.5.1 Overview To determine the exact timing of an incoming frame, for example for beaconing networks, the reception of this frame can be signaled to the microcontroller via Atmel AT86RF212B pin 10 (DIG2). The pin turns from L to H after detection of a valid PHR. When enabled, DIG2 is set to DIG2 = H at the same time as IRQ_2 (RX_START) occurs, even if IRQ_2 (RX_START) is disabled. The pin remains high for the length of the frame receive procedure, see Figure 11-13. This function is enabled with register bit IRQ_2_EXT_EN (register 0x04, TRX_CTRL_1). Pin 10 (DIG2) can be connected to a timer capture unit of the microcontroller. If this pin is not used for RX Frame Time Stamping, it can be configured for Antenna Diversity, refer to Section 11.3. Otherwise, this pin is internally connected to ground. Figure 11-13. Timing of RX_START and DIG2 for RX Frame Time Stamping within 250kb/s O-QPSK mode. 128 State 192 + m ⋅ 32 192 4 1 1 m < 128 Preamble SFD PHR PSDU (250 kb/s) Number of Octets Frame Content 160 BUSY_RX RX_ON RX RX_ON Time [μs] Frame on Air 0 DIG2 (RX Frame Time Stamp) IRQ TRX_END IRQ_2 (RX_START) tIRQ Interrupt latency Note: 1. tIRQ Timing figures tIRQ refer to Section 12.4. 11.5.2 Register Description Register 0x04 (TRX_CTRL_1): The TRX_CTRL_1 register is a multi-purpose register to control various operating modes and settings of the radio transceiver. Figure 11-14. Register TRX_CTRL_1. Bit 0x04 Read/Write Reset value Bit 0x04 Read/Write Reset value 7 6 5 4 PA_EXT_EN IRQ_2_EXT_EN TX_AUTO_CRC_ ON RX_BL_CTRL R/W 0 R/W 0 R/W 1 R/W 0 3 2 SPI_CMD_MODE R/W 0 R/W 0 1 0 IRQ_MASK_MODE IRQ_POLARITY R/W 0 R/W 0 TRX_CTRL_1 TRX_CTRL_1 173 42002E–MCU Wireless–02/2015 • Bit 6 - IRQ_2_EXT_EN The register bit IRQ_2_EXT_EN controls external signaling for time stamping via pin 10 (DIG2). Table 11-14. IRQ_2_EXT_EN. Register Bits IRQ_2_EXT_EN Value 0 Time stamping over pin 10 (DIG2) is disabled (1) Time stamping over pin 10 (DIG2) is enabled 1 Note: 1. Description The pin 10 (DIG2) is also active if the corresponding interrupt event IRQ_2 (RX_START) mask bit in register 0x0E (IRQ_MASK) is set to zero. If this register bit is set, the RX Frame Time Stamping Mode is enabled. An incoming frame with a valid PHR is signaled via pin 10 (DIG2). The pin remains at high level until the end of the frame receive procedure, see Figure 11-13. 174 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 11.6 Frame Buffer Empty Indicator 11.6.1 Overview For time critical applications that want to start reading the frame data as early as possible, the Atmel AT86RF212B Frame Buffer status can be indicated to the microcontroller through a dedicated pin. This pin indicates to the microcontroller if an access to the Frame Buffer is not possible since valid PSDU data are missing. Pin 24 (IRQ) can be configured as a Frame Buffer Empty Indicator during a Frame Buffer read access. This mode is enabled by register bit RX_BL_CTRL (register 0x04, TRX_CTRL_1). The IRQ pin turns into Frame Buffer Empty Indicator after the Frame Buffer read access command, see note (1) in Figure 11-15, has been transferred on the SPI bus until the Frame Buffer read procedure has finished indicated by /SEL = H, see note (4). Figure 11-15. Timing Diagram of Frame Buffer Empty Indicator. /SEL SCLK MOSI MISO Command XX PHY_STATUS IRQ_STATUS Command XX TRX_STATUS PHR[7:0] XX XX PSDU[7:0] PSDU[7:0] XX PSDU[7:0] XX LQI[7:0] XX ED[7:0] XX Command RX_STATUS XX TRX_STATUS IRQ_STATUS Frame Buffer Empty Indicator IRQ IRQ_2 (RX_START) IRQ_3 (TRX_END) t12 Notes (1) Notes: (2) (3) (4) 1. Timing figure t12 refer to Section 12.4. 2. A Frame Buffer read access can proceed as long as pin 24 (IRQ) = L. 3. Pin IRQ = H indicates that the Frame Buffer is currently not ready for another SPI cycle. 4. The Frame Buffer read procedure has finished indicated by /SEL = H. The microcontroller has to observe the IRQ pin during the Frame Buffer read procedure. A Frame Buffer read access can proceed as long as pin 24 (IRQ) = L, see note (2). When the IRQ output pin is pulled high (IRQ = H) , the Frame Buffer is not ready for another SPI cycle, see note (3) above. The read operation can be resumed as the IRQ output pin is pulled low again (IRQ = L) to indicate new data in the buffer. On Frame Buffer read access, three more byte are transferred via MISO after PHR and PSDU data, namely LQI, ED, and RX_STATUS; refer to Section 6.3.2. Because these bytes are appended and physically not stored in the frame buffer, they are ignored for Frame Buffer empty indication. The Frame Buffer Empty Indicator pin 24 (IRQ) becomes valid after t12 = 750ns starting from the last SCLK rising edge while reading a Frame Buffer command byte, see figure above. Upon completing the SPI frame data receive task, SPI read access can be disabled by pulling /SEL = H, note (4). At this time the IRQ output pin 24 (IRQ) ) can be used as an output to flag pending interrupts to the processor. If during the Frame Buffer read access a receive error occurs (for example an PLL unlock), the Frame Buffer Empty Indicator locks on 'empty' (pin 24 (IRQ) = H) too. To prevent possible deadlocks, the microcontroller should impose a timeout counter that checks whether the Frame Buffer Empty Indicator remains logic high for more than two 175 42002E–MCU Wireless–02/2015 octet periods. A new byte must have been arrived at the frame buffer during that period. If not, the Frame Buffer read access should be aborted. 11.6.2 Register Description Register 0x04 (TRX_CTRL_1): The TRX_CTRL_1 register is a multi-purpose register to control various operating modes and settings of the radio transceiver. Figure 11-16. Register TRX_CTRL_1. Bit 7 0x04 6 5 4 PA_EXT_EN IRQ_2_EXT_EN TX_AUTO_CRC_ ON RX_BL_CTRL R/W 0 R/W 0 R/W 1 R/W 0 3 2 Read/Write Reset value Bit 0x04 SPI_CMD_MODE Read/Write Reset value R/W 0 1 0 IRQ_MASK_MODE IRQ_POLARITY R/W 0 R/W 0 R/W 0 TRX_CTRL_1 TRX_CTRL_1 • Bit 4 - RX_BL_CTRL The register bit RX_BL_CTRL controls the Frame Buffer Empty Indicator. Table 11-15. RX_BL_CTRL. Register Bits Value RX_BL_CTRL 0 Frame Buffer Empty Indicator disabled 1 Frame Buffer Empty Indicator enabled Note: 1. Description A modification of register bit IRQ_POLARITY has no influence to RX_BL_CTRL behavior. If this register bit is set, the Frame Buffer Empty Indicator is enabled. After sending a Frame Buffer read command (refer to Section 6.3), pin 24 (IRQ) indicates that an access to the Frame Buffer is not possible since PSDU data are not available yet. The pin 24 (IRQ) does not indicate any interrupts during this time. 176 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 11.7 Dynamic Frame Buffer Protection 11.7.1 Overview The Atmel AT86RF212B continues the reception of incoming frames as long as it is in any receive state. When a frame was successfully received and stored into the Frame Buffer, the following frame will overwrite the Frame Buffer content again. To relax the timing requirements for a Frame Buffer read access the Dynamic Frame Buffer Protection prevents that a new valid frame passes to the Frame Buffer until a Frame Buffer read access has ended (indicated by /SEL = H, refer to Section 6.3). A received frame is automatically protected against overwriting: • in Basic Operating Mode, if its FCS is valid • in Extended Operating Mode, if an IRQ_3 (TRX_END) is generated. The Dynamic Frame Buffer Protection is enabled with RX_SAFE_MODE (register 0x0C, TRX_CTRL_2) set and applicable in transceiver states RX_ON and RX_AACK_ON. Note: 1. The Dynamic Frame Buffer Protection only prevents write accesses from the air interface – not from the SPI interface. A Frame Buffer or SRAM write access may still modify the Frame Buffer content. 11.7.2 Register Description Register 0x0C (TRX_CTRL_2): The TRX_CTRL_2 register is a multi-purpose control register to control various settings of the radio transceiver. Figure 11-17. Register TRX_CTRL_2. Bit 0x0C 7 6 5 4 RX_SAFE_MODE TRX_OFF_AVDD_ EN OQPSK_SCRAM_ EN ALT_SPECTRUM R/W 0 R/W 0 R/W 1 R/W 0 1 0 Read/Write Reset value Bit 0x0C 3 2 BPSK_OQPSK SUB_MODE R/W 0 R/W 1 Read/Write Reset value OQPSK_DATA_RATE R/W 0 TRX_CTRL_2 TRX_CTRL_2 R/W 0 • Bit 7 - RX_SAFE_MODE Protect Frame Buffer after frame reception with valid FCF check. Table 11-16. RX_SAFE_MODE. Register Bits RX_SAFE_MODE Value Disable Dynamic Frame Buffer protection (1) Enable Dynamic Frame Buffer protection 1 Note: 1. Description 0 Dynamic Frame Buffer Protection is released on the rising edge of pin 23 (/SEL) during a Frame Buffer read access, or on the radio transceiver’s state change from RX_ON or RX_AACK_ON to another state. This operation mode is independent of the setting of register bits RX_PDT_LEVEL, (register 0x15, RX_SYN), refer to Section 9.2.4. 177 42002E–MCU Wireless–02/2015 11.8 Alternate Start-Of-Frame Delimiter 11.8.1 Overview The SFD (start of frame delimiter) is a field indicating the end of the SHR and the start of the packet data. The length of the SFD is one octet (eight symbols for BPSK and two symbols for O-QPSK). The octet is used for byte synchronization only and is not included in the Atmel AT86RF212B Frame Buffer. The value of the SFD can be changed if it is needed to operate in non-IEEE 802.15.4 compliant networks. A node with a non-standard SFD value cannot synchronize with any of the IEEE 802.15.4 network nodes. Due to the way the SHR is formed, it is not recommended to set the low-order four bits to zero. The LSB of the SFD is transmitted first, that is right after the last bit of the preamble sequence. 11.8.2 Register Description Register 0x0B (SFD_VALUE): The SFD_VALUE register contains the one octet start-of-frame delimiter (SFD). Figure 11-18. Register SFD_VALUE. Bit 7 6 0x0B Read/Write Reset value Bit R/W 1 R/W 0 3 2 0x0B Read/Write Reset value 5 4 R/W 1 R/W 0 1 0 R/W 1 R/W 1 SFD_VALUE SFD_VALUE SFD_VALUE R/W 0 R/W 1 SFD_VALUE • Bit 7:0 - SFD_VALUE The register bits SFD_VALUE are required for transmit and receive operation. Table 11-17. SFD_VALUE. Register Bits Value Description SFD_VALUE 0xA7 For transmission this value is copied into start-of-frame delimiter (SFD) field of frame header. For reception this value is checked for incoming frames. The default value is according to IEEE 802.15.4 specification. For IEEE 802.15.4 compliant networks, set SFD_VALUE = 0xA7 as specified in [2]. This is the default value of the register. To establish non IEEE 802.15.4 compliant networks, the SFD value can be changed to any other value. If enabled, IRQ_2 (RX_START) is issued only if the received SFD matches SFD_VALUE and a valid PHR is received. 178 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 12 Electrical Characteristics 12.1 Absolute Maximum Ratings Note: Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of this specification are not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. Symbol Parameter Condition Min. TSTOR Storage temperature TLEAD Lead temperature T = 10s (soldering profile compliant with IPC/JEDEC J STD 020B) VESD ESD robustness Human Body Model (HBM) [8], Typ. -50 Charged Device Model (CDM) [9] Max. Unit 150 °C 260 °C 6 kV 1250 V PRF Input RF level +10 dBm VDIG Voltage on all pins (except pins 4, 5, 13, 14, 29) -0.3 VDD+0.3 V VANA Voltage on pins 4, 5, 13, 14, 29 -0.3 2.0 V Caution! ESD sensitive device. Precaution should be used when handling the device in order to prevent permanent damage. 12.2 Recommended Operating Range Symbol Parameter TOP Operating temperature range VDD Supply voltage Condition Voltage on pins 15, 28 (1) (2) Typ. Max. Unit -40 +25 +85 °C 1.8 3.0 3.6 V 1.7 1.8 1.9 V VDD1.8 Supply voltage (on pins 13, 14, 29) Notes: 1. Even if an implementation uses the external 1.8V voltage supply VDD1.8 it is required to connect VDD. 2. External voltage supply Min. Register 0x10 (VREG_CTRL) needs to be programmed to disable internal voltage regulators and supply blocks by an external 1.8V supply, refer to Section 9.5. 179 42002E–MCU Wireless–02/2015 12.3 Digital Pin Characteristics Test Conditions: TOP = +25°C (unless otherwise stated). Symbol Parameter Condition (1) VIH High level input voltage Typ. Low level input voltage VOH High level output voltage 0.4 (1) VDD-0.4 CLoad 0.4 Capacitive load 1. V V Low level output voltage (1) Unit V (1) VOL Max. VDD-0.4 (1) VIL Note: Min. 50 V pF The capacitive load CLoad should not be larger than 50pF for all I/Os. Generally, large load capacitances increase the overall current consumption. 12.4 Digital Interface Timing Characteristics Test Conditions: TOP = +25°C, VDD = 3.0V, CLoad = 50pF (unless otherwise stated). Symbol Parameter Condition fsync SCLK frequency Synchronous operation fasync SCLK frequency Asynchronous operation t1 /SEL falling edge to MISO active t2 SCLK falling edge to MISO out t3 t4 Data hold time Min. Typ. Max. Unit 8 MHz 7.5 MHz 180 ns 25 ns MOSI setup time 10 ns MOSI hold time 10 ns t5 LSB last byte to MSB next byte t6 /SEL rising edge to MISO tri state t7 SLP_TR pulse width TX start trigger 62.5 t8 SPI idle time: SEL rising to falling edge SPI read/write, standard SRAM and frame access modes Idle time between consecutive SPI accesses 250 ns t8a SPI idle time: SEL rising to falling edge Fast SRAM read/write access mode Idle time between consecutive SPI accesses 500 ns t9 SCLK rising edge LSB to /SEL rising edge t10 Reset pulse width ≥ 10 clock cycles at 16MHz 625 t11 SPI access latency after reset ≥ 10 clock cycles at 16MHz 625 t12 Dynamic frame buffer protection: IRQ latency tIRQ IRQ_2, IRQ_3, IRQ_4 latency fCLKM Output clock frequency at pin 17 (CLKM) Configurable in register 0x03 CLKM_CTRL = 0 180 AT86RF212B 250 (1) ns 10 Note 250 ns (2) ns ns ns ns 750 ns 9 µs 0 MHz CLKM_CTRL = 1 1 MHz CLKM_CTRL = 2 2 MHz Relative to the event to be indicated 42002E–MCU Wireless–02/2015 AT86RF212B Symbol Parameter Condition Min. Max. Unit CLKM_CTRL = 3 4 MHz CLKM_CTRL = 4 8 MHz CLKM_CTRL = 5 16 MHz CLKM_CTRL = 6 Notes: 1. Typ. 250 kHz CLKM_CTRL = 7 (3) 20.0 kHz CLKM_CTRL = 7 (4) 40.0 kHz CLKM_CTRL = 7 (5) 25.0 kHz CLKM_CTRL = 7 (6) 62.5 kHz For Fast SRAM read/write accesses on address space 0x82 – 0x94 the time t5(Min.) and t8(Min.) increases to 500ns. 2. Maximum pulse width less than (TX frame length + 16µs). 3. 1/50MHz; Only in BPSK mode with fPSDU = 20kb/s. 4. 1/25MHz; Only in BPSK mode with fPSDU = 40kb/s. 5. 1/40MHz; Only in O-QPSK mode with fPSDU = 100/200/400kb/s. 6. 1/16MHz; Only in O-QPSK mode with fPSDU = 250/500/1000kb/s. 181 42002E–MCU Wireless–02/2015 12.5 General RF Specifications Test Conditions (unless otherwise stated): VDD = 3.0V, fRF = 914MHz, TOP = +25°C, Measurement setup see Figure 5-1. Symbol Parameter Condition Min. Typ. Max. Unit fRF Frequency range As specified in [1] 868.3 914 924 MHz 769 935 MHz 100kHz spacing 769.0 794.5 MHz 100kHz spacing 857.0 882.5 MHz 100kHz spacing 902.0 1MHz spacing fCH Channel spacing As specified in [1] except CHANNEL = 0 1MHz spacing 100kHz spacing fCHIP Chip rate 300 kchip/s (2) 600 kchip/s 400 kchip/s 1000 kchip/s BPSK as specified in [1] (2) O-QPSK as specified in [2], [3] (1) BPSK as specified in [1] (2) BPSK as specified in [1] (1) O-QPSK as specified in [2] (2) O-QPSK as specified in [2], [3] PSDU bit rate (1) BPSK as specified in [1] (2) BPSK as specified in [1] (1) O-QPSK as specified in [2] (2) O-QPSK as specified in [2], [3] kb/s 40 kb/s 100 kb/s 250 kb/s 20 kb/s 40 kb/s 100 kb/s 250 kb/s (1) 200 kb/s OQPSK_DATA_RATE = 2 (1) 400 kb/s OQPSK_DATA_RATE = 1 (2) 500 kb/s OQPSK_DATA_RATE = 2 (2) 1000 kb/s 16 MHz Crystal oscillator frequency Reference oscillator fSRD Symbol rate deviation Reference frequency accuracy for correct functionality PSDU bit rate 20/40/100/250kb/s 200/400/500/1000kb/s Notes: 1. For register bit SUB_MODE = 0 (register 0x0C, TRX_CTRL_2). 2. For register bit SUB_MODE = 1 (register 0x0C, TRX_CTRL_2). 3. A reference frequency accuracy of ±40ppm is required by [1], [2], [3], [4]. AT86RF212B 20 OQPSK_DATA_RATE = 1 fCLK 182 kHz kHz O-QPSK as specified in [2] fPSDU 1000 100 (1) Header bit rate (SHR, PHR) MHz MHz (1) BPSK as specified in [1] fHDR 928.5 2 -60 (3) -40 +60 ppm +40 ppm 42002E–MCU Wireless–02/2015 AT86RF212B 12.6 Transmitter Characteristics Test Conditions (unless otherwise stated): VDD = 3.0V, fRF = 914MHz, TOP = +25°C, Measurement setup see Figure 5-1. Symbol Parameter Condition PTX_MAX TX Output power Maximum configurable TX output power value PRANGE Output power range Min. Typ. Normal mode +5 Boost mode +10 36 steps, configurable in register 0x05 (PHY_TX_PWR) 35 Max. Unit dBm +11 dBm dB PACC Output power tolerance 868.3MHz P1dB 1dB compression point Normal mode 5 dBm Boost mode 10 dBm BPSK-20 5 %rms BPSK-40 8 %rms EVM Error vector magnitude (1) ±3 BPSK-40-ALT 8 %rms 29 %rms 16 %rms 10 %rms 10 %rms 914MHz –27 dBm 868.3MHz –26 dBm 782MHz –28 dBm 914MHz –53 dBm 868.3MHz –46 dBm 782MHz –42 dBm 914MHz –22 dBm 868.3MHz –22 dBm 782MHz –23 dBm 914MHz –38 dBm 868.3MHz –38 dBm 782MHz –37 dBm OQPSK-SIN-RC-100 OQPSK-SIN-250 OQPSK-RC-100 (3) OQPSK-RC-250 P2nd_HARM nd (4) 2 Harmonics dB (2)(3) TX power: +10dBm TX power: -2dBm P3rd_HARM rd (4) 3 Harmonics TX power: +10dBm TX power: -2dBm (5) PSPUR_TX Spurious Emissions Notes: 1. 30 – ≤ 1000MHz -36 dBm >1 – 12.75GHz -30 dBm Power settings according to Table 9-15. 2. The EVM of OQPSK-SIN-RC-100 is significantly higher than the EVM of the other modulation schemes. This phenomenon can be explained by the fact that the combination of SIN and RC shaping as specified in IEEE 802.15.42006/2011 inherently show some inter-chip interference. 3. The EVM is valid up to +5dBm. 183 42002E–MCU Wireless–02/2015 4. Measured single ended @ RFP/ RFN into 50Ω; termination of the other pin with 50Ω; constant wave signal. 5. Complies with EN 300 220, FCC-CFR-47 part 15, ARIB STD-108, RSS-210. 12.7 Receiver Characteristics Test Conditions (unless otherwise stated): VDD = 3.0V, fRF = 914MHz, TOP = +25°C, Measurement setup see Figure 5-1. Symbol Parameter PSENS Receiver sensitivity Condition Min. Typ. Max. Unit fRF= 868.3MHz BPSK-20 (1)(3) -110 dBm OQPSK-SIN-RC-100 (1)(4) -101 dBm OQPSK-SIN-RC-200 (2) -99 dBm OQPSK-SIN-RC-400 (2) -91 dBm OQPSK-RC-100 (1) -102 dBm OQPSK-RC-200 (2) -100 dBm OQPSK-RC-400 (2) -97 dBm -108 dBm fRF= 914MHz BPSK-40 (1)(3) OQPSK-SIN-250 (1)(4) OQPSK-SIN-500 (2) OQPSK-SIN-1000 (2) -100 dBm -98 dBm -93 dBm -101 dBm -99 dBm -95 dBm 12 dB 7 dB fRF= 782MHz OQPSK-RC-250 (1)(5) OQPSK-RC-500 (2) OQPSK-RC-1000 RLRX RX Return loss NF Noise figure 100Ω differential impedance (1) PRX_MAX Maximum RX input level PCRSB20 Channel rejection/selectivity: (3) BPSK-20 PCRSO100 Channel rejection/selectivity: (4) OQPSK-SIN-RC-100 7 184 Adjacent channel rejection: (3) BPSK-40 AT86RF212B 10 dBm fRF= 868.3MHz PRF= -89dBm (1) -2MHz 39 dB -1MHz 33 dB +1MHz 19 dB +2MHz 39 dB -2MHz 35 dB -1MHz 24 dB +1MHz 17 dB 35 dB 38 dB fRF= 868.3MHz PRF= -82dBm (1) +2MHz PACRB40 (2) PRF= -89dBm -2MHz (1) 42002E–MCU Wireless–02/2015 AT86RF212B Symbol Parameter Condition Min. +2MHz PAACRB40 Alternate channel rejection: (3) BPSK-40 PRF= -89dBm Adjacent channel rejection: (4) OQPSK-SIN-250 -4MHz PRF= -82dBm Alternate channel rejection: (4) OQPSK-SIN-250 -2MHz PRF= -82dBm Adjacent channel rejection: (5) OQPSK-RC-250 -4MHz PRF= -82dBm RXBL Alternate channel rejection: (5) OQPSK-RC-250 Blocking dB 56 dB 56 dB 30 (6) dB 30 (6) dB 47 (6) dB 47 (6) dB (1) -2MHz 32 dB 32 dB -4MHz 50 dB +4MHz 50 dB BPSK-20, ±2MHz 38 dB BPSK-20, ±10MHz 71 dB OQPSK-SIN-RC-100, ±2MHz 34 dB OQPSK-SIN-RC-100, ±10MHz 68 dB LO leakage -71 dBm +2MHz PAACROR250 38 (1) +4MHz PACROR250 Unit (1) +2MHz PAACROS250 Max. (1) +4MHz PACROS250 Typ. PRF= -82dBm (1) fRF= 868.3MHz Refer to ETSI EN 300 220-1 (1) PRF= -90dBm PSPUR_RX Spurious emissions 30 – ≤ 1000MHz >1 – 12.75GHz -57 dBm -47 dBm rd 868.3MHz, at maximum gain Offset freq. interf. 1 = 2MHz Offset freq. interf. 2 = 4MHz -12 dBm 2 – order intercept point nd 868.3MHz, at maximum gain Offset freq. interf. 1 = 3MHz Offset freq. interf. 2 = 4MHz 25 dBm RSSITOL RSSI tolerance Tolerance within gain step RSSIRANGE RSSI dynamic range IIP3 3 – order intercept point IIP2 RSSIRES RSSI resolution RSSIBASE_V RSSI sensitivity AL ±6 dB 87 dB 3.1 dB Defined as RSSI_BASE_VAL BPSK with 300kchips/s -100 dBm BPSK with 600kchips/s -99 dBm O-QPSK with 400kchips/s, SIN and RC-0.2 shaping -98 dBm O-QPSK with 400kchips/s, RC-0.2 shaping -98 dBm O-QPSK with 1000kchips/s, SIN shaping -98 dBm 185 42002E–MCU Wireless–02/2015 Symbol Parameter Condition O-QPSK with 1000kchips/s, RC-0.8 shaping Min. Typ. -97 RSSIMIN Minimum RSSI value PRF≤ RSSI_BASE_VAL 0 RSSIMAX Maximum RSSI value PRF≥ RSSI_BASE_VAL + 87dB 28 Notes: 1. 186 Max. Unit dBm AWGN channel, PER ≤ 1%, PSDU length 20 octets. 2. AWGN channel, PER ≤ 1%, PSDU length 127 octets. 3. Compliant to [1]. 4. Compliant to [2]. 5. Compliant to [4]. 6. Channel rejection is limited by modulation side lobes of interfering signal. AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 12.8 Current Consumption Specifications Test Conditions (unless otherwise stated): VDD = 3.0V, fRF = 914MHz, TOP = +25°C, Measurement setup see Figure 5-1. Symbol Parameter Condition IBUSY_TX Supply current transmit state North American band, O-QPSK modulation IRX_ON Supply current RX_ON state Min. Typ. Max. Unit PTX= +10dBm (boost mode) 26.5 mA PTX= +5dBm (normal mode) 18.0 mA PTX= +0dBm (normal mode) 13.5 mA PTX= -25dBm (normal mode) 9.5 mA high sensitivity RX_PDT_LEVEL = [0x0] 9.2 mA receiver desensitize RX_PDT_LEVEL = [0x1, ..., 0xE, (1) 0xF] 8.7 mA North American band, O-QPSK modulation IPLL_ON Supply current PLL_ON state 5.0 mA ITRX_OFF Supply current TRX_OFF state 450 µA ISLEEP Supply current SLEEP state 0.2 µA Notes: 1. Refer to Section 9.2.3. 2. All power consumption measurements are performed with CLKM disabled. 12.9 Crystal Parameter Requirements Test Conditions: TOP = +25°C, VDD = 3.0V (unless otherwise stated). Symbol Parameter f0 Crystal frequency CL Load capacitance C0 Crystal shunt capacitance ESR Equivalent series resistance Condition Min. Typ. Max. 16 8 Unit MHz 14 pF 7 pF 100 Ω 187 42002E–MCU Wireless–02/2015 13 Typical Characteristics 13.1 Active Supply Current The following charts showing each a typical behavior of the Atmel AT86RF212B. These figures are not tested during manufacturing. All power consumption measurements are performed with pin 17 (CLKM) disabled, unless otherwise stated. The measurement setup used for the measurements is shown in Figure 5-1. The power consumption of the microcontroller, which is required to program the radio transceiver, is not included in the measurement results. The power consumption in SLEEP state is independent from CLKM master clock rate selection. The current consumption depends on several factors such as: operating voltage, operating frequency, loading of I/O pins, switching rate of I/O pins, and ambient temperature. The dominating factors are operating voltage and ambient temperature. If possible the measurement results are not affected by current drawn from I/O pins. Register, SRAM or Frame Buffer read or write accesses are not performed during current consumption measurements. 13.1.1 P_ON and TRX_OFF states Figure 13-1. Current Consumption in P_ON State. 188 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 13-2. Current Consumption in TRX_OFF State. 13.1.2 PLL_ON state Figure 13-3. Current Consumption in PLL_ON State. 189 42002E–MCU Wireless–02/2015 13.1.3 RX_ON state Figure 13-4. Current Consumption in RX_ON State – High Sensitivity. Figure 13-5. Current Consumption in RX_ON State – High Input Level. 190 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 13-6. Current Consumption in RX_ON State – Reduced Sensitivity. 13.1.4 TX_BUSY state Figure 13-7. Current Consumption in TX_BUSY State – Minimum Output Power. 191 42002E–MCU Wireless–02/2015 Figure 13-8. Current Consumption in TX_BUSY State – Output Power 0dBm. Figure 13-9. Current Consumption in TX_BUSY State – Output Power 5dBm. 192 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 13-10. Current Consumption in TX_BUSY State – Maximum Output Power. 13.1.5 SLEEP Figure 13-11. Current Consumption in SLEEP. 193 42002E–MCU Wireless–02/2015 13.2 State Transition Timing Figure 13-12. Transition Time from EVDD to P_ON (CLKM available). Figure 13-13. Transition Time from SLEEP to TRX_OFF (IRQ_4 (AWAKE_END)). 194 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Figure 13-14. Transition Time from TRX_OFF to PLL_ON. 195 42002E–MCU Wireless–02/2015 14 Register Reference The Atmel AT86RF212B provides a register space of 64 8-bit registers used to configure, control and monitor the radio transceiver. Note: All registers not mentioned within the following table are reserved for internal use and must not be overwritten. When writing to a register, any reserved bits shall be overwritten only with their reset value. Table 14-1. Register Summary. Addr Name Bit 7 0x01 TRX_STATUS CCA_DONE 0x02 TRX_STATE 0x03 TRX_CTRL_0 Bit 6 Bit 5 CCA_STATUS reserved Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 TRX_STATUS TRAC_STATUS 44, 65, 103 TRX_CMD PAD_IO PAD_IO_CLKM Page 45, 66 CLKM_SHA_SEL CLKM_CTRL 7, 144 22, 30, 68, 94, 0x04 TRX_CTRL_1 PA_EXT_EN IRQ_2_EXT_EN TX_AUTO_CRC_ON RX_BL_CTRL SPI_CMD_MODE IRQ_MASK_MODE IRQ_POLARITY 0x05 PHY_TX_PWR PA_BOOST GC_PA TX_PWR 127 0x06 PHY_RSSI RX_CRC_VALID RND_VALUE RSSI 95, 97, 167 CCA_REQUEST CCA_MODE CHANNEL 104, 108, 151 172, 173, 176 0x07 PHY_ED_LEVEL 0x08 PHY_CC_CCA 0x09 CCA_THRES 0x0A RX_CTRL ED_LEVEL 100 CCA_CS_THRES reserved 0x0B SFD_VALUE 0x0C TRX_CTRL_2 RX_SAFE_MODE 0x0D ANT_DIV ANT_SEL 0x0E IRQ_MASK 0x0F IRQ_STATUS IRQ_7_BAT_LOW IRQ_6_TRX_UR 0x10 VREG_CTRL AVREG_EXT AVDD_OK 0x11 BATMON PLL_LOCK_CP reserved 0x12 XOSC_CTRL 0x13 CC_CTRL_0 0x14 CC_CTRL_1 0x15 RX_SYN 0x16 RF_CTRL_0 0x17 XAH_CTRL_1 reserved CSMA_LBT_MODE 0x18 FTN_CTRL FTN_START reserved 0x1A PLL_CF PLL_CF_START reserved 0x1B PLL_DCU PLL_DCU_START 0x1C PART_NUM JCM_EN reserved OQPSK_SCRAM_EN ALT_SPECTRUM CCA_ED_THRES 105, 108 reserved 146 SFD_VALUE TRX_OFF_AVDD_EN 178 BPSK_OQPSK SUB_MODE OQPSK_DATA_RATE 115, 138, 177 ANT_DIV_EN ANT_EXT_SW_EN ANT_CTRL 169 reserved IRQ_MASK IRQ_5_AMI IRQ_4_CCA_ED_DONE IRQ_3_TRX_END IRQ_2_RX_START DVREG_EXT DVDD_OK reserved BATMON_OK 29 BATMON_HR XTAL_MODE IRQ_1_PLL_UNLOCK IRQ_0_PLL_LOCK reserved BATMON_VTH 140, 155 XTAL_TRIM 147 CC_NUMBER reserved RX_PDT_DIS 152 reserved CC_BAND RX_OVERRIDE PA_LT reserved 0x1D VERSION_NUM 153 RX_PDT_LEVEL AACK_FLTR_RES_FT IF_SHIFT_MODE AACK_UPLD_RES_FT 29 136 reserved AACK_ACK_TIME reserved reserved AACK_PROM_MODE 130 reserved 69, 85, 109 156 reserved reserved 119 GC_TX_OFFS 153 154 PART_NUM 23 VERSION_NUM 23 0x1E MAN_ID_0 MAN_ID_0 24 0x1F MAN_ID_1 MAN_ID_1 24 0x20 SHORT_ADDR_0 SHORT_ADDR_0 88 0x21 SHORT_ADDR_1 SHORT_ADDR_1 88 0x22 PAN_ID_0 PAN_ID_0 89 0x23 PAN_ID_1 PAN_ID_1 89 0x24 IEEE_ADDR_0 IEEE_ADDR_0 89 0x25 IEEE_ADDR_1 IEEE_ADDR_1 90 0x26 IEEE_ADDR_2 IEEE_ADDR_2 90 0x27 IEEE_ADDR_3 IEEE_ADDR_3 90 0x28 IEEE_ADDR_4 IEEE_ADDR_4 91 0x29 IEEE_ADDR_5 IEEE_ADDR_5 91 196 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Addr Name Bit 7 Bit 6 Bit 5 0x2A IEEE_ADDR_6 IEEE_ADDR_6 91 0x2B IEEE_ADDR_7 IEEE_ADDR_7 92 0x2C XAH_CTRL_0 0x2F Bit 3 MAX_FRAME_RETRIES 0x2D CSMA_SEED_0 0x2E CSMA_SEED_1 Bit 4 Bit 2 Bit 1 MAX_CSMA_RETRIES SLOTTED_OPERATION CSMA_SEED_0 AACK_FVN_MODE CSMA_BE AACK_SET_PD MAX_BE AACK_DIS_ACK Bit 0 Page 71 73 AACK_I_AM_COORD CSMA_SEED_1 MIN_BE 74, 87 76 197 42002E–MCU Wireless–02/2015 The reset values of the Atmel AT86RF212B registers in state P_ON Table 14-2. Note: (1, 2, 3) are shown in All reset values in Table 14-2 are only valid after a power on reset. After a reset procedure (/RST = L) as described in Section 7.1.4.5, the reset values of selected registers (for example registers 0x01, 0x10, 0x11, 0x30) can differ from that in Table 14-2. Table 14-2. Register Summary – Reset Values. Address Reset Value Address Reset Value Address Reset Value Address Reset Value 0x00 0x00 0x10 0x00 0x20 0xFF 0x30 0x00 0x01 0x00 0x11 0x02 0x21 0xFF 0x31 0x00 0x02 0x00 0x12 0xF0 0x22 0xFF 0x32 0x00 0x03 0x19 0x13 0x00 0x23 0xFF 0x33 0x00 0x04 0x20 0x14 0x00 0x24 0x00 0x34 0x3F 0x05 0x60 0x15 0x00 0x25 0x00 0x35 0x00 0x06 0x00 0x16 0x31 0x26 0x00 0x36 0x00 0x07 0xFF 0x17 0x00 0x27 0x00 0x37 0x00 0x08 0x25 0x18 0x58 0x28 0x00 0x38 0x00 0x09 0x77 0x19 0x00 0x29 0x00 0x39 0x40 0x0A 0x17 0x1A 0x48 0x2A 0x00 0x3A 0x00 0x0B 0xA7 0x1B 0x40 0x2B 0x00 0x3B 0x00 0x0C 0x24 0x1C 0x07 0x2C 0x38 0x3C 0x00 0x0D 0x01 0x1D 0x03 0x2D 0xEA 0x3D 0x00 0x0E 0x00 0x1E 0x1F 0x2E 0x42 0x3E 0x00 0x0F 0x00 0x1F 0x00 0x2F 0x53 0x3F 0x00 Notes: 1. While the reset value of register 0x10 is 0x00, any practical access to the register is only possible when DVREG is active. So this register is always read out as 0x04. For details, refer to Section 9.5. 2. While the reset value of register 0x11 is 0x02, any practical access to the register is only possible when BATMON is activated. So this register is always read out as 0x22 in P_ON state. For details, refer to Section 9.6. 3. While the reset value of register 0x30 is 0x00, any practical access to the register is only possible when the radio transceiver is accessible. So the register is usually read out as: a) 0x11 after a reset in P_ON state b) 0x07 after a reset in any other state 198 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 15 Abbreviations AACK ACK ADC AD AES AGC ARET AVREG AWGN BATMON BBP BPF BPSK CBC CCA CC CF CRC CS CSMA-CA CW DAC DVREG ECB ED ESD EVM Fc FCF FCS FIFO FTN GPIO IC IEEE IF I/O I/Q IRQ ISM LBT LDO LNA LO LPF LQI LSB MAC MFR MHR MIC MISO — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Automatic Acknowledgement Acknowledgement Analog-to-Digital Converter Antenna Diversity Advanced Encryption Standard Automatic Gain Control Automatic Retransmission Analog Voltage Regulator Additive White Gaussian Noise Battery Monitor Base-Band Processor Band-Pass Filter Binary Phase Shift Keying Cipher Block Chaining Clear Channel Assessment Current Channel Center Frequency Cyclic Redundancy Check Carrier Sense Carrier Sense Multiple Access – Collision Avoidance Continuous Wave Digital-to-Analog Converter Digital Voltage Regulator Electronic Code Book Energy Detect Electrostatic discharge Error Vector Magnitude Channel Center Frequency Frame Control Field Frame Check Sequence First In, First Out Filter Tuning Network General Purpose Input/Output Integrated Circuit Institute of Electrical and Electronic Engineers Intermediate Frequency Input/Output In/Quadrature-Phase Interrupt Request Industrial Scientific Medical Listen Before Talk Low Dropout Low-Noise Amplifier Local Oscillator Low-Pass Filter Link Quality Indication Least Significant Bit Medium Access Control MAC Footer MAC Header Message Integrity Code Master Input, Slave Output 199 42002E–MCU Wireless–02/2015 MOSI MSB MSDU NOP O-QPSK PA PAN PCB PER PHR PHY PLL PPDU PPF PRBS PSD PSDU QFN RBW RC RF RMS RSSI RX SFD SHR SPI SRAM SRD TRX TX VBW VCO WPAN XOSC XTAL 200 AT86RF212B — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Master Output, Slave Input Most Significant Bit MAC Service Data Unit No Operation Offset Quadrature Phase Shift Keying Power Amplifier Personal Area Network Printed Circuit Board Packet Error Rate PHY Header Physical Layer Phase-Looked Loop PHY Protocol Data Unit Poly-Phase Filter Pseudo Random Binary Sequence Power Spectrum Density PHY Service Data Unit Quad Flat No-Lead Package Resolution Bandwidth Raised Cosine Radio Frequency Root Mean Square Received Signal Strength Indicator Receiver Start-Of-Frame Delimiter Synchronization Header Serial Peripheral Interface Static Random Access Memory Short Range Device Transceiver Transmitter Video Bandwidth Voltage Controlled Oscillator Wireless Personal Area Network Crystal Oscillator Crystal 42002E–MCU Wireless–02/2015 AT86RF212B 16 Ordering Information Ordering Code Packaging Package Voltage Range Tray QN 1.8V – 3.6V Industrial (-40°C to +85°C) Lead-free/Halogen-free Tape & Reel QN 1.8V – 3.6V Industrial (-40°C to +85°C) Lead-free/Halogen-free AT86RF212B-ZU AT86RF212B-ZUR Temperature Range Package Type Description QN 32QN2, 32-lead 5.0x5.0mm Body, 0.50mm Pitch, Quad Flat No-lead Package (QFN) Sawn Note: T&R quantity 5,000. Please contact your local Atmel sales office for more detailed ordering information and minimum quantities. 17 Soldering Information Recommended soldering profile is specified in IPC/JEDEC J-STD-.020C. 18 Package Thermal Properties Thermal Resistance Velocity [m/s] Theta ja [K/W] 0 40.9 1 35.7 2.5 32.0 201 42002E–MCU Wireless–02/2015 19 Package Drawing – 32QN2 SYMBOL 202 AT86RF212B MIN. NOM. MAX. NOTE 42002E–MCU Wireless–02/2015 AT86RF212B Appendix A – Continuous Transmission Test Mode A.1 – Overview The Atmel AT86RF212B offers a Continuous Transmission Test Mode to support application and production tests as well as certification tests. Using this test mode, the radio transceiver transmits continuously a previously transferred frame (PRBS mode) or a continuous wave signal (CW mode). The AT86RF212B uses I/Q modulation for both, PRBS mode and CW mode. In CW mode, this results in a signal which is not placed at the selected channel center frequency Fc (refer to Section 9.8.2), but at 0.1 or 0.25MHz apart this frequency. One out of four different signal frequencies per channel can be transmitted: • f1 = Fc + 0.25MHz using O-QPSK 1000kb/s mode • f2 = Fc - 0.25MHz using O-QPSK 1000kb/s mode • f3 = Fc + 0.1MHz using O-QPSK 400kb/s mode • f4 = Fc - 0.1MHz using O-QPSK 400kb/s mode As a side effect of I/Q modulation, CW mode shows some unwanted signal components based on finite image rejection and non-linearities. In addition to the above mentioned modes – a CW mode which directly uses the PLL signal without I/Q modulation. This is the recommended mode because the signal is placed at the selected channel center frequency Fc and unwanted signal components are significantly lower. PRBS mode requires data in the frame buffer, that is a valid PHR (see Section 8.1) followed by PSDU data. After transmission of two non-PSDU octets, PSDU data is repeated continuously. A.2 – Configuration Detailed programming sequences are shown in Table A-1 for PRBS and CW mode and in Table A-2 for additional CW mode. The column R/W informs about writing (W) or reading (R) a register or the Frame Buffer. Table A-1. PRBS and CW Mode Programming Sequence. Step Action Register R/W Value Description 1 RESET 2 Register access 0x0E W 0x01 Set IRQ mask register, enable IRQ_0 (PLL_LOCK) 3 Register access 0x02 W 0x03 Set radio transceiver state TRX_OFF 4 Register access W Set channel, refer to Section 9.8.2 5 Register access W Set TX output power, refer to Section 9.3.4. For CW mode, GC_TX_OFFS should be set to three. See note 1. 6 Register access 0x01 R 0x08 7 Register access 0x36 W 0x0F Reset AT86RF212B Verify TRX_OFF state 203 42002E–MCU Wireless–02/2015 Step 8 Action Register access Register R/W 0x0C W Value Description 0x00 0x04 0x08 0x0C 0x1C 0x0A Select PRBS mode with modulation scheme or CW mode with carrier position: PRBS mode, BPSK-20 PRBS mode, BPSK-40 PRBS mode, OQPSK-SIN-RC-100 PRBS mode, OQPSK-SIN-250 PRBS mode, OQPSK-RC-250 CW mode, CW at Fc - 0.1MHz or CW at Fc + 0.1MHz, see step 9 CW mode, CW at Fc - 0.25MHz or CW at Fc + 0.25MHz, see step 9 0x0E 9 204 AT86RF212B Frame Buffer write access W {PHR, PRBS mode: Write PHR value (0x01 … PSDU} 0x7F) followed by PSDU data. PHR determines how many bytes of the PSDU data are repeated continuously. {0x01, 0x00} CW mode, CW at Fc - 0.1MHz {0x01, 0xFF} CW mode, CW at Fc + 0.1MHz {0x01, 0x00} CW mode, CW at Fc - 0.25MHz {0x01, 0xFF} CW mode, CW at Fc + 0.25MHz 10 Register access 0x1C W 0x54 11 Register access 0x1C W 0x46 12 Register access 0x02 W 0x09 Enable PLL_ON state 13 Interrupt event 0x0F R 0x01 Wait for IRQ_0 (PLL_LOCK) 14 Register access 0x02 W 0x02 Initiate transmission, enter BUSY_TX state 15 Measurement 16 Register access 17 Reset Perform measurement 0x1C W 0x00 Disable Continuous Transmission Test Mode Reset AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Table A-2. Additional CW Mode Programming Sequence. Step Action 1 Reset 2 Register access 0x0E W 0x01 Set IRQ mask register, enable IRQ_0 (PLL_LOCK) 3 Register access 0x02 W 0x03 Set radio transceiver state TRX_OFF 4 Register access W Set channel, refer to Section 9.8.2. 5 Register access W Set TX output power, refer to Section 9.3.4. For CW mode, GC_TX_OFFS should be set to three. See note 1 6 Register access 0x01 R 0x08 7 Register access 0x36 W 0x0F 8 Register access 0x1C W 0x54 9 Register access 0x1C W 0x42 10 Register access 0x34 W 0x00 11 Register access 0x3F W 0x08 12 Register access 0x02 W 0x09 Enable PLL_ON state 13 Interrupt event 0x0F R 0x01 Wait for IRQ_0 (PLL_LOCK) 14 Register access 0x02 W 0x02 Initiate transmission, enter BUSY_TX state 15 Measurement 16 Register access 17 Reset Note: 1. Register R/W Value Description Reset AT86RF212B rev. C Verify TRX_OFF state Perform measurement 0x1C W 0x00 Disable Continuous Transmission Test Mode Reset AT86RF212B rev. C Changing the output power during continuous transmission is not allowed. 205 42002E–MCU Wireless–02/2015 Appendix B – Errata AT86RF212B Rev. C No known errata. 206 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B References [1] IEEE Standard 802.15.4™-2003: Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for Low-Rate Wireless Personal Area Networks (WPANs). [2] IEEE Standard 802.15.4™-2006: Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for Low-Rate Wireless Personal Area Networks (WPANs). [3] IEEE Standard 802.15.4c™-2009: Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for Low-Rate Wireless Personal Area Networks (WPANs): Amendment 2: Alternative Physical Layer Extension to support one or more of the Chinese 314-316MHz, 430-434MHz, and 779-787MHz bands. [4] IEEE Standard 802.15.4™-2011: Low-Rate Wireless Personal Area Networks (WPANs). [5] FCC Title 47 (Telecommunication) of the Code of Federal Regulations, Part 15 (Radio Frequency Devices), October 2009. [6] ETSI EN 300 220-1 V2.3.1 (2009-04): Electromagnetic compatibility and Radio spectrum Matters (ERM); Short Range Devices (SRD); Radio equipment to be used in the 25MHz to 1000MHz frequency range with power levels ranging up to 500mW; Part 1: Technical characteristics and test methods. [7] ERC Recommendation 70-03 relating to the use of short range devices (SRD). Version of 18 February 2009. [8] ANSI/ESD STM5.1 – 2007, Electrostatic Discharge Sensitivity Testing – Human Body Model (HBM); JESD22-A114E – 2006; CEI/IEC 60749-26 – 2006; AEC-Q100-002-Ref-D. [9] ESD-STM5.3.1-1999: ESD Association Standard Test Method for electrostatic discharge sensitivity testing – Charged Device Model (CDM). [10] NIST FIPS PUB 197: Advanced Encryption Standard (AES), Federal Information Processing Standards Publication 197, US Department of Commerce/NIST, November 26, 2001. [11] AT86RF212B Software Programming Model. 207 42002E–MCU Wireless–02/2015 Data Sheet Revision History Please note that revisions in this section are referring to the document revisions. Rev. Date 42002E 02/2015 Comments 1. Section 6.7.2 Interrupt Mask Modes and Pin Polarity: - IRQ_MASK_MODE reset value correcte from 1 to 0. 42002D 02/2015 2. Section 9.3 Transmitter (Tx) - Tx output power updated from +10 to +11dBm 3. Register RF_CTRL_0: - Bits 3:2: IF_SHIFT_MODE marked as reserved bits. 4. Section 12.6 Transmitter Characteristics: - Updated PTX_MAX from +10 to +11dBm - Updated references in note 5. 42002C 08/2013 1. Remove content PRELIMINARY 2. Editorial update: a. Page 105: update note 1. On register 0x09 b. Page 203: update overview section 42002B 04/2013 Editorial updates 42002A 02/2013 Initial release 208 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B Table of Contents Features .................................................................................................. 1 Low Power, ............................................................................................. 1 700/800/900MHz Transceiver for ZigBee, ............................................. 1 IEEE 802.15.4, ......................................................................................... 1 6LoWPAN, and ISM ................................................................................ 1 Applications ........................................................................................... 1 AT86RF212B ........................................................................................... 1 1 Pin-out Diagram .................................................................................. 2 1.1 Pin Descriptions...................................................................................................... 3 1.2 Analog and RF Pins ............................................................................................... 4 1.3 Digital Pins .............................................................................................................. 6 2 Disclaimer ............................................................................................ 8 3 Overview .............................................................................................. 8 4 General Circuit Description................................................................ 9 5 Application Schematic ..................................................................... 11 5.1 Basic Application Schematic ................................................................................ 11 5.2 Extended Feature Set Application Schematic ...................................................... 13 6 Microcontroller Interface .................................................................. 15 6.1 Overview............................................................................................................... 15 6.2 SPI Timing Description ......................................................................................... 16 6.3 SPI Protocol.......................................................................................................... 17 6.4 Radio Transceiver Status Information .................................................................. 22 6.5 Radio Transceiver Identification ........................................................................... 23 6.6 Sleep/Wake-up and Transmit Signal (SLP_TR)................................................... 25 6.7 Interrupt Logic....................................................................................................... 27 7 Operating Modes............................................................................... 32 7.1 Basic Operating Mode .......................................................................................... 32 7.2 Extended Operating Mode ................................................................................... 46 8 Functional Description ..................................................................... 77 8.1 Introduction – IEEE 802.15.4-2006 Frame Format .............................................. 77 8.2 Frame Filter .......................................................................................................... 83 8.3 Frame Check Sequence (FCS) ............................................................................ 93 8.4 Received Signal Strength Indicator (RSSI) .......................................................... 96 8.5 Energy Detection (ED) ......................................................................................... 98 8.6 Clear Channel Assessment (CCA) ..................................................................... 101 209 42002E–MCU Wireless–02/2015 8.7 Listen Before Talk (LBT) .................................................................................... 107 8.8 Link Quality Indication (LQI) ............................................................................... 110 9 Module Description......................................................................... 111 9.1 Physical Layer Modes ........................................................................................ 111 9.2 Receiver (RX) ..................................................................................................... 118 9.3 Transmitter (TX) ................................................................................................. 121 9.4 Frame Buffer....................................................................................................... 132 9.5 Voltage Regulators (AVREG, DVREG) .............................................................. 135 9.6 Battery Monitor (BATMON) ................................................................................ 139 9.7 Crystal Oscillator (XOSC) and Clock Output (CLKM) ........................................ 142 9.8 Frequency Synthesizer (PLL) ............................................................................. 148 9.9 Automatic Filter Tuning (FTN) ............................................................................ 156 10 Radio Transceiver Usage ............................................................. 157 10.1 Frame Receive Procedure ............................................................................... 157 10.2 Frame Transmit Procedure .............................................................................. 158 11 AT86RF212B Extended Feature Set ............................................ 159 11.1 Security Module (AES) ..................................................................................... 159 11.2 Random Number Generator ............................................................................. 167 11.3 Antenna Diversity ............................................................................................. 168 11.4 RX/TX Indicator ................................................................................................ 171 11.5 RX Frame Time Stamping ................................................................................ 173 11.6 Frame Buffer Empty Indicator .......................................................................... 175 11.7 Dynamic Frame Buffer Protection .................................................................... 177 11.8 Alternate Start-Of-Frame Delimiter .................................................................. 178 12 Electrical Characteristics ............................................................. 179 12.1 Absolute Maximum Ratings .............................................................................. 179 12.2 Recommended Operating Range..................................................................... 179 12.3 Digital Pin Characteristics ................................................................................ 180 12.4 Digital Interface Timing Characteristics ............................................................ 180 12.5 General RF Specifications ................................................................................ 182 12.6 Transmitter Characteristics .............................................................................. 183 12.7 Receiver Characteristics .................................................................................. 184 12.8 Current Consumption Specifications ................................................................ 187 12.9 Crystal Parameter Requirements ..................................................................... 187 13 Typical Characteristics ................................................................. 188 13.1 Active Supply Current ....................................................................................... 188 210 AT86RF212B 42002E–MCU Wireless–02/2015 AT86RF212B 13.2 State Transition Timing .................................................................................... 194 14 Register Reference ....................................................................... 196 15 Abbreviations ................................................................................ 199 16 Ordering Information .................................................................... 201 17 Soldering Information ................................................................... 201 18 Package Thermal Properties ........................................................ 201 19 Package Drawing – 32QN2 ........................................................... 202 Appendix A – Continuous Transmission Test Mode ...................... 203 A.1 – Overview ......................................................................................................... 203 A.2 – Configuration ................................................................................................... 203 Appendix B – Errata........................................................................... 206 AT86RF212B Rev. C ................................................................................................ 206 References.......................................................................................... 207 Data Sheet Revision History ............................................................. 208 Table of Contents............................................................................... 209 211 42002E–MCU Wireless–02/2015 Atmel Corporation 1600 Technology Drive, San Jose, CA 95110 USA T: (+1)(408) 441.0311 F: (+1)(408) 436.4200 │ www.atmel.com © 2014 Atmel Corporation. / Rev.:42002E–MCU Wireless–02/2015. Atmel®, Atmel logo and combinations thereof, Enabling Unlimited Possibilities®, AVR® and others are registered trademarks or trademarks of Atmel Corporation in U.S. and other countries. Other terms and product names may be trademarks of others. DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any applications where the failure of such products would reasonably be expected to result in significant personal injury or death (“Safety-Critical Applications”) without an Atmel officer's specific written consent. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. Atmel products are not designed nor intended for use in military or aerospace applications or environments unless specifically designated by Atmel as military-grade. Atmel products are not designed nor intended for use in automotive applications unless specifically designated by Atmel as automotive-grade. 212 AT86RF212B 42002E–MCU Wireless–02/2015
AT86RF212B-ZU 价格&库存

很抱歉,暂时无法提供与“AT86RF212B-ZU”相匹配的价格&库存,您可以联系我们找货

免费人工找货