DigiKey-eMag-Sensors-Vol 19

AND operation with 0x3FFF (or 0b0011111111111111), which effectively retains all 14 lower bits of the position data. Additionally, it is necessary to account for the encoder's resolution—whether it is 12-bit or 14-bit. If the resolution is 12 bits, the encoderPosition value must be shifted 2 bits to the right to adjust for the lower resolution. This ensures that the position data is accurately represented

in the encoderPosition variable, reflecting the actual position of the encoder based on its specified resolution.

The process involves sending the AMT22_NOP command first, followed by a brief wait to meet the minimum timing requirements specified by the AMT22. After this wait, the AMT22_ZERO command is sent while ensuring the chip select (CS) line is released. Once the encoder receives this command, it will perform a reset operation (Listing 6).

Set zero position (single-turn only)

Certain variants of the AMT22 encoder offer a programmable zero position feature. To set this zero position, a specific two-byte command sequence must be sent.

Listing 5: Updating the encoderPosition.

Listing 6: Setting the zero position of a single-turn AMT22 encoder.

we get technical

51

Powered by