Jump to content
  • 0

How to output a single pulse?


BobA

Question

Hi,

I have a Digital Discovery. I'd like it to output a single pulse -  start high, go low for a given amount of time (e.g. 200ns), and go high again - in response to some sort of command I give it, like a virtual button push.

Is there a way to do this?

Thank you.

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Using the WaveForms SDK and a supported IDE such as Python or C, You can toggle a digital bit.

The Digital Discovery includes 16 channels (or bits) of digital IO.

See https://digilent.com/reference/test-and-measurement/digital-discovery/reference-manual, section 9.2 and foot note 6.

Included in the WaveForms SDK, see python examples DigitalIO.py and DigitalOut_Pulse.py, or see C example digitalio.cpp.

Note that as these are static IO, they are software controlled.  Depending on the length of the pulse, a repeatable pulse duration may not be achievable.

Though not the Digital Discovery, I have done some testing using the digital IO of the Analog Discovery 2.  The pulses range anywhere from approximately 4 kHz to 20 kHz.  This is due to latencies caused by the Windows OS. 

You will want to verify performance on your own system.

 

 

Link to comment
Share on other sites

  • 0

Hi @BobA

Use the manual from the WF SDK folder and see the examples like /samples/py/DigitalOut_Pins.py
If it suits your project, the digital-out could be triggered with the trigger-io

image.png

 

dwf.FDwfDigitalOutEnableSet(hdwf, c_int(0), c_int(1)) # 0 is DIO-0 or DIO-24 for Digital Discovery
dwf.FDwfDigitalOutDividerSet(hdwf, c_int(0), c_int(1)) # use the 100MHz/10ns system frequency
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(0), c_int(10), c_int(10)) # 10x10ns low 10x10ns high, 200ns

dwf.FDwfDigitalOutRunSet(hdwf, c_double(600e-9)) # run for 600ns, 3x200ns

dwf.FDwfDigitalOutTriggerSourceSet(hdwf, trigsrcExternal1)
dwf.FDwfDigitalOutRepeatTriggerSet(hdwf, c_int(1))
dwf.FDwfDigitalOutRepeatSet(hdwf, c_int(0)) # inf

dwf.FDwfDigitalOutConfigure(hdwf, c_int(1))

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...