TS-7180 Quadrature
From embeddedTS Manuals
Quadrature Counters
The TS-7180 provides three independent quadrature counters. The associated inputs are shown in the table below.
|
Each of the quadrature counters (which are in the FPGA) is 16-bits wide, and are accessed via i2c. The addresses are shown below.
Quad # | MSB | LSB | MSB Alias |
---|---|---|---|
Quad0 | 96 | 97 | 98 |
Quad1 | 99 | 100 | 101 |
Quad2 | 102 | 103 | 104 |
For example, to read the MSB for Quad1:
tshwctl -r -a 99
The MSB aliases are used to detect 16-bit rollover. If the first reading of the MSB is not equal to the second, overflow/underflow was detected during the read.
Edge-Counters, Period-counters
For each input pin, there is an edge-counter, and a period-counter. The former counts the positive edges on an input pin, while the latter may be used to measure the elapsed time between N positive-edges.