Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next 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 Gamblinresources: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/in_altvoltage0_mag_rising_reset_max | mV | | |DOS Reset Maximum Threshold | 0x8B | events/in_altvoltage0_mag_rising_reset_max | mV | |
 |DOS Reset Minimum Threshold | 0x8C | events/in_altvoltage0_mag_rising_reset_min | mV | | |DOS Reset Minimum Threshold | 0x8C | events/in_altvoltage0_mag_rising_reset_min | mV | |
-|LOT High Threshold          | 0x8D | events/in_angl1_thresh_rising_value | | Convert to radians by multiplying channel scale +|LOT High Threshold          | 0x8D | events/in_angl1_thresh_rising_value | Radians | | 
-|LOT Low Threshold [1]       | 0x8E | events/in_angl1_thresh_rising_hysteresis | | Convert to radians by multiplying channel scale |+|LOT Low Threshold           | 0x8E | events/in_angl1_thresh_rising_hysteresis | Radians The value written to the LOT low register is high value minus the hysteresis. |
 |Excitation Frequency        | 0x91 | out_altvoltage0_frequency | Hz | | |Excitation Frequency        | 0x91 | out_altvoltage0_frequency | Hz | |
 |Control                     | 0x92 | *as bit fields* | | | |Control                     | 0x92 | *as bit fields* | | |
Line 84: Line 84:
 |  Encoder resolution        | D3:2 | *not implemented* | | | |  Encoder resolution        | D3:2 | *not implemented* | | |
 |  Resolution                | D1:0 | *device tree: assigned-resolution-bits* | Bits | 10, 12, 14, or 16 | |  Resolution                | D1:0 | *device tree: assigned-resolution-bits* | Bits | 10, 12, 14, or 16 |
-|Soft Reset                  | 0xF0 | [2] | | |+|Soft Reset                  | 0xF0 | | | Soft reset is performed when `out_altvoltage0_frequency` is written.|
 |Fault                       | 0xFF | *not implemented* | | | |Fault                       | 0xFF | *not implemented* | | |
- 
-[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:/sys/bus/iio/devices/iio:device1# echo 1 > in_angl0_hysteresis root@setup-2-zed:/sys/bus/iio/devices/iio:device1# echo 1 > in_angl0_hysteresis
 </xterm></WRAP> </xterm></WRAP>
- 
-<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. 
-</WRAP> 
- 
  
 ===== 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 and test it by retrieving samples like this:
-''mkdir /sys/kernel/config/iio/triggers/hrtimer/test''+
  
-You can grab some samples like this to connect the trigger and make sure things are working+<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
-''iio_readdev ad2s1210 -t test -s 1000 -T 10000 | hd''+<xterm> 
 +root@setup-2-zed:~# mkdir /sys/kernel/config/iio/triggers/hrtimer/test 
 +root@setup-2-zed:~# iio_readdev ad2s1210 -t test -s 1000 -T 10000 | hd 
 +WARNING: High-speed mode not enabled 
 +00000000  85 41 00 00 00 00 00 00  82 e1 7d ad 09 54 9e 17  |.A........}..T..| 
 +00000010  85 41 00 00 00 00 00 00  00 70 16 ae 09 54 9e 17  |.A.......p...T..| 
 +00000020  85 42 00 00 00 00 00 00  5f 06 af ae 09 54 9e 17  |.B......_....T..| 
 +00000030  85 41 00 00 00 00 00 00  3f a2 47 af 09 54 9e 17  |.A......?.G..T..| 
 +00000040  85 42 00 00 00 00 00 00  7f 32 e0 af 09 54 9e 17  |.B.......2...T..| 
 +00000050  85 41 00 00 00 00 00 00  41 c8 78 b0 09 54 9e 17  |.A......A.x..T..| 
 +00000060  85 41 00 00 00 00 00 00  ab 64 11 b1 09 54 9e 17  |.A.......d...T..| 
 +00000070  85 41 00 00 00 00 00 00  fb f6 a9 b1 09 54 9e 17  |.A...........T..| 
 +00000080  85 41 00 00 00 00 00 00  85 8b 42 b2 09 54 9e 17  |.A........B..T..| 
 +00000090  85 41 ff ff 00 00 00 00  13 22 db b2 09 54 9e 17  |.A......."...T..| 
 +000000a0  85 42 00 00 00 00 00 00  e3 b8 73 b3 09 54 9e 17  |.B........s..T..| 
 +000000b0  85 42 00 00 00 00 00 00  53 4f 0c b4 09 54 9e 17  |.B......SO...T..| 
 +000000c0  85 41 00 00 00 00 00 00  6a e8 a4 b4 09 54 9e 17  |.A......j....T..| 
 +000000d0  85 41 00 00 00 00 00 00  24 7d 3d b5 09 54 9e 17  |.A......$}=..T..| 
 +000000e0  85 41 ff ff 00 00 00 00  7c 13 d6 b5 09 54 9e 17  |.A......|....T..| 
 +000000f0  85 41 00 00 00 00 00 00  2c a9 6e b6 09 54 9e 17  |.A......,.n..T..| 
 +... 
 +</xterm></WRAP>
  
 <note important> using the -t option to specify the trigger with iio_readdev resets the sampling rate of the hrtimer trigger back to 100Hz!</note> <note important> using the -t option to specify the trigger with iio_readdev resets the sampling rate of the hrtimer trigger back to 100Hz!</note>
  
 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:
-''iio_attr -d test sampling_frequency 10000''+ 
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> 
 +<xterm> 
 +root@setup-2-zed:~# iio_attr -d test sampling_frequency 10000 
 +10000.000000 
 +</xterm></WRAP>
  
 ===== Reading IIO Events ===== ===== Reading IIO Events =====
Line 282: Line 297:
 Fault to event mapping: Fault to event mapping:
  
-^ Fault                                    ^ Channel     ^ Type   ^ Direction ^ +^ Fault                                    ^ Channel     ^ Type   ^ Direction ^ Notes 
-|Sine/cosine inputs clipped [3]          | D7 | altvoltage1 | mag    | either | +|Sine/cosine inputs clipped              | D7 | altvoltage1 | mag    | either | The chip does not differentiate between fault on sine vs. cosine so there will also be an event on the altvoltage2 channel. 
-|Sine/cosine inputs below LOS            | D6 | altvoltage0 | thresh | falling | +|Sine/cosine inputs below LOS            | D6 | altvoltage0 | thresh | falling 
-|Sine/cosine inputs exceed DOS overrange | D5 | altvoltage0 | thresh | rising | +|Sine/cosine inputs exceed DOS overrange | D5 | altvoltage0 | thresh | rising 
-|Sine/cosine inputs exceed DOS mismatch  | D4 | altvoltage0 | mag    | rising | +|Sine/cosine inputs exceed DOS mismatch  | D4 | altvoltage0 | mag    | rising 
-|Tracking error exceeds LOT              | D3 | angl1       | thresh | rising | +|Tracking error exceeds LOT              | D3 | angl1       | thresh | rising 
-|Velocity exceeds maximum tracking rate  | D2 | anglvel0    | mag    | rising | +|Velocity exceeds maximum tracking rate  | D2 | anglvel0    | mag    | rising 
-|Phase error exceeds phase lock range    | D1 | phase0      | mag    | rising | +|Phase error exceeds phase lock range    | D1 | phase0      | mag    | rising 
-|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 ^ Notes 
-| RES0 | LK6 [1] | 15 | GPIO22 | +| RES0 | LK6 | 15 | GPIO22 | 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] | 16 | GPIO23 |+| RES1 | LK7 | 16 | GPIO23 | 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. |
 | 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 ^ Notes 
-| 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://raw.githubusercontent.com/analogdevicesinc/linux/rpi-6.1.y/arch/arm/boot/dts/overlays/ad2s1210-overlay.dts|ad2s1210-overlay.dts]] Overlay: [[https://raw.githubusercontent.com/analogdevicesinc/linux/rpi-6.1.y/arch/arm/boot/dts/overlays/ad2s1210-overlay.dts|ad2s1210-overlay.dts]]
 +
 +==== Sample Images ====
 +
 +Eval board connections:
 +
 +{{:resources:tools-software:linux-drivers:iio-resolver:img_20231206_135017785_hdr.jpg?400|}}
 +
 +Raspberry Pi connections:
 +
 +{{:resources:tools-software:linux-drivers:iio-resolver:img_20231206_135039086.jpg?400|}}
  
 ===== Zedboard ===== ===== Zedboard =====
  
-See [[:resources:eval:user-guides:ad2s1210_sdz]]+{{:resources:tools-software:linux-drivers:iio-resolver:img_20231207_080341.jpg?400|}} 
 + 
 +See [[:resources:eval:user-guides:ad2s1210_sdz]] for a detailed setup guide
  
 ====== More Information ====== ====== More Information ======
  
 {{page>software:linux:docs:iio:iio_snippets#iio pointers&noheader&firstseconly&noeditbtn}} {{page>software:linux:docs:iio:iio_snippets#iio pointers&noheader&firstseconly&noeditbtn}}
resources/tools-software/linux-drivers/iio-resolver/ad2s1210.1701887569.txt.gz · Last modified: 06 Dec 2023 19:32 by Trevor Gamblin