0x11 |
Base Register Address |
This module provides incremental encoder support.
Register Address |
Register Name |
Register Size |
Access |
0x00 |
Status |
? |
? |
0x10 |
Interrupt Set |
1 byte |
W |
0x20 |
Interrupt Clear |
1 byte |
W |
0x30 |
Position |
4 bytes |
R/W |
0x40 |
Delta |
4 bytes |
R |
More than one encoder can be supported. The upper 4 bits of the function register address specifies the function (summarized in table above) while the lower 4 bits indicates the encoder number, starting with 0 for the 1st encoder. For example, to read the position (0x30) of the 2nd encoder (0x01), the resulting function register address would be 0x31 (0x30 | 0x01).
Currently unused.
0x10 - Interrupt Set
Writing a 1 to any bit in this register will enable the interrupt for the specified encoder. The interrupt will fire when the encoder changes position.
0x20 - Interrupt Clear
Writing a 1 to any bit in this register will disable the interrupt for the specified encoder.
Byte 0 |
Byte 1 |
Byte 2 |
Byte 4 |
Position MSB |
... |
... |
Position LSB |
Reading this register returns the current encoder position. Writing to this register sets the current position to the specified value. The position value is a signed 32 bit integer.
Byte 0 |
Byte 1 |
Byte 2 |
Byte 3 |
Delta MSB |
... |
... |
Delta LSB |
Reading this register returns the change (delta) in position, as a signed 32 bit integer value, since the last read. The delta will also be reset to zero.
Page last edited June 10, 2024
Text editor powered by tinymce.