Application Note [Document ID] AS505xA Error Monitoring ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 1 Document Feedback AS505xA – Error Monitoring Content Guide 1 General Description ............................................................................................................. 2 2 Detection .............................................................................................................................. 3 3 Analysis ................................................................................................................................ 5 3.1 Error flags ............................................................................................................................. 5 3.1.1 Alarm bits ............................................................................................................................. 5 3.1.2 Communication error flag ..................................................................................................... 6 3.2 Error Status Register............................................................................................................ 7 3.2.1 Description of the error flags ................................................................................................ 7 4 Troubleshooting ................................................................................................................... 9 4.1 Error Avoidance ................................................................................................................... 9 4.2 Clear Error Flag .................................................................................................................. 10 5 Contact Information ............................................................................................................ 11 6 Copyrights & Disclaimer ..................................................................................................... 12 Revision History Revision Date Owner Description 1.0 26.11.2012 ekno Initial Version 1.1 24.01.2013 ekno added more information of WOW and MODE 1.2 05.03.2013 ekno Correction of WOW description 1.3 21.11.2013 mzie Apply corporate template, correction of Error Status Register, general overhaul 1.4 21.10.2014 mzie Update to new corporate template, adaption to datasheet ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 2 Document Feedback AS505xA – Error Monitoring 1 General Description The AS5050A and AS5055A offer error monitoring qualities. When an error occurs (e.g.: wrong clock cycle) the IC detects the failure and gives back an error flag on the SPI interface. This Application note describes the error flag and how to read out the ICs error status. Furthermore the different meanings of error flags which can occur are described and also how to avoid errors in future. The aim of this application Note is to increase quality of a system during evaluation phase. 2 Detection Transmission1 Transmission2 SS SCK MOSI 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x x x x x x x x x x x x x x x x MISO x x x x x x x x x x x x x x x x 0 0 0 0 1 1 0 0 1 1 1 1 0 0 0 0 Figure 1: Normal transmission In the first transmission an ANGULAR DATA command package is sent (MOSI). The IC answers at transmission 2 with an ANGULAR DATA read package (MISO). The content from a normal ANGULAR DATA command package on MOSI signal is shown in Table 1: ANGULAR DATA command package. ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 3 Document Feedback AS505xA – Error Monitoring Bit 15 14 Description R/W Content 1 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Address <14:1> 1 1 1 1 1 1 1 1 PAR 1 1 1 1 1 1 Bit Name Description 15 R/W 0=Write, 1=Read 14:1 Address 14 bit address to read or write 0 PAR Parity bit (even) calculated on the upper 15 bits 1 Table 1: ANGULAR DATA command package The content of normal ANGULAR DATA read package on MISO signal is shown in Table 2: ANGULAR DATA read package. In this case no error occurred. Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 Description Alarm Lo Alarm Hi Content 0 0 Bit Name Description 15 Alarm Lo Alarm flag, which indicates a too low magnetic field (details see chapter “Analysis”) 14 Alarm Hi Alarm flag, which indicates a too high magnetic field (details see chapter “Analysis”) 13:2 Angle Value Angular value in binary code 1 EF Error flag, which indicates that an error occurred (details see chapter “Analysis”) 0 PAR Parity bit (even = ‘0’ and odd = ‘1’) Angle Value <13:2> X X X X X X X X X X X X 1 0 EF PAR 0 X Table 2: ANGULAR DATA read package ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 4 Document Feedback AS505xA – Error Monitoring 3 Analysis 3.1 Error flags 3.1.1 Alarm bits In case one of the Alarm bits is high, a system error occurred. Both alarm bits set to high indicate a major system error. SS SCK MOSI x x x x x x x x x x x x x x x x MISO 1 1 0 0 1 1 0 0 1 1 1 1 0 0 0 0 Figure 2: both Alarm bits = high Alarm Hi Alarm Lo Description AGC value 0 0 AGC level is higher than the minimum value and lower than the maximum value. >0 and <63 0 1 AGC level is equal or even higher than the maximum level. Magnetic field too weak. >63 1 0 AGC level is equal or even lower than the minimum level. Magnetic field too strong. <0 1 1 Indicates of a major system error has occurred or if the WOW flag is active. (Error flags can be read out with the error status register) Table 3: Alarm bits ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 5 Document Feedback AS505xA – Error Monitoring 3.1.2 Communication error flag The Communication Error Flag (EF) occurs when the SPI communication is incorrect. The error flag remains until the microcontroller sends a CLEAR ERROR FLAG command. SS SCK MOSI x x x x x x x x x x x x x x x x MISO 0 0 0 0 1 1 0 0 1 1 1 1 0 0 1 1 Figure 3: EF = high ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 6 Document Feedback AS505xA – Error Monitoring 3.2 Error Status Register For all detailed information about the error flags and system monitoring read out the error status register (0x335A). Table 4: Error Status Register (0x335A) shows the Error Status Register. Bit Description Type 13 Reserved 12 FIELD_ALARM_LO 11 FIELD_ALARM_HI Error Status DSP 10 RANGE 9 CORDICOV 8 ADCOV 7 Reserved 6 Reserved Error Status System 5 Reserved 4 WOW 3 Reserved 2 ADDMON Error Status SPI 1 CLKMON 0 PARITY Table 4: Error Status Register (0x335A) 3.2.1 Description of the error flags FIELD_ALARM_LO: AGC level is equal or even higher than the maximum level. Magnetic field is too weak. FIELD_ALARM_HI: AGC level is equal or even lower than the minimum level. Magnetic field is too strong. ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 7 Document Feedback AS505xA – Error Monitoring RANGE: The Hall element is driven by a current source. In case of higher temperature, the voltage drop over the source decreases. The hall element does not fail, but the accuracy is getting worse. To ensure high system integrity the voltage drop over the current source is monitored. CORDICOV: The CORDIC calculates the angle. The error occurs when the input signals of CORDIC are too large. The internal algorithm fails. ADCOV: In case of magnet displacement the IC is not able to capture the whole information of the magnetic field. Some information gets cut off, because the values are too high. WOW: This is a handshake mechanism to check system integrity. By sending a READ ANGLE command the internal flag (WOW) is set to high. At the end of measurement the WOW is set to low again. In failure case (internal dead lock situation) the WOW flag remains high. ADDMON: In case the microcontroller sends a wrong/not existing address, the sensor reacts with setting this flag to high. CLKMON: The IC is counting the clock cycles. In case the microcontroller sends too much or less clock samples than standard, the sensor reacts with setting this flag to high. PARITY: In case the transmitted parity bit does not match to internally calculated parity bit, the sensor reacts with setting this flag to high. Note: While the IC is busy, the WOW flag is set to high. Therefore the alarm bits are also 1! This indicates that the IC is still busy. After the IC was busy, the Alarm bits will automatically set to 0. No “Clear Error Flag” Command is needed. ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 8 Document Feedback AS505xA – Error Monitoring 4 Troubleshooting 4.1 Error Avoidance FIELD_ALARM_LO: This means that magnetic field is too weak. Decreasing the air gap or choosing a magnet with higher magnetic field strength can solve this problem. FIELD_ALARM_HI: This means that magnetic field is too high. Increasing the air gap or choosing a magnet with lower magnetic field strength can solve this problem. RANGE: The main reason of this error is higher temperature. Decreasing the temperature can be a solution, but often not possible. Therefore another solution is increasing the magnetic field. This will lower the voltage drop over the current source of the hall element. CORDICOV: This error has several reasons: disturbing external field; magnetic field is too high or large displacement. When there is an external field disturbing the IC, it can help to start the measurement again. Otherwise the external field must be eliminated. A high magnetic field can occur with a “powerful” magnet or less air gap. In both cases the IC sees a high magnetic field. By changing the air gap or choosing a magnet with another magnetization the error can be avoided. Large displacement has nearly the same effect like a high intensive magnetic field. Centering the magnet and the IC in the rotation axis can also avoid this error. ADCOV: This error flag means that there is a displacement between IC and magnet. The best performance of IC is reached with a centered magnet. WOW: When the WOW stays high after 500µs the system integrity is not more given. (Internal dead lock situation). ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 9 Document Feedback AS505xA – Error Monitoring 4.2 Clear Error Flag If the Communication Error Flag (EF) is set to high because of a communication problem, the flag remains set until it will be cleared by a CLEAR ERROR FLAG command. (0x3380) Bit 15 Description R/W Content 1 14 13 12 11 10 9 8 7 6 5 4 3 2 1 Address <14:1> 1 1 0 0 1 1 1 0 PAR 0 0 0 0 0 0 Table 5: CLEAR ERROR FLAG command (0x3380) SS SCK MOSI 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 MISO x x x x x x x x x x x x x x x x Figure 4: CLEAR ERROR FLAG command (0x3380) ams Application Note, Confidential [v1-4] 2014-Oct-21 0 Page 10 Document Feedback 0 AS505xA – Error Monitoring 5 Contact Information Buy our products or get free samples online at: www.ams.com/ICdirect Technical Support is available at: www.ams.com/Technical-Support Provide feedback about this document at: www.ams.com/Document-Feedback For further information and requests, e-mail us at: [email protected] For sales offices, distributors and representatives, please visit: www.ams.com/contact Headquarters ams AG Tobelbaderstrasse 30 8141 Unterpremstaetten Austria, Europe Tel: +43 (0) 3136 500 0 Website: www.ams.com ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 11 Document Feedback AS505xA – Error Monitoring 6 Copyrights & Disclaimer Copyright ams AG, Tobelbader Strasse 30, 8141 Unterpremstaetten, Austria-Europe. Trademarks Registered. All rights reserved. The material herein may not be reproduced, adapted, merged, translated, stored, or used without the prior written consent of the copyright owner. Information in this document is believed to be accurate and reliable. However, ams AG does not give any representations or warranties, expressed or implied, as to the accuracy or completeness of such information and shall have no liability for the consequences of use of such information. Applications that are described herein are for illustrative purposes only. ams AG makes no representation or warranty that such applications will be appropriate for the specified use without further testing or modification. ams AG takes no responsibility for the design, operation and testing of the applications and end-products as well as assistance with the applications or end-product designs when using ams AG products. ams AG is not liable for the suitability and fit of ams AG products in applications and end-products planned. ams AG shall not be liable to recipient or any third party for any damages, including but not limited to personal injury, property damage, loss of profits, loss of use, interruption of business or indirect, special, incidental or consequential damages, of any kind, in connection with or arising out of the furnishing, performance or use of the technical data or applications described herein. No obligation or liability to recipient or any third party shall arise or flow out of ams AG rendering of technical or other services. ams AG reserves the right to change information in this document at any time and without notice. ams Application Note, Confidential [v1-4] 2014-Oct-21 Page 12 Document Feedback