This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:tools-software:linux-drivers:iio-resolver:ad2s1210 [06 Dec 2023 19:32] – fix units of LOT and hysteresis; replace ls of sys/bus with tree Trevor Gamblin | resources:tools-software:linux-drivers:iio-resolver:ad2s1210 [07 Dec 2023 15:44] (current) – added setup images Trevor Gamblin | ||
---|---|---|---|
Line 76: | Line 76: | ||
|DOS Reset Maximum Threshold | 0x8B | events/ | |DOS Reset Maximum Threshold | 0x8B | events/ | ||
|DOS Reset Minimum Threshold | 0x8C | events/ | |DOS Reset Minimum Threshold | 0x8C | events/ | ||
- | |LOT High Threshold | + | |LOT High Threshold |
- | |LOT Low Threshold | + | |LOT Low Threshold |
|Excitation Frequency | |Excitation Frequency | ||
|Control | |Control | ||
Line 84: | Line 84: | ||
| Encoder resolution | | Encoder resolution | ||
| Resolution | | Resolution | ||
- | |Soft Reset | 0xF0 | [2] | | | | + | |Soft Reset | 0xF0 | | | Soft reset is performed when `out_altvoltage0_frequency` is written.| |
|Fault | |Fault | ||
- | |||
- | [1]: The value written to the LOT low register is high value minus the | ||
- | hysteresis. | ||
- | |||
- | [2]: Soft reset is performed when `out_altvoltage0_frequency` is written. | ||
===== Interfacing With the AD2S1210 via iio_attr ===== | ===== Interfacing With the AD2S1210 via iio_attr ===== | ||
Line 257: | Line 252: | ||
root@setup-2-zed:/ | root@setup-2-zed:/ | ||
</ | </ | ||
- | |||
- | <WRAP round help> | ||
- | The second value from in_angl0_hysteresis_available can be multiplied by the value of in_angl0_scale to get the hysteresis in radians. | ||
- | </ | ||
- | |||
===== Triggered buffer ===== | ===== Triggered buffer ===== | ||
- | To generate samples using the triggered buffer, you will need a trigger. You can create an hrtimer trigger like this: | + | To generate samples using the triggered buffer, you will need a trigger. You can create an hrtimer trigger |
- | '' | + | |
- | You can grab some samples like this to connect | + | <WRAP box bggreen>< |
- | '' | + | < |
+ | root@setup-2-zed:~# mkdir / | ||
+ | root@setup-2-zed: | ||
+ | WARNING: High-speed mode not enabled | ||
+ | 00000000 | ||
+ | 00000010 | ||
+ | 00000020 | ||
+ | 00000030 | ||
+ | 00000040 | ||
+ | 00000050 | ||
+ | 00000060 | ||
+ | 00000070 | ||
+ | 00000080 | ||
+ | 00000090 | ||
+ | 000000a0 | ||
+ | 000000b0 | ||
+ | 000000c0 | ||
+ | 000000d0 | ||
+ | 000000e0 | ||
+ | 000000f0 | ||
+ | ... | ||
+ | </ | ||
<note important> | <note important> | ||
For other apps, we probably want a high sample rate. You can change the rate like this: | For other apps, we probably want a high sample rate. You can change the rate like this: | ||
- | '' | + | |
+ | <WRAP box bggreen>< | ||
+ | < | ||
+ | root@setup-2-zed: | ||
+ | 10000.000000 | ||
+ | </ | ||
===== Reading IIO Events ===== | ===== Reading IIO Events ===== | ||
Line 282: | Line 297: | ||
Fault to event mapping: | Fault to event mapping: | ||
- | ^ Fault | + | ^ Fault |
- | |Sine/ | + | |Sine/ |
- | |Sine/ | + | |Sine/ |
- | |Sine/ | + | |Sine/ |
- | |Sine/ | + | |Sine/ |
- | |Tracking error exceeds LOT | D3 | angl1 | thresh | rising | | + | |Tracking error exceeds LOT | D3 | angl1 | thresh | rising |
- | |Velocity exceeds maximum tracking rate | D2 | anglvel0 | + | |Velocity exceeds maximum tracking rate | D2 | anglvel0 |
- | |Phase error exceeds phase lock range | D1 | phase0 | + | |Phase error exceeds phase lock range | D1 | phase0 |
- | |Configuration parity error | D0 | *writes to kernel log* | | + | |Configuration parity error | D0 | *writes to kernel log* | | |
- | + | ||
- | [3]: The chip does not differentiate between fault on sine vs. cosine so | + | |
- | there will also be an event on the altvoltage2 channel. | + | |
====== Usage With the EVAL-AD2S1210SDZ Evaluation Board ====== | ====== Usage With the EVAL-AD2S1210SDZ Evaluation Board ====== | ||
Line 302: | Line 313: | ||
==== Wiring ==== | ==== Wiring ==== | ||
- | ^ AD2S1210 Pin ^ Eval Board Pin ^ RPi Header Pin ^ RPi Function ^ | + | ^ AD2S1210 Pin ^ Eval Board Pin ^ RPi Header Pin ^ RPi Function |
- | | RES0 | LK6 [1] | 15 | GPIO22 | | + | | RES0 | LK6 | 15 | GPIO22 |
- | | RES1 | LK7 [1] | 16 | GPIO23 | | + | | RES1 | LK7 | 16 | GPIO23 |
| A0 | J4-12 | 18 | GPIO24 | | | A0 | J4-12 | 18 | GPIO24 | | ||
| A1 | J4-11 | 22 | GPIO25 | | | A1 | J4-11 | 22 | GPIO25 | | ||
Line 319: | Line 330: | ||
| CS | J4-2, J4-6 | DGND | | | CS | J4-2, J4-6 | DGND | | ||
- | ^ Eval Board Signal ^ Eval Board Jumper ^ Position ^ | + | ^ Eval Board Signal ^ Eval Board Jumper ^ Position |
- | | SAMPLE | LK1 | B | | + | | SAMPLE | LK1 | B | | |
- | | CS | LK2 | C | | + | | CS | LK2 | C | | |
- | | RD | LK3 | C | | + | | RD | LK3 | C | | |
- | | A0 | LK 4 | C | | + | | A0 | LK 4 | C | | |
- | | A1 | LK5 | C | | + | | A1 | LK5 | C | | |
- | | RES0 | LK6 [1] | C | | + | | RES0 | LK6 | C | There aren’t J4 pins for RES0/1 so have to use jumper pins. It is also possible to hard-wire resolution pins RES0/1, but device tree would need to be changed accordingly. |
- | | RES1 | LK7 [1] | C | | + | | RES1 | LK7 | C | There aren’t J4 pins for RES0/1 so have to use jumper pins. It is also possible to hard-wire resolution pins RES0/1, but device tree would need to be changed accordingly. |
- | | SOE | LK9 | B | | + | | SOE | LK9 | B | | |
- | | VDRIVE | LK703 | B | | + | | VDRIVE | LK703 | B | | |
- | + | ||
- | [1] There aren’t J4 pins for RES0/1 so have to use jumper pins. It is also possible to hard-wire resolution pins RES0/1, but device tree would need to be changed accordingly. | + | |
==== Device Tree ==== | ==== Device Tree ==== | ||
Line 337: | Line 346: | ||
Overlay: [[https:// | Overlay: [[https:// | ||
+ | |||
+ | ==== Sample Images ==== | ||
+ | |||
+ | Eval board connections: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Raspberry Pi connections: | ||
+ | |||
+ | {{: | ||
===== Zedboard ===== | ===== Zedboard ===== | ||
- | See [[: | + | {{: |
+ | |||
+ | See [[: | ||
====== More Information ====== | ====== More Information ====== | ||
{{page> | {{page> |