This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
university:tools:pluto:hacking:power_amp [10 Jul 2019 23:17] – fix underscores Robin Getz | university:tools:pluto:hacking:power_amp [16 Jul 2019 20:15] (current) – [Test Results] Robin Getz | ||
---|---|---|---|
Line 23: | Line 23: | ||
More information about the [[adi> | More information about the [[adi> | ||
- | ===== ADLM-PLUTO implementation ===== | + | ===== ADALM-PLUTO implementation ===== |
==== VDD_GPO ==== | ==== VDD_GPO ==== | ||
- | The power connected to the '' | + | The power connected to the '' |
- | With the 1.3 V '' | + | With the 1.3 V '' |
==== Pinout ==== | ==== Pinout ==== | ||
Line 61: | Line 61: | ||
==== Test Results ==== | ==== Test Results ==== | ||
- | A small script on the Pluto will demonstrate: | + | A small script on the Pluto SDR (or host) will demonstrate: |
< | < | ||
#!/bin/sh | #!/bin/sh | ||
+ | # Setup : Put into TDD mode, and setup GPO0 and GPO1 | ||
iio_attr -q -a -D ad9361-phy adi, | iio_attr -q -a -D ad9361-phy adi, | ||
- | iio_attr -a -D ad9361-phy adi, | + | iio_attr |
- | iio_attr -a -D ad9361-phy adi, | + | iio_attr |
iio_attr -q -a -D ad9361-phy | iio_attr -q -a -D ad9361-phy | ||
while [ 1 ] ; do | while [ 1 ] ; do | ||
- | iio_attr -q -a -d ad9361-phy ensm_mode rx | + | |
- | iio_attr -q -a -d ad9361-phy ensm_mode tx | + | # capture buffer |
+ | | ||
+ | # transmit buffer | ||
done | done | ||
</ | </ | ||
Line 80: | Line 83: | ||
{{ : | {{ : | ||
+ | |||
+ | <WRAP round help> | ||
+ | </ | ||
+ | |||
+ | OK, someone asked for the C code - it's pretty trivial, just longer. You will need to change the uri, and put in proper error checking. | ||
+ | |||
+ | < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | |||
+ | volatile sig_atomic_t stop = 0; | ||
+ | |||
+ | void inthand(int signum) { | ||
+ | stop = 1; | ||
+ | } | ||
+ | |||
+ | int main(int argc, char **argv) | ||
+ | { | ||
+ | struct iio_context *ctx; | ||
+ | struct iio_device *dev; | ||
+ | struct iio_channel *ch; | ||
+ | const char* val_str; | ||
+ | ssize_t ret = 0; | ||
+ | char buf[256]; | ||
+ | |||
+ | signal(SIGINT, | ||
+ | |||
+ | /* Create IIO Context */ | ||
+ | ctx = iio_create_context_from_uri(" | ||
+ | |||
+ | /* Find IIO device in current context */ | ||
+ | dev = iio_context_find_device(ctx, | ||
+ | |||
+ | /* Write into the IIO debug attributes */ | ||
+ | iio_device_debug_attr_write_bool(dev, | ||
+ | iio_device_debug_attr_write_bool(dev, | ||
+ | iio_device_debug_attr_write_bool(dev, | ||
+ | iio_device_debug_attr_write_bool(dev, | ||
+ | | ||
+ | while (!stop) { | ||
+ | ret++; | ||
+ | iio_device_attr_write(dev, | ||
+ | iio_device_attr_write(dev, | ||
+ | } | ||
+ | iio_context_destroy(ctx); | ||
+ | printf(" | ||
+ | return EXIT_SUCCESS; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Over USB, you get:< | ||
+ | time ./foo | ||
+ | ^Citteration = 2693 | ||
+ | |||
+ | real 0m5.283s | ||
+ | </ | ||
+ | |||
+ | or about 0.980876346 ms per Rx/Tx slot. | ||
+ | |||
+ | ^ Platform | ||
+ | | host | USB | shell | 80ms | | ||
+ | | host | USB | C code | 0.6 to 1.3 ms | | ||
+ | | pluto | local | shell | 30-35ms | | ||
+ | | pluto | local | C Code | 0.2 to 0.6 ms | | ||
+ | |||
+ | Again, these are representative numbers for software control, faster is possible with pin control. | ||
===== Testing in IIO Oscilloscope ===== | ===== Testing in IIO Oscilloscope ===== | ||