Encoder Library

From the “Coding 104” and later release, the encoder library is included as part of the 86Duino IDE to provide high speed encoder interface.

The 86Duino encoder interface can be configured to work in different mode to support different type of encoder, such as optical encoders and rotary. Each encoder interface has 3 signal pins, A, B and Z, where each of these pins has different function under different modes.
There are different number of encoder interfaces on different 86Duino board. For example, there is one encoder interface on the 86Duino Zero board. On the 86Duino One board, there are 4 encoder interfaces.

86Duino Boards ENC0 pins ENC1 pins ENC2 pins ENC3 pins
Zero A: 42
B: 43
Z: 44
One A: 42
B: 43
Z: 44
A: 18
B: 19
Z: 20
A: 33
B: 34
Z: 35
A: 36
B: 37
Z: 38
EduCake A: 42
B: 43
Z: 44
A: 18
B: 19
Z: 20
PLC A: 0
B: 2
Z: 5

Following is the specification for 86Duino’s encoder interface:

  • 32-bit high speed counter, up to 25MHz
  • Digital filtering function
  • Support Pulse/DIR, CW/CCW and A/B Phase incremental encoder
  • Support SSI absolution encoder.
  • Support hardware PWM pulse capture with resolution up to 10 ns
  • Support position compare feature

Functions

begin()
end()
write()
read()
readNanoseconds()
indexRead()
directionRead()
pulseIn()
pulseInNanoseconds()
setComparator()
setDigitalFilter()
setInputPolarity()
setIndexReset()
setRange()
attachInterrupt()
detachInterrupt()

Note: The encoder library is simplified and does not cover all of the capabilities that are built-in to the 86Duino hardware. To explore the additional feature, please request datasheet for the Vortex86EX Motion-Control module via the following email alias:
Email: soc@dmp.com.tw


Libraries Reference Home

The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.