Hi,
I started hacking on a sigrok redpitaya driver and I'm looking for a python example or scpi example for how to use the logic analyzer pro. I've seen `DIG:PIN? <pin>`, but am looking for something like `ACQ:START`. I looked for the logicanalyzer application in the redpitaya free applications directory, but it looks like the source code for the logic analyzer app isn't available.
Thanks,
David
sigrok/pulseview support
-
- Posts: 5
- Joined: Sun Mar 04, 2018 6:45 pm
sigrok/pulseview support
Last edited by dvc on Tue Mar 20, 2018 2:59 pm, edited 1 time in total.
-
- Posts: 5
- Joined: Sun Mar 04, 2018 6:45 pm
Re: scpi logic analyzer
So I decided to implement my own driver/tcp server
src is available here:
github.com/dvc94ch/libsigrok
github.com/dvc94ch/redpitaya-mercury
the only remaining problem is how to use interrupts. the python code doesn't use any. So currently I'm filling the buffer, sending the buffer, restarting state machine. there are missing samples during the sending the buffer part, so there should be some kind of half full interrupt somewhere.
src is available here:
github.com/dvc94ch/libsigrok
github.com/dvc94ch/redpitaya-mercury
the only remaining problem is how to use interrupts. the python code doesn't use any. So currently I'm filling the buffer, sending the buffer, restarting state machine. there are missing samples during the sending the buffer part, so there should be some kind of half full interrupt somewhere.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 89
- Joined: Tue Mar 29, 2016 7:41 pm
Re: sigrok/pulseview support
This bit of documentation can be helpful.
-
- Posts: 5
- Joined: Sun Mar 04, 2018 6:45 pm
Re: sigrok/pulseview support
The problem is that they aren't used anywhere. /dev/uio/ps2pl is the only device that allows enabling interrupts. echo 'x01' > /dev/uio/la gives an error. I'll have to decipher the dtso [0] and maybe the rtl. I'm not really fluent in system verilog...
[0] github.com/RedPitaya/RedPitaya/blob/master/fpga/prj/mercury/dts/fpga.dtso
[0] github.com/RedPitaya/RedPitaya/blob/master/fpga/prj/mercury/dts/fpga.dtso
-
- Posts: 5
- Joined: Sun Mar 04, 2018 6:45 pm
Re: sigrok/pulseview support
So I suspect that no interrupts are implemented yet, because it never terminates. Can someone please confirm?
```rust
let hwid = HwId::new();
hwid.show();
let mut ps2pl = Interrupt::new();
ps2pl.enable();
// setup logic analyzer
let mut la = LogicAnalyzer::new();
la.default();
la.set_input_mask(0xffff);
la.set_trigger_pre(la::BUFFER_SIZE / 2);
la.set_trigger_post(la::BUFFER_SIZE / 2);
la.set_decimation(1000);
la.set_sync_source(SyncSource::La);
la.set_trigger_source(TriggerSource::La);
la.show();
thread::sleep(time::Duration::from_millis(1000));
// reset and start
la.reset();
la.start_trigger();
println!("Wait for interrupt");
let res = ps2pl.wfi();
println!("Received interrupt {}", res);
```
```rust
let hwid = HwId::new();
hwid.show();
let mut ps2pl = Interrupt::new();
ps2pl.enable();
// setup logic analyzer
let mut la = LogicAnalyzer::new();
la.default();
la.set_input_mask(0xffff);
la.set_trigger_pre(la::BUFFER_SIZE / 2);
la.set_trigger_post(la::BUFFER_SIZE / 2);
la.set_decimation(1000);
la.set_sync_source(SyncSource::La);
la.set_trigger_source(TriggerSource::La);
la.show();
thread::sleep(time::Duration::from_millis(1000));
// reset and start
la.reset();
la.start_trigger();
println!("Wait for interrupt");
let res = ps2pl.wfi();
println!("Received interrupt {}", res);
```
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: No registered users and 59 guests