Professional Documents
Culture Documents
DN[Document ID]
AS5403 CRC
Signature Calculation
Page 1
Document Feedback
Content Guide
1
1.1
Signature .............................................................................................................................. 3
3.1
3.2
3.2.1
3.2.2
3.2.3
Example ............................................................................................................................... 9
4.1
4.2
4.3
Code Example...................................................................................................................... 9
Useful Links........................................................................................................................ 10
Page 2
Document Feedback
General Description
This application note shows the application of signature cacluation used from DLL. The DLL can be
involved in LabView and also in other programming enviroments (C++, ).
1.1
Signature
The signature is calculated at end of line calibration by the customer and enabled with lock of the
device. The signature is used for a diagnostic check during power up.
For the Implementation without the DLL is important to prepare the EEPROM content befor the
calculation is done.
Insert 0x55AA into the line of EEPROM register address 0x1F8.
Read
EPPROM content
Prepare
EEPROM content for
calculation
Calculate
signature out of
EEPROM content
Signature Calculation
Write
the calculated signature
in the EEPROM
Lock
the device (custlock)
Hardware Reset
Page 3
Document Feedback
Insert 0x55AA into the line where the data of the register with address 0x1F8 is
...
...
...
...
->
...
0x1F8
...
...
0x1FF
...
0000 0000 0000 0000
...
...
xxxx xxxx xxxx xxxx
0x55AA
...
0x1F8
...
...
0x1FF
...
0101 0101 1010 1010
...
...
xxxx xxxx xxxx xxxx
Page 4
Document Feedback
3.1
Signature calculation
The signature calculation is done at end of line calibration. After custlock the device is locked and
parameters cannot be changed anymore.
The advantage of the signature calulcation with DLL is that the content of the EEPROM data is
automatically prepared. The DLL insert 0x55AA into the line of register 0x1F8 before the calculation
is done.
Calculate signature
out of EEPROM
content
Signature Calc
(DLL)
Read
EPPROM content
INPUT Parameters:
Input array array (uint16) = EEPROM
Data
Lenght of input array (int32) = 512dec
OUTPUT Parameters:
Signature (uint8)
Hardware Reset
Page 5
Document Feedback
3.2
The main advantage is that no EEPROM readout is necessary during end of line calibration.
Therefore the customer must have knowledge of the customers parameters in the EEPROM.
content of EEPROM
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
...
address:
0x...
...
...
ams
values
ams
values
...
...
...
...
...
...
...
...
...
...
customer
values
...
...
...
...
...
...
...
xxxx xxxx xxxx xxxx
customer
values
...
...
...
...
...
0000 0000 0000 0000
Asumed
zero
Signature
calulation
ams signature:
XXXX XXXX
content of EEPROM
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
...
...
...
...
...
...
...
...
...
...
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
...
xxxx xxxx xxxx xxxx
ams
values
customer
Values
(constant)
+ custlock
0x1F8
customer
Values
(default)
...
...
...
...
...
...
Modify
values
address:
0x...
...
...
customer
Values
(constant)
customer
Values
(modified)
Signature
calulation
customer
Values
(modified)
customer signature:
XXXX XXXX
Page 6
Document Feedback
customer values
ams values
ADDRESS (HEX)
0x000 to 0x00A
0x00C to 0x00D
0x010 to 0x018
0x020 to 0x05E
reserved
0x080 to 0x1BF
0x1D8 to 0x1EF
0x00B
Sequencer Control
0x00E
reserved
0x00F
0x019
Offset Bj
0x01A
Gain Bj
0x01B
Reserved
0x01C
Reserved
0x01D
Reserved
0x01E
Gain Bi
0x01F
Offset Bi
0x05F to 0x07F
Linearization Table
0x1C0 to 1CE
reserved
0x1CF
Pre-Scale Linearization
0x1D0
Post-processing Offset
0x1D1
Post-processing Gain
0x1D2
Clamp Low 1
0x1D3
Clamp High 1
0x1D4
Reserved
0x1D5
Reserved
0x1D6
Reserved
0x1D7
Reserved
0x1F0
Reserved
0x1F1
Reserved
0x1F2
Reserved
0x1F3
Reserved
0x1F4
Reserved
0x1F5
0x1F6
0x1F7
Angle Offset
0x1F8
0x1F9
0x1FA
0x1FB
DSW settings
0x1FC
Customer ID
0x1FD
Customer ID
0x1FE
Customer ID
0x1FF
Page 7
Document Feedback
Modify
values
Modify
values
On customer side the EEPROM must not be read from every device. Once the EEPROM content is
known. The customer just need the ams signature, calculate the customer signature and XOR the
singatures to the final signature.
ams signature:
XXXX XXXX
final signature:
customer signature:
XXXX XXXX
XXXX XXXX
LOCK
Hardware RESET
[Turn off power supply]
[Turn on power supply]
[Wait for power up (~10ms)]
Page 8
Document Feedback
4.1
Example
DLL LabView
4.2
DLL Cplusplus
4.3
Code Example
Page 9
Document Feedback
Useful Links
Wikipedia:
https://en.wikipedia.org/wiki/Cyclic_redundancy_check
Page 10
Document Feedback
Contact Information
Headquarters
ams AG
Tobelbaderstrasse 30
8141 Unterpremstaetten
Austria, Europe
Tel: +43 (0) 3136 500 0
Website: www.ams.com
Page 11
Document Feedback
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.
Page 12
Document Feedback
Revision Information
Changes from previous version to current revision 1-03 (2015-Oct-15)
Page
Page 13
Document Feedback