Jump to content
  • 0

How to delay signal pattern and choice how many time it repeat/ Can I use a save in python ?


Mathias G.

Question

Hello !

I have yet the ADP3450 and I want to recreate a specific signal with a delay (of 6.3 us) and only 1 repeat for just one pattern with the python and the SDK library. 

I have a second question, can I use a save of a project to launch the pattern generator in python ?

(On the picture you have just a part of the code) 

image.thumb.png.96cc3745d82d1cd348a0fd21754e89f1.png

seq1 TEST DOUBLE.py

Edited by Mathias G.
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0
37 minutes ago, attila said:

Hi @Mathias G.

Use FDwfDigitalOutRunSet(seconds), FDwfDigitalOutRepeatSet(1) and FDwfDigitalOutDividerInitSet(hz_sys_freq * sec_delay)

Functions DORunSet and DORepeatSet work only for all pin not a specific one, that's right ?

Edited by Mathias G.
Link to comment
Share on other sites

  • 0
On 6/9/2023 at 1:56 PM, attila said:

Hi @Mathias G.

Use FDwfDigitalOutRunSet(seconds), FDwfDigitalOutRepeatSet(1) and FDwfDigitalOutDividerInitSet(hz_sys_freq * sec_delay)

Hi @attila

I have a new question about the FDwfDigitalOutDividerInitSet function : if I have a clock of 1KHz (generate by a pulse signal), how can I create a delay of 60 us or 1ms ? I try but don't understand how to set the function... 

Link to comment
Share on other sites

  • 0

Hi @Mathias G.

channel = c_int(0)
hzSys = c_double()
dwf.FDwfDigitalOutInternalClockInfo(hdwf, byref(hzSys))
dwf.FDwfDigitalOutEnableSet(hdwf, channel, c_uint(1))
dwf.FDwfDigitalOutCounterSet(hdwf, channel, c_uint(1), c_uint(1)) # 1 low 1 high
dwf.FDwfDigitalOutDividerSet(hdwf, channel, c_uint(int(hzSys.value/1e3/2))) # 1kHz = 0.5ms x (1 low + 1 high)
dwf.FDwfDigitalOutDividerInitSet(hdwf, channel, c_uint(int(hzSys.value*(0.5e-3+60e-6)-1)) # 0.5ms + 60us
or
dwf.FDwfDigitalOutDividerInitSet(hdwf, channel, c_uint(int(hzSys.value*(0.5e-3+1e-3)-1))) # 0.5ms + 1ms

Link to comment
Share on other sites

  • 0
56 minutes ago, attila said:

Hi @Mathias G.

channel = c_int(0)
hzSys = c_double()
dwf.FDwfDigitalOutInternalClockInfo(hdwf, byref(hzSys))
dwf.FDwfDigitalOutEnableSet(hdwf, channel, c_uint(1))
dwf.FDwfDigitalOutCounterSet(hdwf, channel, c_uint(1), c_uint(1)) # 1 low 1 high
dwf.FDwfDigitalOutDividerSet(hdwf, channel, c_uint(int(hzSys.value/1e3/2))) # 1kHz = 0.5ms x (1 low + 1 high)
dwf.FDwfDigitalOutDividerInitSet(hdwf, channel, c_uint(int(hzSys.value*(0.5e-3+60e-6)-1)) # 0.5ms + 60us
or
dwf.FDwfDigitalOutDividerInitSet(hdwf, channel, c_uint(int(hzSys.value*(0.5e-3+1e-3)-1))) # 0.5ms + 1ms

Hi @attila

So I have try with this function dwf.FDwfDigitalOutDividerInitSet(hdwf, channel, c_uint(int(hzSys.value*(0.5e-3+9e-6)-1))

But on the oscilloscope I have a delay of 136us (I have try with few values of delay but each one is false)

Analyse - 2023-06-12 15_31_30.jpeg

Edited by Mathias G.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...