Page 1
IMU381 Series User’s Manual IMU381 SERIES USER MANUAL Document Part Number: 7430-3881-02 ACEINNA, Inc. email: info@aceinna.com, website: www.aceinna.com Doc# 7430-3881-02 Page i...
Page 2
IMU381 Series User’s Manual Page ii Doc# 7430-3881-02...
IMU381 Series User’s Manual Revision History Date Document Firmware Description Author(s) Revision Applicability Mar 12, Rev. 1.0 v19.1.x Baseline release of IMU381 Feng Liu 2018 manual Feb 15, Rev. 2.0 John Newton • Update SPI functionality 2019 Joe Motyka • This document only describes usage of the IMU381.
IMU381 Series User’s Manual Table of Contents Introduction ..........................1 Manual Overview ......................1 Overview of the IMU381 Series Inertial Measurement Unit ..........2 Interface ............................ 3 Electrical Interface ......................3 2.1.1 Connector and Mating Connector ................3 2.1.2 Power Input and Power Input Ground ................ 4 2.1.3...
Page 5
IMU381 Series User’s Manual Suggested Operation ......................28 4.8.1 Startup Timing ......................28 4.8.2 SPI Timing ....................... 29 Signal Synchronization ....................30 Bootloader ........................31 IMU381 UART Port Interface Definition ................32 General Settings ......................32 Number Formats ......................32 Packet Format ........................
Page 6
IMU381 Series User’s Manual Digital Filter Settings ...................... 44 Orientation Field ......................44 User Behavior Switches ....................46 Commands to Program Configuration ................46 7.6.1 Write Fields Command .................... 46 7.6.2 Set Fields Command ....................47 Read Fields Command ....................48 Read Fields Response ......................
Page 7
IMU381 Series User’s Manual 9.1.2 Write APP Command ....................60 9.1.3 Jump to Application command ................61 Updating firmware using the SPI Interface ..............61 9.2.1 Boot Mode Registers ....................61 9.2.2 Boot Mode Status Register (0x78) ................62 9.2.3 Boot Command Register (0x7A)................
IMU381 Series User’s Manual About this Manual The following symbols are used to provide additional information. NOTE Note provides additional information about the topic. EXAMPLE This symbol indicates an example that will help the reader understand the terminology.
Introduction Manual Overview This manual describes ACEINNA’s IMU381 IMU Inertial Measurement Unit. The IMU381 will be referred to as “the unit” frequently in this document. For users wishing to get started quickly, please refer to the two-page quick start guide included with each evaluation kit shipment.
It is designed for OEM applications. At the core of the IMU381 Series is a rugged 6-DOF (Degrees of Freedom) MEMS inertial sensor cluster. The 6-DOF MEMS inertial sensor cluster includes three axes of MEMS angular rate sensing and three axes of MEMS linear acceleration sensing.
IMU381ZA Series User’s Manual ________________________________________________________________________ Interface Electrical Interface 2.1.1 Connector and Mating Connector The unit main connector is a SAMTEC FTM-110-02-F-DV-P defined in Figure 1. The SAMTEC CLM-110-02 mating connector is compatible with the IMU381unit main connector. Figure 1 IMU381 Interface Connector Table 2 Interface Connector Pin Definition IMU381 vs.
IMU381 Series User’s Manual ________________________________________________________________________ Data Ready (SPI Communication Data Ready) / Data Ready (SPI Communication Data Ready) / SPI-UART Port Select SPI-UART Port Select External Reset (NRST) External Reset (NRST) Reserved – factory use only Reserved – factory use only...
IMU381ZA Series User’s Manual ________________________________________________________________________ are controlled independently from each other. The UART port output controls apply only to data being output over the UART port, and the SPI output controls apply only to data being output over the SPI port. 2.1.3.1 SPI Com Synchronization Input Pin 2 can be used as a sync pulse to force synchronization of sensor data collection to a 1 kHz...
This section of the manual covers detailed theory of operation for the IMU381 Figure 3 shows the IMU381 Series hardware block diagram. At the core of the IMU381 Series is a rugged 6-DOF (Degrees of Freedom) MEMS inertial sensor cluster. The 6-DOF MEMS inertial sensor cluster includes three axes of MEMS angular rate sensing and three axes of MEMS linear acceleration sensing.
Page 15
Measurement data packets are available at fixed continuous output rates or on a polled basis. As shown in the software block diagram, the IMU381 Series has a unit setting and profile block which configures the algorithm to user and application specific needs. This feature is one of the...
The axes form an orthogonal SAE right-handed coordinate system. Acceleration is positive when it is oriented towards the positive side of the coordinate axis. For example, with a IMU381 Series product sitting on a level table, it will measure zero g along the x- and y-axes and -1 g along the z-axis.
________________________________________________________________________ 3.1.1 Advanced Settings The IMU381 Series Inertial Navigation Units have a number of advanced settings that can be changed. All units support baud rate , power-up output packet type, output rate, sensor low pass filtering, and custom axes configuration. The units can be configured using NAV-VIEW, as described in Appendix A, and also directly with serial commands as described in Sections 5-8.
Generally, there is no reason to change the low-pass filter settings on the unit or other IMU381 Series Inertial Systems. However, when a IMU381 Series product is installed in an environment with a lot of vibration, it can be helpful to reduce the vibration-based signal energy and noise prior to further processing on the signal.
The over-range only applies to the rotational rate sensors. Because instantaneous acceleration levels due to vibration can exceed the accelerometer sensor range in many applications, none of the IMU381 Series products trigger over-range on accelerometer readings.
IMU381ZA Series User’s Manual ________________________________________________________________________ Name Read/Write Address Default Function PRODUCT_ID 0x56 0x3810 Product identification code Serial number (serial number is a two byte number read SERIAL_NUMBER 0x58/0x59 Varies from 0x58 and 0x59 and written to 0x58 and 0x59) MASTER_STATUS 0x5A See Section 8.2: Master BIT and Status Field HW_STATUS...
IMU381 Series User’s Manual ________________________________________________________________________ In polled-mode, the IMU381 transfers information from any register back to the master in two (or more) SPI cycles . In Burst-Mode, the IMU381 transfers predefined blocks of data in one contiguous group of nine to twenty SPI cycles.
IMU381ZA Series User’s Manual ________________________________________________________________________ Multiple-Register Polled-Read Figure 7 illustrates a polled-mode read of multiple registers. In this case, the SPI-master transmits an initial read-command (the desired register-address appended by 0x00) across MOSI followed by any number of additional read-commands (one for each register of interest). The unit transfers the requested information concurrently across MISO to the master.
Page 24
IMU381 Series User’s Manual ________________________________________________________________________ Table 4 IMU381 Burst-Mode Data-Packets Data-Packet Register Number of Pertinent Description Address 16-bit Words Section Standard 0x3E 4.2.2 Rates, Accelerations, and Temperature Extended 0x3F 4.2.2 Standard plus Timestamps Burst-Read of Standard Data-Packet The standard data-packet comprises data from eight predefined registers. Table 5 lists the data contained in a standard packet along with the corresponding registers.
Page 25
IMU381ZA Series User’s Manual ________________________________________________________________________ Burst-Read of Extended Data-Packet The extended data-packet comprises data from multiple predefined registers. Table 6 lists the data contained in an extended data packet. The registers are listed in the order in which they are sent during extended burst-mode read.
IMU381 Series User’s Manual ________________________________________________________________________ 0x3F00 0x0000 0x0000 0x0000 MOSI TIME STATUS X_RATE MISO STAMP2 Figure 9 Extended Burst Mode Timing Operational notes: Care must be taken when switching between data-packets as values returned during the first burst-read of a new packet are invalid. A single burst read-cycle...
IMU381 Series User’s Manual ________________________________________________________________________ Table 9 Diagnostic Status Register (Base Address: 0x3C), Read-Only Bits Description (Default: 0x0000) Accelerometer Z-Axis self-test bit 0: Pass, 1: Fail Accelerometer Y-Axis self-test bit 0: Pass, 1: Fail Accelerometer X-Axis self-test bit 0: Pass, 1: Fail...
Page 29
IMU381ZA Series User’s Manual ________________________________________________________________________ The following example highlights how write-commands are formed in order to initiate a sensor self-test: Select the write address of the desired register, e.g. 0x35 for self-test • Change the most-significant bit of the address to 1 (the write-bit), e.g. 0x35 becomes •...
IMU381 Series User’s Manual ________________________________________________________________________ Configuration Registers 4.7.1 Self-Test/Data-Ready Self-test and data-ready registers are combined into a single 16-bit register at memory location 0x34; individual bits are assigned according to Table 11. Table 11 Self-Test/Data-Ready Register (Base Address: 0x34), Read/Write...
Page 32
IMU381 Series User’s Manual ________________________________________________________________________ The rate-sensor scaling selector adjusts the output scaling applied to the rate-sensor values registers 0x04 through 0x08 as well as the values in the standard data-packet (scaling in the other data-packets are not affected). Additionally, this setting affects the limits that control the sensor over-range bit in the diagnostic status register (Table 9);...
IMU381ZA Series User’s Manual ________________________________________________________________________ 4.7.4 Accelerometer, and Alternate Rate-Sensor Scaling The scaling and limits of the accelerometer output can be configured in a manner similar to the method described in Section 4.7.3. Additionally, the rate-sensor output can be configured via an alternate register.
IMU381ZA Series User’s Manual ________________________________________________________________________ 4.7.5 Axis Orientation Settings The unit gives users the ability to set the axes orientation by selecting which axis aligns with the base axes as well as the sign. The only constraint is the axes must conform to a right-hand definition.
IMU381 Series User’s Manual ________________________________________________________________________ Table 19 Hardware and Software Version (Base Address: 0x7E), Read Only Bits Description (Default: 0x0000) [ 15:8 ] Hardware Version [ 7:0 ] Software Version (Major and Minor versions concatenated) Suggested Operation The following operational procedure and timing specifications should be adhered to while communicating with the IMU381unit via SPI to ensure proper system operation.
IMU381ZA Series User’s Manual ________________________________________________________________________ 4.8.2 SPI Timing The timing requirements for the SPI are listed in Table 20 and illustrated in Figure 16 and Figure 17. In addition, the following operational constraints apply to the SPI communications: • The unit operates with CPOL = 1 (polarity) and CPHA = 1 (phase) Data is transmitted 16-bits words, Most Significant Bit (MSB) first •...
IMU381 Series User’s Manual ________________________________________________________________________ SU,NSS h,NSS V,MISO MISO bit 14 bit 13 bit 1 SU,MOSI h,MOSI MOSI bit 14 bit 13 bit 1 Figure 15 SPI Timing Diagram Signal Synchronization The IMU381 is capable of synchronizing its output with a 1 kHz external clock signal, in the form of a square wave, applied to Pin 2.
IMU381ZA Series User’s Manual ________________________________________________________________________ Method 1- Using the Sensor Sampling Indicator (Pin 1) When the user requires finer knowledge of the instant that data is sampled, the IMU381 provides the ability to determine when the sensor read is performed. A falling edge of the signal provided on pin 1 indicates when the inertial sensors are sampled.
However, all models support a common packet structure that includes both command or input data packets (data sent to the IMU381 Series) and measurement output or response packet formats (data sent from the IMU381 Series). This section of the manual explains these packet formats as well as the supported commands.
(U1)> payload> The Ping Command does not require a CRC, so a IMU381 Series unit can be pinged from a terminal emulator. To Ping a IMU381 Series unit, type the ASCII sequence ‘UUPK’. If properly connected, the IMU381 Series unit will respond with ‘PK’. All other communications with the IMU381 Series unit require the 2-byte CRC.
Input messages are sent from the user system to the IMU381 Series inertial system and will result in an associated Reply Message or NAK message. Note that reply messages typically have the same <2-byte packet type (U2)>...
Page 43
IMU381ZA Series User’s Manual ________________________________________________________________________ Table 22 Message Table ASCII Mnemonic <2-byte <payload Description Type Products packet byte-length Available type (U2)> (U1)> Link Test 0x504B Ping Command Input/Reply and Response Message 0x4348 Echo Command Input/Reply and Response Message Interactive Commands 0x4750 Get Packet Input...
Page 44
IMU381 Series User’s Manual ________________________________________________________________________ ASCII Mnemonic <2-byte <payload Description Type Products packet byte-length Available type (U2)> (U1)> 0x4746 numFields*4+ Get Fields Reply Response Message Doc# 7430-3881-02 Page 36...
Second to last byte of echo data echoData… Last byte of echo data Interactive Commands Interactive commands are used to interactively request data from the IMU381 Series, and to calibrate or reset the IMU381 Series. Doc# 7430-3881-02 Page 37...
IMU381 Series User’s Manual ________________________________________________________________________ 6.2.1 Get Packet Request Get Packet (‘GP’ = 0x4750) Preamble Packet Type Length Payload Termination 0x5555 0x4750 0x02 <GP payload> <CRC (U2)> This command allows the user to poll for both measurement packets and special purpose output packets including ‘T0’, ‘VR’, and ‘ID’.
IMU381ZA Series User’s Manual ________________________________________________________________________ serialNumber Unit serial number modelString Unit Version String 0x00 Zero Delimiter 6.3.2 Version Data Packet Version Data (‘VR’ = 0x5652) Preamble Packet Type Length Payload Termination 0x5555 0x5652 <VR payload> <CRC (U2)> This packet contains firmware version information. majorVersion changes may introduce serious incompatibilities.
IMU381 Series User’s Manual ________________________________________________________________________ Communication Serial B BIT comSerialBBIT Field softwareBIT Software BIT Field softwareAlgorithmBIT Software Algorithm BIT Field softwareDataBIT Software Data BIT Field hardwareStatus Hardware Status Field comStatus Communication Status Field softwareStatus Software Status Field sensorStatus Sensor Status Field...
IMU381ZA Series User’s Manual ________________________________________________________________________ Reserved Reserved Reserved xRateTemp 200/2^16 deg. C X rate temperature yRateTemp 200/2^16 deg. C Y rate temperature zRateTemp 200/2^16 deg. C Z rate temperature boardTemp 200/2^16 deg. C CPU board temperature timer 15.259022 Free running fast counter 1s= 65535, captured at sampling BITstatus Master BIT and Status...
Page 50
IMU381 Series User’s Manual ________________________________________________________________________ yRateTemp 200/2^16 deg. C Y rate temperature zRateTemp 200/2^16 deg. C Z rate temperature boardTemp 200/2^16 deg. C CPU board temperature timer 15.259022 Free running fast counter 1s= 65535, captured at sampling BITstatus Master BIT and Status...
________________________________________________________________________ 7 IMU381 Advanced UART Port Commands The advanced commands allow users to programmatically change the IMU381 Series settings. This section of the manual documents all of the settings and options contained under the Unit Configuration tab within NAV-VIEW. Using these advanced commands, a user’s system can change or modify the settings without the need for NAV-VIEW.
IMU381 Series User’s Manual ________________________________________________________________________ Note: BAUD rate SF has immediate effect. Some output data may be lost. Response will be received at new BAUD rate. Continuous Packet Type Field This is the packet type that is being continually output. The supported packet depends on the model number.
Page 53
IMU381ZA Series User’s Manual ________________________________________________________________________ Z Axis 0 = Uz, 1 = Ux, 2 = Uy, 3 = N/A Reserved 9:15 There are 24 possible orientation configurations (See Table 26). Setting/Writing the field to anything else generates a NAK and has no effect. Table 26 IMU381 Orientation Fields Orientation Field Value X Axis...
IMU381 Series User’s Manual ________________________________________________________________________ (Ux) (Uy) Roll Pitch (Uz) Figure 17 IMU381ZA (-209, -409) VG/AHRS/INS381ZA (-200, -400) Default Orientation Field ( 0x0000) User Behavior Switches This field allows on the fly user interaction with behavioral aspects of the algorithm (See Table 27).
IMU381ZA Series User’s Manual ________________________________________________________________________ with a write fields response containing the field IDs of the successfully written fields. If any field is unable to be written, the unit will respond with an error response. Note that both a write fields and an error response may be received as a result of a write fields command.
IMU381 Series User’s Manual ________________________________________________________________________ response containing the field IDs of the successfully set fields. If any field is unable to be set, the unit will respond with an error response. Note that both a set fields and an error response may be received as a result of one set fields command.
IMU381ZA Series User’s Manual ________________________________________________________________________ IDs and data from the successfully read fields. If any field is unable to be read, the unit will respond with an error response. Note that both a read fields and an error response may be received as a result of a read fields command.
IMU381 Series User’s Manual ________________________________________________________________________ Note that both a get fields and an error response may be received as the result of a get fields command. GF Payload Contents Byte Offset Name Format Scaling Units Description numFields The number of fields to get...
IMU381ZA Series User’s Manual ________________________________________________________________________ 8 IMU381 Advanced UART Port BIT Built In Test (BIT) and Status Fields Internal health and status are monitored and communicated in both hardware and software. The ultimate indication of a fatal problem is a hardware BIT signal on the user connector which is mirrored in the software BIT field as the masterFail flag.
♦ overRange (enabled by default) Master BIT and Status (BITstatus) Field The BITstatus field is the global indication of health and status of the IMU381 Series product (See Table 28). The LSB contains BIT information and the MSB contains status information.
IMU381 Series User’s Manual ________________________________________________________________________ hardwareBIT Field The hardwareBIT field contains flags that indicate various types of internal hardware errors (See Table 29). Each of these types has an associated message with low level error signals. The hardwareError flag in the BITstatus field is the bit-wise OR of this hardwareBIT field.
IMU381ZA Series User’s Manual ________________________________________________________________________ comBIT Field The comBIT field contains flags that indicate communication errors with external devices (See Table 32). Each external device has an associated message with low level error signals. The comError flag in the BITstatus field is the bit-wise OR of this comBIT field. Table 32 IMU381 COM BIT Field comBIT Field Bits...
IMU381 Series User’s Manual ________________________________________________________________________ softwareBIT Field The softwareBIT field contains flags that indicate various types of software errors (See Table 35). Each type has an associated message with low level error signals. The softwareError flag in the BITstatus field is the bit-wise OR of this softwareBIT field.
IMU381ZA Series User’s Manual ________________________________________________________________________ hardwareStatusEnable field. The hardwareStatusEnable field is a bit mask that allows the user to select items of interest that will logically flow up to the masterStatus flag. Table 38 IMU381 Hardware Status BIT Field hardwareStatus Field Bits Meaning unlocked1PPS...
IMU381 Series User’s Manual ________________________________________________________________________ bit-wise OR of the logical AND of the sensorStatus field and the sensorStatusEnable field. The sensorStatusEnable field is a bit mask that allows the user to select items of interest that will logically flow up to the masterStatus flag.
IMU381ZA Series User’s Manual ________________________________________________________________________ 8.16.4 sensorStatusEnable Field This field is a bit mask of the sensorStatus field (see BIT and status definitions). This field allows the user to determine which low level sensorStatus field signals will flag the sensorStatus and masterStatus flags in the BITstatus field.
IMU381 Series User’s Manual ________________________________________________________________________ 9 IMU381 BOOTLOADER A bootloader function is available to upgrade the IMU381 firmware. The firmware can be updated over either the UART or SPI interface, as described in the following sections. Updating firmware over UART Interface A user can initiate the bootloader at any time by sending ‘JI’...
IMU381ZA Series User’s Manual ________________________________________________________________________ WA Payload Contents Byte Offset Name Format Scaling Units Description startingAddress U4 bytes The FLASH word offset to begin writing data byteLength bytes The word length of the data to write dataByte0 FLASH data dataByte1 FLASH data …...
IMU381 Series User’s Manual ________________________________________________________________________ 9.2.2 Boot Mode Status Register (0x78) The Boot Status register contains information about current unit status in Boot Mode. Table 4. Boot Mode Status Register Bits Description System Busy 0: Ready, 1: Busy System Mode 0: Normal Mode, 1: Boot Mode...
IMU381ZA Series User’s Manual ________________________________________________________________________ NOTE: Data Ready signal will be HIGH when device is BUSY and LOW when device available for new transaction over SPI interface. 9.2.3 Boot Command Register (0x7A) The Boot Command register dedicated to receive Boot Mode related commands. The commands provided in table below.
IMU381 Series User’s Manual ________________________________________________________________________ NOTE: Data Ready signal will be HIGH when device is BUSY and LOW when device available for new transaction over SPI interface. NOTE: Each command message includes 16-bit CRC which covers first 16 bit command word and 32-bit data word.
Page 73
IMU381ZA Series User’s Manual ________________________________________________________________________ register has pattern 0x46AB that means unit already in boot mode. So skip steps 4,5,6. 4. Send “Enter Boot Mode” command to unit. 5. Wait about 1 second. 6. Read BOOT_STATUS status register to ensure, that device entered Boot Mode (register should have pattern 0x46AB) 7.
10.3.2 Identification and Protection If the equipment is to be shipped to ACEINNA for service or repair, please attach a tag TO THE EQUIPMENT, as well as the shipping container(s), identifying the owner. Also indicate the service or repair required, the problems encountered and other information considered valuable to the service facility such as the list of information provided to request the RMA number.
In all correspondence, please refer to the equipment by the model number, the serial number, and the RMA number. Warranty The ACEINNA product warranty is one year from date of shipment. Doc# 7430-3881-02 Page 67...
Setting up NAV-VIEW With the IMU381 Series product powered up and connected to your PC serial port, open the NAV-VIEW software application. Doc# 7430-3881-02 Page 68...
4. Under the “View” menu you have several choices of data presentation. Graph display is the default setting and will provide a real time graph of all the IMU381 Series data. The remaining choices will be discussed in the following pages.
IMU381 Series User’s Manual ________________________________________________________________________ 5. Users can also select a predetermined “Test Duration” from the menu. Using the arrows, simply select the duration of your data recording. 6. Logging Rate can also be adjusted using the features on the right side of the menu.
Figure 19 Raw Data Console Horizon and Compass View If the IMU381 Series product you have connected is capable of providing heading and angle information. NAV-VIEW can provide a compass and a simulated artificial horizon view. To activate these views, simply select “Horizon View” and/or “Compass View” from the “View”...
IMU381 Series User’s Manual ________________________________________________________________________ Packet Statistics View Packet statistics can be obtained from the “View” menu by selecting the “Packet Statistics” option (See Figure 21). This view simply provides the user with a short list of vital statistics (including Packet Rate, CRC Failures, and overall Elapsed Time) that are calculated over a one second window.
IMU381ZA Series User’s Manual ________________________________________________________________________ Caution must be taken to ensure that the settings selected are compatible with the system that is being configured. In most cases a “FAIL” message will appear if incompatible selections are made by the user, however it is the users responsibility to ensure proper configuration of the unit. ...
IMU381 Series User’s Manual ________________________________________________________________________ Users are strongly encouraged to read and thoroughly understand the consequences of altering the settings in the “Advanced” tab before making changes to the unit configuration. These settings are discussed in detail in Chapter 4 below.
Page 83
IMU381ZA Series User’s Manual ________________________________________________________________________ application. The masterFail and all error flags are not configurable. These flags represent serious errors and should never be ignored. Doc# 7430-3881-02 Page 75...
IMU381 Series User’s Manual ________________________________________________________________________ Figure 2. Figure 24 BIT Configuration Read Unit Configuration NAV-VIEW allows users to view the current settings and calibration data for a given IMU381 Series unit by accessing the “Read Configuration” selection from the “Configuration” drop down menu (See Figure 25).
Page 85
IMU381ZA Series User’s Manual ________________________________________________________________________ Figure 25 Read Configuration Appendix A: Firmware Upgrade Step 1, select Firmware upgrade from configuration menu. Step 2, On pop-up window, select a new version binary file by clicking SELECT button, then click Upgrade button. Doc# 7430-3881-02 Page 77...
Page 87
IMU381ZA Series User’s Manual ________________________________________________________________________ Step 3, wait for the process ongoing until a successful or failure message pops up. Doc# 7430-3881-02 Page 79...
This appendix includes sample code written in ANSI C for parsing packets from data sent by the IMU381 Series Inertial Systems. This code can be used by a user application reading data directly from the IMU381 Series product, or perhaps from a log file. Check at https://github.com/Aceinna for other reference code.
/* buffer size */ #define MAXQUEUE 500 * circular queue typedef struct queue_tag int count; int front; int rear; char entry[MAXQUEUE]; } QUEUE_TYPE; * ACEINNA packet typedef struct xbow_packet unsigned short packet_type; char length; unsigned short crc; char data[256]; } XBOW_PACKET;...
Page 90
IMU381 Series User’s Manual ________________________________________________________________________ return 0; /* empty buffer */ /* find header */ for(numToPop=0; numToPop+1<Size(queue_ptr) ;numToPop+=1) if(0x5555==peekWord(queue_ptr, numToPop)) break; Pop(queue_ptr, numToPop); if(Size(queue_ptr) <= 0) /* header was not found */ return 0; /* make sure we can read through minimum length packet */ if(Size(queue_ptr)<7)
Page 91
IMU381ZA Series User’s Manual ________________________________________________________________________ /* fill out result of parsing in structure */ result->packet_type = peekWord(queue_ptr, 2); result->length = peekByte(queue_ptr, 4); result->crc = packetCRC; for(counter=0; counter < result->length; counter++) result->data[counter] = peekByte(queue_ptr, 5+counter); Pop(queue_ptr, dataLength+7); return 1; /******************************************************************************* * FUNCTION: calcCRC calculates a 2-byte CRC on serial data using CRC-CCITT 16-bit standard maintained by the ITU (International Telecommunications Union).
Page 92
IMU381 Series User’s Manual ________________________________________________________________________ * FUNCTION: Initialize - initialize the queue * ARGUMENTS: queue_ptr is pointer to the queue *******************************************************************************/ void Initialize(QUEUE_TYPE *queue_ptr) queue_ptr->count = 0; queue_ptr->front = 0; queue_ptr->rear = -1; /******************************************************************************* * FUNCTION: AddQueue - add item in front of queue...
Page 93
IMU381ZA Series User’s Manual ________________________________________________________________________ if(queue_ptr->count <= 0) retval = 0; /* queue is empty */ else queue_ptr -> count--; *item = queue_ptr->entry[queue_ptr->front]; queue_ptr->front = (queue_ptr->front+1) % MAXQUEUE; retval=1; return retval; /******************************************************************************* * FUNCTION: peekByte returns 1 byte from buffer without popping * ARGUMENTS: queue_ptr is pointer to the queue to return byte from index is offset into buffer to which byte to return * RETURNS:...
Page 94
IMU381 Series User’s Manual ________________________________________________________________________ firstIndex = (queue_ptr->front + index) % MAXQUEUE; secondIndex = (queue_ptr->front + index + 1) % MAXQUEUE; word = (queue_ptr->entry[firstIndex] << 8) & 0xFF00; word |= (0x00FF & queue_ptr->entry[secondIndex]); return word; /******************************************************************************* * FUNCTION: Pop - discard item(s) from queue...
Page 95
IMU381ZA Series User’s Manual ________________________________________________________________________ *******************************************************************************/ int Empty(QUEUE_TYPE *queue_ptr) return queue_ptr->count <= 0; /******************************************************************************* * FUNCTION: Full * ARGUMENTS: queue_ptr is pointer to the queue * RETURNS: return 1 if full, 0 if not full *******************************************************************************/ int Full(QUEUE_TYPE *queue_ptr) return queue_ptr->count >= MAXQUEUE; Doc# 7430-3881-02 Page 87...
IMU381 Series User’s Manual ________________________________________________________________________ Appendix C: Sample Packet Decoding Figure 26 Example payload from Angle Data Packet 2 (A2) Doc# 7430-3881-02 Page 88...
Page 97
IMU381ZA Series User’s Manual ________________________________________________________________________ Figure 27 Example payload from Scaled Data Packet 1 (S1) Doc# 7430-3881-02 Page 89...
Page 98
IMU381 Series User’s Manual ________________________________________________________________________ FFDF Figure 28 Example payload from Nav Data Packet 1 (N1) Doc# 7430-3881-02 Page 90...
Need help?
Do you have a question about the IMU381 SERIES and is the answer not in the manual?
Questions and answers