SPI topics: watchdog, serial output and parity check

Similar documents
i.mxrt1050 Product Lifetime Usage Estimates

i.mx 6ULL Product Usage Lifetime Estimates

Getting Started with the MCU Flashloader

Working around ERR7026 according to application needs

i.mx 7 Dual/Solo Product Lifetime Usage

Using FCCU on MPC5744P

Smart Plug Software Design Reference Manual

i.mx 6UltraLite Product Usage Lifetime Estimates

Power Consumption and Measurement of i.mx RT1020

KIT33988CEVBE evaluation board

How to setup pre-build steps in CodeWarrior for Microcontrollers v10.x

Processor Expert Software for i.mx Processors Version 1.0

MM912_634, Silicon Analog Mask (M91W) / Digital Mask (N53A) Errata

KIT34901EFEVB Evaluation Board

KIT10XS3425EVBE Evaluation Board

MP3V5050, 0 to 50 kpa, Differential, and Gauge Pressure Sensor

Generating a Quick and Controlled Waveform With the DAC

FRDM-K64F Board Errata

HVP-KV10Z32 User s Guide

Measuring Interrupt Latency

Flash Core Voltage Supply Requirements and Considerations

MMPF0100 Errata for Mask 1N47F and 1N18J

KIT33972AEWEVBE Evaluation Board

Freedom FRDM-MC-LVBLDC Development Platform User s Guide

DDR Validation Tool Getting Started Guide

Building U-Boot in CodeWarrior ARMv8

Configuring DDR in U-Boot using QCVS

Table of Contents 1 Typical Applications General Description Block Diagram Pinout System Connections Typical A

Adding a run control interface into an existing CodeWarrior for MCU v10.x project

Three-Phase Power Meter Hardware Design Reference Manual

MAG3110 Frequently Asked Questions

HVP-KV31F120M User s Guide

Emulating I2S bus on KE06

How to use FlexMemory as D-Flash and EEPROM in KE1xF

Offline Flash Programmer for Kinetis K- and L-series MCUs

KW41Z IEEE and BLE Coexistence Performance

General C Functions for the etpu Covers the MCF523x, MPC5500, MPC5600, MPC5700, MPX40 and all etpu-equipped Devices

Emulating Dual SPI Using FlexIO

KITVALVECNTLEVM Valve Controller SoC Evaluation Kit

AN5333. Safety application notes for MC24XS4 family. Document information

Kinetis KE1xF512 MCUs

Configure QSPI Bus Width and Frequency in Pre-Boot Loader Stage on QorIQ LS Series Processors

KITUSBSPIEVME USB-to-SPI Interface Board Featuring the MC68HC908JW32

i.mx 6Solo/6DualLite Product Lifetime Usage Estimates

Single Chip Module (SCM) Package-on- Package (PoP) Assembly Guide

Freescale Semiconductor Data Sheet: Technical Data

WCT1011A/WCT1013A Automotive MP-A9 V4.0 Run-Time Debugging

HVP-MC56F82748 User s Guide

KIT33887EKEVB Evaluation Board

Emulating I2C Bus Master by using FlexIO

MCUXpresso SDK USB Power Delivery

Integrate TWR-EPD Software with MQX RTOS Based on the TWR-K21F120M Platform

Quick Start Guide for FRDM-FXS-MULTI-B

MQX RTOS Release Notes for Kinetis SDK FRDM- KV10Z Freescale Freedom Development Platform

MQX RTOS Release Notes for Kinetis SDK v1.2.0 for KL33Z64 for FRDM-KL43Z Freescale Freedom Development Platform

Using DMA for Pulse Counting on S32K

Kinetis USB-KW41Z Wireless Protocol Sniffer Quick Start Guide

Getting Started with Pins Tool User's Guide

Getting Started with MCUXpresso SDK CMSIS Packs

CodeWarrior Development Studio for StarCore 3900FP DSP v SP3 Release Notes

MP3V5050V, -50 to 0 kpa, Gauge Pressure Sensor

Getting Started with Freescale MQX RTOS for Kinetis SDK and MDK-ARM Keil

AN Safety application note for MC12XS3 family. Document information

AN5016. Trigonometry approximations. Document information

ORDERING INFORMATION # of Ports Pressure Type Device Name

PMSM Field-Oriented Control Using MC56F84789 DSC With Encoders Demo Guide

Migrating Applications from MC9S12VR64 to MC9S12VR32 by: Manuel Rodríguez

S12VR Hardware Design. Guidelines. 1 Introduction. 2 Hardware Design. Guidelines. 2.1 Voltage regulator. Freescale Semiconductor

Getting Started with Freescale MQX RTOS for Kinetis SDK and Kinetis Design Studio IDE

WPR1500-LDO MP Receiver V2.1 Reference Design User s Guide

QCVS Frame Distributor Wizard User Guide

MPXHZ6130A, 15 to 130 kpa, Absolute, Integrated Pressure Sensor

Kinetis Flash Tool User's Guide

Component Development Environment Getting Started Guide

Kinetis SDK Release Notes for the TWR-K24F120M Tower System Module

OpenSDA on TWR-KW2x. User s Guide Rev 1.1

Kinetis Updater User's Guide

Watt Saver Software Component (WSC)

TWR-LS1021A Getting Started

MPXH6300A, 20 to 300 kpa, Absolute, Integrated, Pressure Sensor

Freedom FRDM-KV31F Development Platform User s Guide

Using an External GCC Toolchain with CodeWarrior for Power Architecture

P1010RDB-PB Quick Start Guide

TWR-LS1021A Getting Started

Mask Set Errata for Mask 0N22G

Understanding S08P Internal Clock Source

i.mx 6 Android JB 4.3_1.1.1 Patch Release Notes

Mask Set Errata for Mask 2N27B

TWR-KV10Z32 Sample Code Guide for CodeWarrior Board configuration, software, and development tools

How to Enable Boot from QSPI Flash

Using the Xtrinsic FXLS8471CQ Transient-Acceleration Function

Using VRC_CTL to Control an External VDD_LV Supply on the MPC5748G

TWR-KV10Z32 Sample Code Guide for IAR Board configuration, software, and development tools

KIT09XS3400EVBE Evaluation Board User Guide Featuring the MC09XS3400

Exception and fault checking on S32K1xx

Controller Continuum. for Microcontrollers V6.3. Quick Start

CodeWarrior Development Studio Processor Expert RTOS Adapter User Guide

Kinetis Bootloader to Update Multiple Devices in a Field Bus Network

MC56F825x/MC56F824x (2M53V) Chip Errata

Table 1 provides silicon errata information that relates to the masks 0M55B, 1M55B, and M55B of the MC9328MX21S (i.mx21s) applications processor.

Transcription:

NXP Semiconductors Application Note Document Number: AN5106 Rev. 1.0, 7/2016 SPI topics: watchdog, serial output and parity check for the dual SOIC 24 V high-side switch family 1 Introduction This application note describes SPI robustness with respect to the Watchdog & parity check and the SPI Serial Output data of the following devices: MC06XS4200 MC10XS4200 MC20XS4200 MC22XS4200 MC50XS4200 These intelligent high-side switches are designed for use in 24 V systems such as trucks, busses, and special engines. They are applicable to other industrial and 12 V applications as well. The low R DS(on) channels can be used to control incandescent lamps, LEDs, solenoids, or DC motors. Control, device configuration, and diagnostics are performed through a 16-bit SPI interface, allowing easy integration into existing applications. For complete feature descriptions, refer to the individual data sheets for the devices. Freescale analog ICs are manufactured using the SMARTMOS process, a combinational BiCMOS manufacturing flow that integrates precision analog, power functions and dense CMOS logic together on a single cost-effective die. Contents 1 Introduction..................................... 1 2 SPI.............................................2 3 SPI robustness monitoring feature.................... 4 4 SPI unused address 011............................6 5 Revision history...................................7 2016 NXP B.V.

SPI 2 SPI 2.1 Serial output register The SPI interface offers full duplex, synchronous data transfers over four I/O lines: Serial Input (SI), Serial Output (SO), Serial Clock (SCLK), and Chip Select (CSB).The SI / SO pins of the device follow a first-in first-out (D15 to D0) protocol. Transfer of input and output words starts with the most significant bit (MSB). CSB SCLK SI D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 SO OD15 OD14 OD13 OD12 OD11 OD10 OD9 OD8 OD7 OD6 OD5 OD4 OD3 OD2 OD1 OD0 Notes 1. 1. RSTB must must be be in in a a logic logic [1] [1] state state during data data transfer. 2. 2. Data enter the SI SI pin pin starting with D15 (MSB) and ending with bit bit D0. 3. 3. Data are available on on the SO pin pin starting with bit bit OD15 0D15 (MSB) and ending with bit bit 0(OD0). Figure 1. 16-bit SPI interface timing diagram Table 1. SI message bit assignment Bit n SI register bit Bit functional description MSB.... LSB D15 Watchdog in (WDIN): Its state must be alternated at least once within the timeout period D14 Parity (P) check. P-bit must be set to 0 for an even number of 1-bits and to 1 for an odd number. D13 Selection between SI registers from bank 0 (0 = channel 0) and bank 1 D12:D10 D9:D0 Register address bits Used to configure the device and the protective functions and to address the SO registers The SO output value depends on the register previously selected by the register: The first sixteen SO register bits are set to the address previously accessed by SI word (bit D13, D2 D0 of the _s input register). Figure 2 shows an SPI sequence under various circumstances, illustrating the SI frames and the corresponding contents of the SO register. NXP Semiconductors 2

SPI Write Register (ex:0x05ff) Write Register to read register (0x4002) Write OCR Register (ex:0x5060) Write Register to read OCR register (0x4004) SPI frame SI MCU to eswitch (n) (n+1) (n+2) (n+3) (n+4) SPI frame SO from eswitch to MCU (X) (X) (Y) (Y) (Z) Here: SO=0x1BFF Here: SO=0x1BFF Here: OCR SO=0x1260 2.2 Control of written SI data Figure 2. SO message versus SI write commands To determine in real time if the SPI communication occurred without errors, extend the frame to 32 bits. Send two identical 16-bit words consecutively on SI, with the CSB pin released for the duration of the 32 bits. The SO output will then report the selected register and the second word from SI. CSB SPI frame SI MCU to eswitch SPI frame SO from eswitch to MCU 16 bits data 0x1234 Selected Register 16 bits data 0x1234 16 bits data 0x1234 Figure 3. 32-bit SPI interface NXP Semiconductors 3

SPI robustness monitoring feature 3 SPI robustness monitoring feature The device monitors the SPI communication robustness through the Watchdog bit and parity check. Parity check (P) must be set so that the total number of 1-bits in the SPI word is even. The Watchdog feature monitors whether the communication has been lost. The device monitors the state of the first bit (WDIN) of the SPI frame. 3.1 Watchdog When the state of the WDIN bit remains unchanged within a data stream of duration t WDTO = 310 ms typ., the device assumes SPI communication has been lost and enters Fail-safe mode. The FSOB pin then goes low. This behavior can be disabled by setting the bit WD_DIS = 1 (register GCR, bit D4) The Watchdog timer starts at the rising edge of RSTB. The SPI frames must be sent with the WDIN bit alternating at least once within the 310 ms timeframe. When the RSTB is not under control (for example, if the device happens to enter Fail-safe Mode at start up,) a sequence must be run to exit from the aforementioned mode: 1. Send a SPI frame with WDIS bit =1 (D15), The register and contents do not matter. 2. Send a second SPI frame with WDIS bit=0 within the 310 ms timeframe. Figure 4 describe the Watchdog timing: SPI Frame Watchdog timer FSOB WDIN = 1 0x8xxx t WDTO > 310 ms Fail Safe state WDIN = 0 0x0AAA t WDTO max > 310 ms Register data register reset Default 0x0AAA new ON/OFF state with new register set HS0 (or HS1) Output controlled with SPI (register ) HS0 (or HS1) Output controlled by IN0 or IN1 register reset implies output are set to default values i.e. output OFF when outputs are controlled by direct inputs, entering Fail Safe mode has no impact on outputs but device configuration is lost, registers are set to default states Figure 4. Watchdog timing diagram When the device enters Fail-safe mode, the output states differ depending on the control method used: If the ON/OFF state is controlled by registers ( register), the registers are reset to default values and the outputs are switched OFF. If the ON/OFF state is controlled by direct inputs IN0 & IN1, the outputs remain controlled by IN0 & IN1 and are not switched OFF. The register are reset to default values. NXP Semiconductors 4

SPI robustness monitoring feature 3.2 Parity check Parity check (P) must be set with an even number of 1-bits in the SPI word (P = 0 for an even number of 1-bits and P = 1 for an odd number.) The parity bit is Bit14 of the SPI frame. If the MCU happens to erroneously set a communication fault or Parity bit, the device reports the parity error at the next SPI frame even if the SPI frame indicates no parity error. Figure 5 show several scenarios of an SPI sequence. The drawing illustrates the parity errors on the SI frames and the corresponding contents on SO. The SO output bits follow the same rule described in Figure 4. In this example, the register is selected with for SO read and all register writings apply to the register. with wrong Parity bit 2nd frame with wrong Parity bit with correct Parity bit with correct Parity bit SPI frame SI MCU to eswitch (n) (n+1) (n+2) (n+3) (n+4) SPI frame SO from eswitch to MCU (n-1) (n) (n) (n) (n+3) BIT PF = 0 BIT PF = 0 BIT PF = 1 BIT PF = 1 BIT PF = 0 (n + 1) data ignored (n + 1) & (n+2) data ignored When a parity error occurs on the previous SPI SI frame, the PF bit is raised and reported on SO regardless of the register selected for read. Figure 5. Parity check NXP Semiconductors 5

SPI unused address 011 4 SPI unused address 011 As shown in Figure 6, the address 011, bit D12-D10 of the Serial Input register addresses is not used. Register writes to this address are ignored and the SO data reports the content of the previous read register selected. If the register selects the 011 address as the selected register, the read and write is ignored and the result of the previous register selection is used. Write Register to read Register X Register write with address = 011 Register write to Register X SPI frame SI MCU to eswitch (n) (n+1) (n+2) (n+3) SPI frame SO from eswitch to MCU (W) (X) (X) (n+2) data from previous register read selection with Register X Register X (n + 1) data is Ignored Register X Figure 6. Addressing address 011 NXP Semiconductors 6

Revision history 5 Revision history Revision Date Description 1.0 5/2015 Initial release 7/2016 Updated to NXP document form and style NXP Semiconductors 7

How to Reach Us: Home Page: NXP.com Web Support: http://www.nxp.com/support Information in this document is provided solely to enable system and software implementers to use NXP products. There are no expressed or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document. NXP reserves the right to make changes without further notice to any products herein. NXP makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does NXP assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation, consequential or incidental damages. "Typical" parameters that may be provided in NXP data sheets and/or specifications can and do vary in different applications, and actual performance may vary over time. All operating parameters, including "typicals," must be validated for each customer application by the customer's technical experts. NXP does not convey any license under its patent rights nor the rights of others. NXP sells products pursuant to standard terms and conditions of sale, which can be found at the following address: http://www.nxp.com/terms-of-use.html. NXP, the NXP logo, Freescale, the Freescale logo, and SMARTMOS are trademarks of NXP B.V. All other product or service names are the property of their respective owners. All rights reserved. 2016 NXP B.V. Document Number: AN5106 Rev. 1.0 7/2016