Hi Franco

The snapshot block has internal registers for arming, triggering etc. The
trig line from the external register is not doing anything in your example
code above because you are manually triggering when calling the
snapshot_get function. If you are interested, look inside the snapshot
block and you will see the registers.

You may want to install and use casperfpga (
github.com/casper-astro/casperfpga) rather than corr, as it has a lot of up
to date support for snapshot blocks, registers etc.

Regards
Andrew

On Mon, Jan 22, 2018 at 5:59 PM, Franco Curotto <[email protected]>
wrote:

> Dear all,
>
> I'm having the following issue with the snapshot block: I'm trying to
> control the snapshot using a trigger, so that bram is only overwritten when
> the trigger has a rising edge. For this I put the snapshot block in
> circular capture mode, and I connect a register to the 'trig' and 'stop'
> inputs, with the stop signal one clock delayed. As I understand the block,
> when I trigger the register the snapshot should start writing in memory,
> because I'm activating stop right after, the memory should be written only
> once. However when I test my model I get different data every time I read
> the snapshot. This is a minimal example of what I want to do:
>
> import corr, time
> import numpy as np
> import matplotlib.pyplot as plt
>
> fpga = corr.katcp_wrapper.FpgaClient('192.168.1.12')
> time.sleep(1)
> fpga.progdev('adc_sync.bof.gz')
>
> fpga.write_int('snap_trig', 0)
> fpga.write_int('snap_trig', 1)
> fpga.write_int('snap_trig', 0) # trigger the snapshot once
>
> for _ in range(3): # read the data three times
>     snap_data0 = np.fromstring(fpga.snapshot_get('adcsnap0',
> man_trig=True)['data'], dtype='>i1')[:400]
>     plt.plot(snap_data0)
>
> plt.show() # <- should show three overlaping lines, instead I get three
> different lines
>
> My only guess is that the snapshot_get function is actually triggering the
> snapshot block, so is getting new data. Anyone have some idea of what is
> going on?
>
> Franco Curotto
>
> --
> You received this message because you are subscribed to the Google Groups "
> [email protected]" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
>

-- 
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to