Freescale Semiconductor, Inc. Application Note Document Number: AN5047 Rev. 0, 01/2015 Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs The Freescale Kinetis L low-power MCU family offers superb low-power features which allow the use of various MCU peripherals in an asynchronous mode while the CPU is in one of many low-power modes. The LPUART, SPI, I²C, ADC, DAC, LP timer and DMA support in the low-power mode operation, without waking up the core, gives designers the freedom to build various low-power sensing devices. 1 Introduction This application note shows how to build a low-power encoder based on the magneto resistive (MAG) sensors. The goal is to build a very low-power/low-rotation speed design which may be used in the paddle wheel flow meters to measure paddle wheel rotation. The important advantage of a magnetic sensor is its low power consumption and simple implementation. The traditional dry paddle wheel flow meter uses a magnetic clutch between the paddle wheel and counter. If magnetic sensors are used and the mechanical counter is replaced by its electronic version, there is no need for changes in the paddle wheel (wet) part of the meter. The wet part remains the same and the customer may select to use the mechanical or electronic counter. © 2015 Freescale Semiconductor, Inc. All rights reserved. Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2. The magneto resistive sensor principle and how to build a quadrature encoder. . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3. Set up the Kinetis L periphery for low-power encoder measurement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4. Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5. Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 A. Board schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 The magneto resistive sensor principle and how to build a quadrature encoder The electronic paddle wheel flow meters (hybrid flow meters) are battery operated and obviously current consumption is a critical part of the design. 2 The magneto resistive sensor principle and how to build a quadrature encoder There are many types of magnetic sensors, which we can sort by the measurement principle and sensor output. There are two main measurement principles, the Hall effect and magneto resistive sensors. Magneto resistive: • Outputs voltage in tens of millivolts, low noise, stable • Reacts on both N and S polarities • Operates in a horizontal magnetic field • Bridge has a fast response (uS) • Superior temperature stability • Low power consumption ~5k Ohms bridge Hall effect resistive: • Operates in a vertical magnetic field • Reacts only on one polarity • Outputs voltage in the millivolt range (requires pre-amplification) 2.1 • • Possible outputs Digital — Continuously operated – sensing element provides a continuous output which is transformed into a digital value — Sampled – sensor element is powered/sensed at a predefined sampling rate to save current flowing through, and the value is latched on a digital output — Sampled with output latch – each time a sensor is powered on, the sensing element is measured and the digital output signal is latched Analog single ended / differential – provides direct output from the sensing element bridge To show the advanced periphery set available on the Kinetis-L MCU, the simplest possible sensor was chosen for this application note. The HGRAMA001A magneto resistive sensor provides analog output from a magneto resistive bridge. The analog signal from the sensor bridge is connected to the comparator input. 2.2 Build the encoder The key element of the encoder is the magnetic clutch attached to the paddle wheel and the two magneto resistive sensors. The paddle wheel is placed in the wet part of the meter, while the magneto resistive sensors are in the counter – the dry part. The paddle wheel is rotating proportionally to the water flow, and the attached magnetic clutch creates a rotating magnetic field. The sensors transform the magnetic field to Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 2 Freescale Semiconductor, Inc. The magneto resistive sensor principle and how to build a quadrature encoder the output voltage. The sensors’ output voltage has the character of two sine waves shifted by 90 degrees to each other. Figure 1. Paddle wheel and magnetic clutch The magnetic clutch is composed of a few magnetic poles. In Figure 2, there is a clutch with two magnet poles. Figure 2. The magnetic sensor-based encoder principle at work Two magnetic sensors are placed near to the magnetic clutch attached to the paddle wheel. The diagram shows sensor output voltage as a function of the magnetic clutch angular position. The magnetic sensor output voltage is sensed by means of the comparator, so the sine wave is transformed into the rectangular signal as shown in Figure 3. Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 Freescale Semiconductor, Inc. 3 Set up the Kinetis L periphery for low-power encoder measurement 7XUQULJKW 6HQVRU 6 6 6 6 6 6 6 6 6HQVRU 7XUQOHIW 6HQVRU 6 6 6 6 6 6 6 6 6HQVRU Figure 3. The quadrature encoder signals from the sensors when turned right/left in continuous mode In Figure 3, there is a graph of signals produced by the encoder. The angular position, and thus, rotation and the rotation direction may be determined from the actual waveform. The signals in the picture are continuous but in reality the magnetic sensors are used in the sampling mode. A common magneto resistive sensor has an impedance of around 10k Ohm, so that, assuming a 3.3V power supply, the sensor draws 330uA. To lower the current consumption, sensors are operated in the triggered mode. The power supply to a sensor is applied only for a short time, like 30us, and the sensor output is sampled. What is the lowest sampling rate to correctly measure rotation? For accuracy and safe rotation detection, the correct sampling rate is important. Use the following formula to calculate the minimal sampling rate, provided that there are two sensors spaced by 90 degrees to each other. 3 Set up the Kinetis L periphery for low-power encoder measurement The Kinetis L family of microcontrollers has a rich set of peripherals and features that enable the sensing and processing of analog signals without CPU intervention. A smart combination of the low-power peripherals with the unique features of DMA works as an independent scanning engine to sense an encoder. This section covers interfacing of the magneto resistive sensors, configuration of the peripherals and a description of the measurement technique. Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 4 Freescale Semiconductor, Inc. Set up the Kinetis L periphery for low-power encoder measurement 3.1 Magneto resistive sensor schematic and interface to Kinetis L periphery As mentioned previously, hybrid flow meters are battery operated and power consumption is obviously very important, and the way of interfacing the sensors determines the final consumption. To achieve low power consumption while sensing the magneto resistive sensors, only the peripherals are working while the CPU is in the very low-power mode. Figure 4 is a block diagram of interfacing the magneto resistive sensors. Timer TPM0 CH1 supplies the sensors. The TPM0, clocked directly from the 32 kHz crystal, may stay counting while the CPU is in one of the many power saving modes. The timers continue to count clocks, and, if in the PWM mode, the timers’ outputs may be propagated on the pins. Timer TMP0 generates a power supply waveform to the sensors. The timer generates a 30uS pulse at the rate of the sampling frequency. At the end of TPM0CH1 pulse, the comparator CMP reads out the voltage on the sensor. The comparator’s multiplexer MUX selects the signal from the actually measured sensor. M CG 32kHz T PM 0 CH1 KINET IS KL46 CM P M U X cm p ch0 SENSOR 0 cm p ch1 SENSOR 1 Figure 4. Magneto resistive sensor interfacing block diagram 3.2 Sensor measurement timing diagram Figure 5 shows a detailed sensor control timing diagram. The timer TPM0CH1 is set to the PWM mode. The modulo register defines the measurement sampling rate. The magnetic sensor is active only for the single bus clock, so that is 30us. During this 30us, the magneto resistive sensor is powered and the comparator enabled. At the end of the pulse, the comparator output is read and stored. In the first measurement cycle, the sensor 0 is read, while in the next measurement cycle, the comparator reads the second sensor. Timer TPM0CH1 controls the sensors’ power supply and measurement timing. Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 Freescale Semiconductor, Inc. 5 Set up the Kinetis L periphery for low-power encoder measurement T PM0 overflow TPM0CH1 pulse T PM 0 com pare T PM 0 overflow T PM 0 compare 1 busclock 30us 1/sam pling freq.= busclock * T PM 0 modulo Power supply sensor CM P read status sensor 0 CM P read status sensor0 Sensor 0 sensors have differential output CMP read status sensor1 Power supply sensor Power supply sensor Sensor 1 CM P off CM P enable Com parator enable com parator scan channel 0 CM P off CM P enable com parator scan channel 1 CM P off CMP enable com parator scan channel 0 Figure 5. Sensor control signal timing diagram 3.3 How the comparator is controlled It was previously mentioned that the comparator reads sensor voltage at end of a TPM0CH1 pulse. How is this driven, and how is the comparator output status processed? The guts of the sensor sampling mechanism are three channels of the Direct Memory Access (DMA) periphery running in the VLPS mode without CPU intervention. The DMA periphery can move data between RAM and registers of arbitrary periphery. This technique allows the DMA to control periphery by setting their control registers. In the opposite transfer direction, the DMA may read a periphery status register and store content in the RAM. The DMA transfers operate in the triggered mode, which means that a single DMA transfer is performed every time the DMA channel is triggered. The timer TPM0 runs in the VLPS mode and TPM0 can also trigger DMA transfers. By the proper setting of the TPM0 timer and related timer channel TPM0CH1, both are working as the trigger event of associated DMA channels, and the scanning state machine may be formed. The state machine performs scanning by CMP comparator inputs and stores the results in the RAM memory. After a predefined number of scanning cycles, the CPU wakes up and results in the RAM are processed. Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 6 Freescale Semiconductor, Inc. Set up the Kinetis L periphery for low-power encoder measurement RAM memory CMP MUX channel 0 CMP MUX channel 1 CMP MUX channel 0 CMP MUX channel 1 MCG 32kHz TPM0-CH1 CMP MUX channel off Comparator result 0 Step3: DMA CH2, 1B transfer T rg: DMA CH1 moves MUX setting to CMP MUX Step1: DMA CH0 , 1B transfer T rg: TPM0-CH1 moves MUX setting to CMP MUX quartz CMP MUX channel off pulse Comparator result 1 Comparator result x Step2: DMA CH1, 1B transfer T rg: T PM0-OVF stores CMP result to RAM sensor 0 sensor 1 TPM0-OVF Result T PM0-CH1 pulse channel 0 channel 1 MUX Comparator Figure 6. Setting the DMA channels, timer and comparator to build a scanning machine Figure 6 is a block diagram with the connection of the peripherals and DMA channels. The CPU is in the VLPS mode, the time domain is generated by a quartz crystal so that the bus clock is 32,768 kHz. The TPM0 timer is clocked from the bus clock. The TPM0 timer is used to trigger the DMA and to power supply the sensors. The TPM0 modulo register value defines the timer overflow, and thus the sampling rate. Provided that the bus clock is 32 kHz and the sampling rate is 400 Hz, the TPM modulo register must be set to the value 32k/400. The common paddle wheel-based flow meter has a rotation ~40 rotations per second at maximal flow and then the minimal sampling rate is 320 samples per second (the 180 samples per second each sensor). To have a margin above the Nyquist frequency, the sampling rate was set to 400 Hz The scanning state machine is repeatedly performing the following steps: • Step 1: A TPM0 CH1 overflow event triggers an associated DMA CH0 channel transfer. The DMA CH0 is set to transfer a configuration byte from RAM to the CMP MUX register, to connect the comparator to the sensor0. — The CMP MUX channel setting also controls the comparator on/off state. If the CMP MUX channels are set to a non-valid state (for example, comparator positive and negative input to the same pin), the comparator switches off. Correctly selected MUX inputs will switch the comparator on. — The TPM0CH1 output is propagated to the pin and supplies the sensors. • Step 2: A TPM0 compare event triggers DMA CH1 to transfer the CMP output status register value to the RAM. Results from both sensors are stored into the single array in the form: sensor1result, sensor2result, sensor1result, sensor2result, sensor1result, sensor2result,… . • Step 3: DMA CH2 is linked to DMA CH1, and is triggered once the DMA CH1 finishes transfer. The DMA CH2 is set to transfer a control byte to the CMP MUX register again. The DMA CH2 Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 Freescale Semiconductor, Inc. 7 Set up the Kinetis L periphery for low-power encoder measurement transfers the MUX setting with both inputs set to the same pin, and thus switches the comparator off. After a predefined number of DMA cycles (256 cycles in this case), the CPU is awoken and the results stored in the RAM are processed. In the RAM memory, there is a byte array filled with values corresponding to the state of the sensors. Sensor 1 Sensor 2 Sensor 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 RA M 0 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 0 1 0 1 0 0 0 0 Figure 7. Comparator output state is stored in the array in the RAM on each measurement cycle 1 The results of sensor 0 and sensor 1 are interlaced in the array. 3.4 Hardware used to implement the encoder The encoder framework was implemented on a Kinetis MKL46Z256 processor. For the development, the tower system was used. The development set contains the processor board TWR-KL46Z48M, primary and secondary elevators (TWR-ELEV-PRIMARY, TWR-ELEV-PRIMARY,) and the peripheral module TWR-FLOW-MAG. See the boards in Figure 8. Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 8 Freescale Semiconductor, Inc. Set up the Kinetis L periphery for low-power encoder measurement Figure 8. The accessory board TWR_FLOW_MAG 1 Assembled with a spindle to attach the paddle wheel with a magnetic clutch. This is the way to emulate a real flow meter on the desk. Figure 9. The TWR-FLOW-MAG board with a paddle wheel as the encoder There are several jumpers and header connectors on the board, serving as test points and to configure the sensors used. For detailed information, refer to Appendix A, “Board schematic. Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 Freescale Semiconductor, Inc. 9 Set up the Kinetis L periphery for low-power encoder measurement Detailed board description: The magnetic sensor peripheral board TWR_FLOW_MAG is assembled with two different sensor pairs, HGRAMA001A and HMC1501. There is a set of headers used to select which pair is connected to the power supply and comparator. Each time, only one type of sensor may be used. Figure 10. Peripheral board description J5 power supply: The sensors are powered by the timer TPM0CH1 output pin. Use a jumper to power supply a selected sensor pair. • 1-2: the HMP1501 sensors are supplied • 2-3 the HGRAMA001A sensors are supplied • J1, J2, J3, J4 : headers to select which sensor pair is connected to the comparator input. • 1-2: the HMC1501 sensors are connected to comparator inputs • 2-3: the HGRAMA001A sensors are connected to comparator inputs J6 test points: • J6[Pin1]: the TPM1CH1 timer output pin • J6[Pin2]: the TPM1CH0 timer output pin • J6[Pin3]: the CMP0_OUT comparator output pin J7 test points: • J7[Pin1]: the TPM0CH0 timer output pin • J7[Pin2]: the TPM0CH2 timer output pin • J7[Pin3]: the TPM0CH3 timer output pin Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 10 Freescale Semiconductor, Inc. Software 4 Software This section describes the software application of the Kinetis-L magneto resistive sensor encoder demo. The software application consists of the setting of all the peripherals needed, measurement and calculation of the paddle wheel turns. The application software has been written in C-language and compiled using the IAR Embedded Workbench for ARM (version 6.50.6), with full optimization for execution speed. The software application is based on the Kinetis-L bare-metal software drivers. The software consists of a few basic blocks. In the beginning, the processor is awoken by a Power on Reset. At the start, the clock is changed to 32 kHz crystal. In the following step, all the peripheries are configured. The clock is enabled only to the running peripheries, to save current. The low-voltage detect unit is enabled to sense the battery level. The TMP0 timer is configured and the related pin is set to output. Then the LCD driver periphery and RTC are initialized. As the last step, the comparator CMP and DMA channels are set up and then an interrupt is enabled. The CPU goes into VLPS mode and may be awoken by one of the following interrupts: • DMA interrupt service routine is called after a predefined number of DMA cycles. The states of the sensors stored in the RAM are processed and the counters of the paddle wheel turns are updated. DMA channels are re-initialized and the LCD screen is refreshed. • PORT interrupt service routine is called whenever the SW4 button is pressed. In the routine, the index to the LCD screen is updated • Real-time clock (RTC) interrupt service routine is called each second, and the task scheduler is called. The task scheduler is a table of tasks called at a defined time daily and at a defined time and date each month. • LVD interrupt service routine – this interrupt is called once the power supply voltage drops below a preset level, indicating that the battery is empty. The user should do the maintenance necessary to avoid a CPU runaway and data corruption. Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 Freescale Semiconductor, Inc. 11 Conclusion Power on Reset Set clock to 32k Hz cry stal Initialize peripheries: TMR0, TMR1 PO RT,RTC ,LC D DMA , C MP Initialize v ariables Enable interrupts DMA ISR re-initialize DMA channels parse sensor states stored in the RA M update counters refresh LC D screen LVD ISR low-v oltage detect battery is low C PU goes to VLPS mode PO RT ISR called at button press update LC D screen RTC ISR called at 1 sec interv al run task scheduler Figure 11. Software flow chart 5 Conclusion 5.1 The current consumption All measurement was done in a laboratory at 25°C, the current measured by an HP34401A multimeter. Table 1 is divided into two parts; the five rows at the beginning show the current consumption of the static peripherals which are not dependent on the selected sampling rate. Periphery current consumption is in the row “Current.” The row “Total” shows the cumulative current. The CPU current consumption is in the VLPS mode, and draws 2.8uA. Adding TMP0, TMP1, RTC and LCD to the processor current gives a total static current consumption of 4uA. In this state, the CPU remains in the VLPS mode forever. The second part of the table is dynamic and is dependent on the selected sampling rate, measured at 100, 200, 300 and 400 samples per second. The selected sampling rate also affects the current consumption of the comparator and the comparator digital-to-analog converter CMP_DAC periphery, as those are enabled only at measurement and stay disabled the rest of time. Table 1. current consumption of the Kinetis-L in the VLPS mode with various peripheries active. Adder static part Current [uA] Total [uA] CPU VLPS mode 2.8 2.8 Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 12 Freescale Semiconductor, Inc. Conclusion Table 1. current consumption of the Kinetis-L in the VLPS mode with various peripheries active. TPM0 0.3 3.1 TPM1 0.3 3.4 RTC 0.1 3.5 LCD 0.5 4 DMA + CMP + CMP ADC @ 100Hz 4 8 DMA + CMP + CMP ADC @ 200Hz 7 11 DMA + CMP + CMP ADC @ 300Hz 11 15 DMA + CMP + CMP ADC @ 400Hz 15 19 HGRAMA001A @ 100Hz 2 21 HGRAMA001A @ 200Hz 4 23 HGRAMA001A @ 300Hz 6 25 HGRAMA001A @ 400Hz 8 27 Adder dynamic part / sampling rate Adder of sensor The last part of the table shows current consumption of the HGRAMA001 sensors dependent on the sampling rate. Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 Freescale Semiconductor, Inc. 13 Board schematic Appendix A Board schematic 5 4 3 2 1 VDD _H G AR AM VDD _H G AR AM P T E 2 2 /A D C 0 _ D P 3 /A D C 0 _ S E 3 /U A R T 2 _ T X CMP0_IN0 C M P 0 _ IN 0 /H M C U2 VDD 0 DNP C M P 0 _ IN 0 /H G A R A M V1 3 C M P 0 _ IN 0 /H G A R A M V1 3 C M P 0 _ IN 2 /H G A R A M 1 C M P 0 _ IN 1 /H G A R A M V2 1 D C M P 0 _ IN 3 /H G A R A M HG ARAM 001A 4 H G ARAM 001A 4 J1 V2 GND GND 1 2 3 D VDD U1 R1 2 2 P T C 6 /L L W U _ P 1 0 /E X T R G _ IN /S P I0 _ M IS O H D R T H 1X3 VDD_HM C VD D _HM C CMP0_IN1 2 H D R T H 1X3 C M P 0 _ IN 0 /H M C C M P 0 _ IN 1 /H M C 5 V B R ID G E 8 N C _3 N C _4 N C _6 HM C1501 OUT+ 1 C M P 0 _ IN 2 /H M C C OUTGND1 OUTGND1 J2 OUT+ 8 C M P 0 _ IN 3 /H M C GND2 N C _3 N C _4 N C _6 3 4 6 2 C M P 0 _ IN 1 /H G A R A M 1 GND2 C M P 0 _ IN 1 /H M C 1 2 3 C 0 DNP 3 4 6 U4 V B R ID G E U3 R2 7 5 P T E 2 0 /A D C 0 _ D P 0 /A D C 0 _ S E 0 7 P T C 7 /C M P 0 _ IN 1 H M C1501 J6 CMP0_IN2 P T C 8 /K L 4 6 _ U S B _ ID P T E 2 3 /A D C 0 _ D M 3 /A D C 0 _ S E 7 A /U A R T 2 _ R X R3 0 1 2 3 P T D 1 /A D C 0 _ S E 5 B /S P I0 _ S C K /F T M 0 _ C H 1 DNP VD D _H M C P T C 5 /L L W U _ P 9 /S P I0 _ S C K /C M P 0 _ O U T P T A 1 2 /F T M 1 _ C H 0 P T A 1 3 /F T M 1 _ C H 1 H DR TH 1X3 VDD_HGARAM B B J7 C M P 0 _ IN 2 /H G A R A M 1 2 3 1 2 3 1 2 3 C M P 0 _ IN 2 /H M C P T D 0 /S P I0 _ P C S 0 /F T M 0 _ C H 0 P T D 2 /S P I0 _ M O S I/U A R T 2 _ R X /F T M 0 _ C H 2 /S P I0 _ M IS O P T D 3 /S P I0 _ M IS O /U A R T 2 _ T X /F T M 0 _ C H 3 /S P I0 _ M O S I H D R T H 1X3 J3 J5 H D R T H 1X3 H DR TH 1X3 CMP0_IN3 P T C 9 /C M P 0 _ IN 3 /I2 C 0 _ S D A /F T M 0 _ C H 5 R4 C M P 0 _ IN 3 /H M C T h is d o c u m e n t c o n ta in s in fo rm a tio n p ro p rie ta ry to F re e s c a le a n d s h a ll n o t b e u s e d fo r e n g in e e rin g d e s ig n , p ro c u re m e n t o r m a n u fa c tu re in w h o le o r in p a rt w ith o u t th e e x p re s s w ritte n p e rm is s io n o f F re e s c a le . 0 DNP ____ C M P 0 _ IN 3 /H G A R A M D e s ig n e r : < D e s ig n e r> D ra w in g T itle : D ra w n b y: < D ra w n B y> P a g e T itle : J4 A p p ro v e d : < A p p ro v e r> S iz e A H D R T H 1X3 4 ____ A P a d d le w h e e l a c c e s o ry b o a rd - m a g n e tic s e n s o r D a te : 5 X TW R_FLO W _M AG 1 2 3 A P T E 2 1 /A D C 0 _ D M 0 /A D C 0 _ S E 4 A 3 D ocum ent N um ber Rev X S C H -2 8 4 1 0 P D F : S P F -2 8 4 1 0 W e d n e s d a y, O c to b e r 0 1 , 2 0 1 4 2 Sheet 1 of 2 1 Figure 12. TWR_FLOW_MAG Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 14 Freescale Semiconductor, Inc. Board schematic 5 4 3 2 1 D D E L E VAT O R C O N N E C TO R P5V_ELEV P 5 V _E L E V P5V_ELEV P 5V _ E L E V P 3 V 3_ R E G P3V3_REG P3V3_REG E LE_P S _S E N S E R5 DNP 0 P T E 2/S PI1_S C K R 12 DNP 0 S D H C _C LK /S PI1_C LK PT E4/SP I1_PC S0_B PT E 1/S P I1_M O S I R 14 R 15 R8 DNP DNP DNP 0 0 0 S D H C _D 3/S P I1_C S0_B S D H C _C M D /SP I1_M O S I SD H C _D 0/S PI1_M IS O P T E 3/S PI1_M IS O C P T C 7 /C M P 0 _ IN 1 P T E 0/U A R T 1_T X/R T C _C LK O U T /C M P 0_O U T P T B 11/S PI1_S C K P T C 0/A D C 0_S E 14/T SI0_C H 13 P T B 1/A D C 0_S E9/T S I0_C H 6 P T B 2/A D C 0_S E12/T S I0_C H 7 P T B 3/A D C 0_S E13/T S I0_C H 8 PT A 5/F T M 0_C H 2 P T E 5/ G P IO 4 P T D 6/LLW U _ P15/A D C 0_SE 7B /SP I1_M O S I/U A R T 0_R X/S P I1_M ISO PT D 5/AD C 0_SE 6B /SP I1_SC K/U A R T 2_T X /F T M 0_ C H 5 PT D 4/LLW U _P 14/S PI1_P C S 0/U A R T 2_R X /F T M 0_ C H 4 P T D 3 /S P I0 _ M IS O /U A R T 2 _ T X /F T M 0 _ C H 3 /S P I0 _ M O S I P T D 2 /S P I0 _ M O S I/U A R T 2 _ R X /F T M 0_ C H 2 /S P I0 _ M IS O P T D 0 /S P I0 _ P C S 0 /F T M 0 _ C H 0 P T D 4 /L L W U _ P 1 4 /S P I1 _ P C S 0 /U A R T 2 _ R X /F T M 0 _ C H 4 P T D 1 /AD C 0 _ S E 5 B /S P I0 _ S C K /F T M 0 _ C H 1 PT C 12/F T M _C LKIN 0 PTA7 B P T A 14 P T C 18 P T C 6 /L L W U _ P 1 0 /E X T R G _ IN /S P I0 _ M IS O P T C 5 /L L W U _ P 9 /S P I0 _ S C K /C M P 0 _ O U T R 16 R 17 R 19 DNP DNP 0 0 0 PT C 7_ELE V _G P IO 1 G P IO 2/SD H C _D 1 P T B 11_E LE V_G PIO 3 R 23 R 25 R 27 R 29 DNP DNP DNP DNP 0 0 0 0 P T B 0_ELE V _A N 7 P T B 1_ELE V _A N 6 P T B 2_ELE V _A N 5 P T B 3_ELE V _A N 4 R 33 R 35 R 38 R 40 R 42 DNP DNP DNP DNP DNP R 62 0 0 0 0 0 DNP DNP R 65 DNP R 67 DNP R 68 R 69 P T E 5_ELE V _G P IO 4 PT D 6_ELE V _P W M 6 PT D 5_ELE V _P W M 5 PT D 4_ELE V _P W M 4 0 0 0 R 47 R 49 R 51 R 53 R 55 R 59 0 0 P T D 3_E LEV _S PI0_M IS O P T D 2_E LEV _S PI0_M O S I P T D 0_E LEV _S PIO _C S0 P T D 4_E LEV _S PI0_C S 1 P T D 1_E LEV _S PI0_C LK 0 P T C 12_E LEV _G PIO 5 0 P T A 7_E LE V 0 P T A 14_ELE V 0 0 0 P T C 18_E LEV P T C 6_E LEV _IR Q _B P T C 5_E LEV _IR Q _A P 3V 3_ R E G J8A B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15 B16 B17 B18 B19 B20 B21 B22 B23 B24 B25 B26 B27 B28 B29 B30 B31 B32 B33 B34 B35 B36 B37 B38 B39 B40 B41 B42 B43 B44 B45 B46 B47 B48 B49 B50 B51 B52 B53 B54 B55 B56 B57 B58 B59 B60 B61 B62 B63 B64 B65 B66 B67 B68 B69 B70 B71 B72 B73 B74 B75 B76 B77 B78 B79 B80 B81 B82 5V_1 GND_1 3 .3 V _ 1 ELE_PS_SEN SE_1 GND_2 GND_3 S D H C _ C L K /S P I1 _ C L K S D H C _ D 3 /S P I1 _ C S 1 S D H C _ D 3 /S P I1 _ C S 0 S D H C _ C M D /S P I1 _ M O S I S D H C _ D 0 /S P I1 _ M IS O ET H _C O L_1 ET H _R XE R _1 E T H _ T X C LK _ 1 ET H _T XEN _1 ET H _T XER ET H _T XD 3 ET H _T XD 2 E T H _ T X D 1_ 1 E T H _ T X D 0_ 1 G P IO 1 /U A R T 1 _ R T S G P IO 2 /S D H C _ D 1 G P IO 3 C L K IN 0 C LKO U T 1 GND_4 AN7 AN6 AN5 AN4 GND_5 DAC 1 T MR3 T MR2 G P IO 4 3 .3 V _ 2 PW M7 PW M6 PW M5 PW M4 C AN 0_R X C AN 0_T X 1 W IR E S P I0 _ M IS O /IO 1 S P I0 _ M O S I/IO 0 S P I0 _ C S 0 S P I0 _ C S 1 S P I0 _ C L K GND_6 I2 C 1 _ S C L I2 C 1 _ S D A G P IO 5 /S P I0 _ H O L D /IO 3 R SR V_ B5 3 R SR V_ B5 4 IR Q _ H IR Q _ G IR Q _ F IR Q _ E IR Q _ D IR Q _ C IR Q _ B IR Q _ A E B I_ A L E /E B I_ C S 1 E B I_ C S 0 GND_7 E B I_ A D 1 5 E B I_ A D 1 6 E B I_ A D 1 7 E B I_ A D 1 8 E B I_ A D 1 9 E B I_ R /W E B I_ O E E B I_ D 7 E B I_ D 6 E B I_ D 5 E B I_ D 4 E B I_ D 3 E B I_ D 2 E B I_ D 1 E B I_ D 0 GND_8 3 .3 V _ 3 5 V_ 2 GND_9 3 .3 V _ 4 3 .3 V _ 5 G ND_10 G ND_11 I2 C 0 _ S C L I2 C 0 _ S D A G P IO 9 /U A R T 1 _ C T S G P IO 8 /S D H C _ D 2 G P IO 7 /S D _ W P _ D E T ET H _C R S ET H_MDC_1 E T H _ M D IO _ 1 ET H _ R XC L K_ 1 ET H _R XD V_ 1 ET H _R XD 3 ET H _R XD 2 ET H_RXD1_1 ET H_RXD0_1 I2 S 0 _ M C L K I2 S 0 _ D O U T _ S C K I2 S 0 _ D O U T _ W S I2 S 0 _ D IN 0 I2 S 0 _ D O U T 0 G ND_12 AN 3 AN 2 AN 1 AN 0 G ND_13 DAC 0 T MR1 T MR0 G P IO 6 3 .3 V _ 6 PW M3 PW M2 PW M1 PW M0 U AR T 0_R X U AR T 0_T X U AR T 1_R X U AR T 1_T X VSSA VDD A C AN 1_R X C AN 1_T X G ND_14 G P IO 1 4 G P IO 1 5 G P IO 1 6 /S P I0 _ W P /IO 2 G P IO 1 7 U SB0_D M U SB0_D P U S B 0 _ ID U S B 0 _V B U S I2 S 0 _ D IN _ S C K I2 S 0 _ D IN _ W S I2 S 0 _ D IN 1 I2 S 0 _ D O U T 1 R S T IN R ST O U T C LKO U T 0 G ND_15 E B I_ A D 1 4 E B I_ A D 1 3 E B I_ A D 1 2 E B I_ A D 1 1 E B I_ A D 1 0 E B I_ A D 9 E B I_ A D 8 E B I_ A D 7 E B I_ A D 6 E B I_ A D 5 E B I_ A D 4 E B I_ A D 3 E B I_ A D 2 E B I_ A D 1 E B I_ A D 0 G ND_16 3 .3 V _ 7 PC I E X P R ES S T O W E R S Y ST EM A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 A21 A22 A23 A24 A25 A26 A27 A28 A29 A30 A31 A32 A33 A34 A35 A36 A37 A38 A39 A40 A41 A42 A43 A44 A45 A46 A47 A48 A49 A50 A51 A52 A53 A54 A55 A56 A57 A58 A59 A60 A61 A62 A63 A64 A65 A66 A67 A68 A69 A70 A71 A72 A73 A74 A75 A76 A77 A78 A79 A80 A81 A82 J8B D1 D2 D3 D4 D5 D6 D7 D8 D9 D 10 D 11 E LE _P S_S EN SE I2C 0_S C L_E LEV I2 C 0 _ S D A _ E L E V PT C 9/ U A R T 1_C T S PT B10_E LE V _G P IO 8 PT B9_E LEV _G P IO 7 R 13 R6 R9 R7 R 10 I2 S 0 _ M C L K I2 S 0 _ T X _ B C L K I2 S 0 _ T X _ F S I2 S 0 _ R X D I2 S 0 _ T X D AN3 AN2 AN1 AN0 D A C 0_O U T _E LEV TMR1 TMR0 G PIO 6_ELE V P T C 4_E LE V_P W M 3 P T C 3_E LE V_P W M 2 P T C 2_E LE V_P W M 1 P T E 24_ELE V _P W M 0 PT A1_E LEV _U A R T 0_R X PT A2_E LEV _U A R T 0_T X ELE V_U A R T 1_R X ELE V_U A R T 1_T X VS S A_E LEV VD D A_E LEV G P IO 14 G P IO 15 R 57 R 58 DNP G P IO 17 R 60 R 61 R 63 R 64 R 66 0 DNP 0 DNP 0 DNP 0 0 DNP DNP DNP 0 0 0 0 0 DNP DNP R 11 R 18 R 20 R 21 R 22 P T B 0/AD C 0_SE 8/T S I0_C H 0 P T E 25/I2C 0_SD A P T C 9 /C M P 0 _ IN 3 /I2 C 0 _ S D A /F T M 0 _ C H 5 P T B 10/SP I1_P C S 0 PTB9 DNP DNP DNP DNP DNP 0 0 0 0 0 R 24 R 26 R 28 R 30 0 0 0 0 R 31 R 32 R 34 R 36 0 0 0 0 R 37 R 39 R 41 R 43 R 44 R 45 R 46 R 48 R 50 R 52 R 54 R 56 0 0 DNP DNP DNP DNP DNP DNP DNP DNP DNP DNP DNP DNP DNP 0 0 0 0 0 0 0 0 0 0 0 0 D 12 D 13 D 14 D 15 D 16 D 17 D 18 D 19 D 20 D 21 D 22 D 23 D 24 D 25 D 26 D 27 D 28 D 29 D 30 D 31 D 32 D 33 D 34 D 35 D 36 D 37 D 38 D 39 D 40 D 41 D 42 D 43 D 44 D 45 D 46 D 47 D 48 D 49 D 50 D 51 D 52 D 53 D 54 D 55 D 56 D 57 D 58 D 59 D 60 D 61 D 62 D 63 D 64 D 65 D 66 D 67 D 68 D 69 D 70 D 71 D 72 D 73 D 74 D 75 D 76 D 77 D 78 D 79 D 80 D 81 D 82 P T A17 P T A5/F T M 0_C H 2 P T A13/F T M 1_C H 1 I2S 0_R X D 0 P T A12/F T M 1_C H 0 P T E 2 0 /A D C 0 _ D P 0 /A D C 0 _ S E 0 P T E 2 1 /A D C 0 _ D M 0 /A D C 0 _ S E 4 A P T E 2 2 /A D C 0 _ D P 3 /A D C 0 _ S E 3 /U AR T 2 _ T X P T E 2 3 /A D C 0 _ D M 3 /A D C 0 _ S E 7 A /U A R T 2 _ R X P T E 3 0 /D AC 0 _ O U T /A D C 0 _ S E 2 3 P T A 1 3 /F T M 1 _ C H 1 P T A 1 2 /F T M 1 _ C H 0 P T E 31/F T M 0_C H 4 P T C 4/LLW U _P 8/U AR T 1_T X /F T M 0_C H 3 P T C 3/LLW U _P 7/U AR T 1_R X /F T M 0_C H 2/C LK O U T P T C 2/AD C 0_S E 11 /T S I0 _C H 15/I2C 1_SD A P T E 24/I2C 0_SC L P T A 1/T S I0_C H 2/U AR T 0_R X P T A 2/T S I0_C H 3/U AR T 0_T X U A R T 1_R X _ELE V U A R T 1_T X _E LEV V R EF H PT B20 P T B 21 VREFL VDDA V SS A P T B 22 KL46_ELE V _U SB 0_D N KL46_ELE V _U SB 0_D P P T C 8 /K L 4 6 _ U S B _ ID VB U S _ELE V R S T _IN _B R S T _O U T _B P T C 3_E LE V _C LK O U T R 70 R 71 R 72 DNP DNP DNP 0 0 0 R S T _T G T M C U _B P T A 6/T PM 0_C H 3 P T C 3/LLW U _P 7/U A R T 1_R X /F T M 0_C H 2/C LK O U T 5V_3 G N D _17 3 .3 V _ 8 ELE_PS_SEN SE_2 G N D _18 G N D _19 S P I2 _ C L K S P I2 _ C S 1 S P I2 _ C S 0 S P I2 _ M O S I S P I2 _ M IS O 5V_4 G N D _25 3 .3 V _ 1 1 3 .3 V _ 1 2 G N D _26 G N D _27 I2 C 2 _ S C L I2 C 2 _ S D A G P IO 2 5 U L P I_ S T O P U L P I_ C L K ET H _C O L_2 G P IO 2 6 ET H _R XER _2 ET H _MD C _2 ET H _T XC L K_ 2 E T H _ M D IO _ 2 E T H _ T X E N _2 ET H _R XC LK_2 G P IO 1 8 ET H _R XD V_2 G P IO 1 9 /S D H C _ D 4 G P IO 2 7 /S D H C _ D 6 G P IO 2 0 /S D H C _ D 5 G P IO 2 8 /S D H C _ D 7 ET H_T XD1_2 ET H _R X D 1_2 ET H_T XD0_2 ET H _R X D 0_2 U L P I_ N E X T /U S B _ H S _ D M U L P I_ D A T A 0/I2 S 1 _ M C L K U L P I_ D IR /U S B _ H S _ D P U L P I_ D A T A 1 /I2 S 1 _ D O U T _ S C K U P L I_ D A T A 5/U S B _ H S _ V B U S U L P I_ D A T A 2 /I2 S 1 _ D O U T _W S U L P I_ D A T A 6/U S B _ H S _ ID U L P I_ D A T A 3 /I2 S 1 _ D IN 0 U L P I_ D A T A 7 U L P I_ D A T A 4 /I2 S 1 _ D O U T 0 G N D _20 G N D _28 L C D _ H S Y N C /L C D _ P 2 4 AN 11 L C D _ V S Y N C /L C D _ P 2 5 AN 10 AN 13 AN9 AN 12 AN8 G N D _21 G N D _29 L C D _ C L K /L C D _ P 2 6 G P IO 2 9 /U A R T 2 _ D C D T MR 11 T MR9 T MR 10 T MR8 G P IO 2 1 G P IO 3 0 /U A R T 3 _ D C D 3 .3 V _ 9 3 .3 V _ 1 3 PW M15 PW M11 PW M14 PW M10 PW M13 PW M9 PW M12 PW M8 CAN2_R X U A R T 2 _ R X D /T S I0 CAN2_T X U A R T 2 _ T X D /T S I1 LC D _C O N T R AST U A R T 2 _ R T S /T S I2 L C D _ O E /L C D _ P 2 7 U A R T 2 _ C T S /T S I3 L C D _ D 0 /L C D _ P 0 U A R T 3 _ R X D /T S I4 L C D _ D 1 /L C D _ P 1 U A R T 3 _ T X D /T S I5 L C D _ D 2 /L C D _ P 2 U A R T 3 _ R T S /C A N 3 _ R X L C D _ D 3 /L C D _ P 3 U A R T 3 _ C T S /C A N 3 _ T X G N D _22 G N D _30 G P IO 2 3 L C D _ D 4 /L C D _ P 4 G P IO 2 4 L C D _ D 5 /L C D _ P 5 L C D _ D 1 2 /L C D _ P 1 2 L C D _ D 6 /L C D _ P 6 L C D _ D 1 3 /L C D _ P 1 3 L C D _ D 7 /L C D _ P 7 L C D _ D 1 4 /L C D _ P 1 4 L C D _ D 8 /L C D _ P 8 IR Q _ P /S P I2 _ C S 2 L C D _ D 9 /L C D _ P 9 IR Q _ O /S P I2 _ C S 3 L C D _ D 1 0 /L C D _ P 1 0 IR Q _ N L C D _ D 1 1 /L C D _ P 1 1 IR Q _ M I2 S 1 _ D IN _ S C K IR Q _ L I2 S 1 _ D IN _W S IR Q _ K I2 S 1 _ D IN 1 IR Q _ J I2 S 1 _ D O U T 1 IR Q _ I L C D _ D 1 5 /L C D _ P 1 5 L C D _ D 1 8 /L C D _ P 1 8 /S D _ R X _ 0 + L C D _D 1 6 /LC D _ P 1 6 /S D _ G N D L C D _ D 1 9 /L C D _ P 1 9 /S D _ R X _ 0 L C D _D 1 7 /LC D _ P 1 7 /S D _ G N D G N D _23 G N D _31 E B I_ A D 2 0 /L C D _ P 42 /S D _ G N D E B I_ B E _ 3 2 _ 2 4 /L C D _ P 2 8 /S D _ T X _ 0 + E B I_ A D 2 1 /L C D _ P 43 /S D _ G N D E B I_ B E _ 2 3 _ 1 6 /L C D _ P 2 9 /S D _ T X _ 0 E B I_ A D 2 2 /L C D _ P 44 /S D _ R X _ 1 + E B I_ B E _ 1 5 _ 8 /LC D _ P 3 0 /S D _ G N D E B I_ A D 2 3 /L C D _ P 45 /S D _ R X _ 1 E B I_ B E _ 7 _ 0 /LC D _ P 3 1 /S D _ G N D E B I_ A D 2 4 /L C D _ P 46 /S D _ G N D E B I_ T S IZ E 0 /L C D _ P 3 2 /S D _ T X _ 1 + E B I_ A D 2 5 /L C D _ P 47 /S D _ G N D E B I_ T S IZ E 1 /L C D _ P 3 3 /S D _ T X _ 1 E B I_ A D 2 6 /L C D _ P 48 /S D _ R X _ 2 + E B I_ T S /LC D _ P 3 4 /S D _ G N D E B I_ A D 2 7 /L C D _ P 49 /S D _ R X _ 2 E B I_ T B S T /LC D _ P 3 5 /S D _ G N D E B I_ A D 2 8 /L C D _ P 50 /S D _ G N D E B I_ T A /L C D _ P 3 6 /S D _ T X _ 2 + E B I_ A D 2 9 /L C D _ P 51 /S D _ G N D E B I_ C S 4 /L C D _ P 3 7 /S D _ T X _ 2 E B I_ A D 3 0 /L C D _ P 52 /S D _ R X _ 3 + E B I_ C S 3 /LC D _ P 3 8 /S D _ G N D E B I_ A D 3 1 /L C D _ P 53 /S D _ R X _ 3 E B I_ C S 2 /LC D _ P 3 9 /S D _ G N D L C D _ D 2 0 /L C D _ P 2 0 /S D _ G N D E B I_ C S 1 /L C D _ P 4 0 /S D _ T X _ 3 + L C D _ D 2 1 /L C D _ P 2 1 /S D _ R E F C L K + G P IO 3 1 /L C D _ P 4 1 /S D _ T X _ 3 L C D _ D 2 2 /L C D _ P 2 2 /S D _ R E F C L K L C D _D 2 3 /LC D _ P 2 3 /S D _ G N D G N D _24 G N D _32 3 .3 V _ 1 0 3 .3 V _ 1 4 P C I EX PR ES S T O W ER S Y ST EM P R IM A R Y P5V_ELEV A C1 C2 C3 C4 C5 C6 C7 C8 C9 C 10 C 11 C 12 C 13 C 14 C 15 C 16 C 17 C 18 C 19 C 20 C 21 C 22 C 23 C 24 C 25 C 26 C 27 C 28 C 29 C 30 C 31 C 32 C 33 C 34 C 35 C 36 C 37 C 38 C 39 C 40 C 41 C 42 C 43 C 44 C 45 C 46 C 47 C 48 C 49 C 50 C 51 C 52 C 53 C 54 C 55 C 56 C 57 C 58 C 59 C 60 C 61 C 62 C 63 C 64 C 65 C 66 C 67 C 68 C 69 C 70 C 71 C 72 C 73 C 74 C 75 C 76 C 77 C 78 C 79 C 80 C 81 C 82 C B SECO N D ARY P 3 V 3 _R E G C1 C2 10U F 10U F A IC A P C la s s ific a tio n : D r a w in g T itle : F C P : ___ F IU O : X P U B I : ___ TW R _FL O W _M A G P a g e T itle : P add le w he e l a c c es ory boa rd - m a gne tic s ens or 5 4 3 2 S iz e C D ocum ent N um ber D a te : W ednes day , O c tober 01, 2014 Rev x S C H -28410 P D F : S PF -28410 She et 2 of 2 1 Figure 13. Elevator connector Low-Power Rotation Sensing with Magneto Resistive Sensors and Kinetis L MCUs, Application Note, Rev. 0, 01/2015 Freescale Semiconductor, Inc. 15 How to Reach Us: Information in this document is provided solely to enable system and software Home Page: freescale.com implementers to use Freescale products. There are no express or implied copyright Web Support: freescale.com/support information in this document. licenses granted hereunder to design or fabricate any integrated circuits based on the Freescale reserves the right to make changes without further notice to any products herein. Freescale makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale 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 Freescale 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 customer’s technical experts. Freescale does not convey any license under its patent rights nor the rights of others. Freescale sells products pursuant to standard terms and conditions of sale, which can be found at the following address: freescale.com/SalesTermsandConditions. Freescale, the Freescale logo, and Kinetis are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. All other product or service names are the property of their respective owners. ARM, the ARM Powered logo and Cortex are registered trademarks of ARM Limited (or its subsidiaries) in the EU and/or elsewhere. © 2015 Freescale Semiconductor, Inc. Document Number: AN5047 Rev. 0 01/2015