• 0
enliteneer

[FEATURE REQ] AD2 Pattern Output from Logic Input

Question

I've run into a situation, where I'd like to drive a output DIO pin based on an input pin...  basically a real-time pass-thru. 

The closest option in the 'Custom' menu on the pattern generator, is to read from a file and output with a fixed frequency..  and while the Logic Analyzer can save to a file,  I don't see a way of connecting the two real-time.

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
14 hours ago, attila said:

Hi @enliteneer

You can use the ROM logic in Pattern Generator for such purpose, see:

 

Thanks!  

Any thoughts on performance between using the ROM logic vs a script or executable ?    For example, I assume the Pattern Generator's 10Mhz is the best performance, but how much slower would a python while-loop or c executable run?

# enable output on DIO7:4, Init to 0
dwf.FDwfDigitalIOOutputEnableSet(hdwf, c_int(0xF0)) 
dwf.FDwfDigitalIOOutputSet(hdwf, c_int(  0x00 ))    

# Loop until keypress
while True:
	try:
		if ( keyboard.is_pressed('q')):
			print ("Exiting..")
			dwf.FDwfDeviceClose(hdwf)
			break;
		else:
			# Read Input
			dwf.FDwfDigitalIOStatus (hdwf) 
			dwf.FDwfDigitalIOInputStatus(hdwf, byref(dwRead)) 
			#print("I/O Status:  ",  "{0:#0{1}x}".format(dwRead.value, 4))

			# Drive D7:D4 based on D3:D0
			dwf.FDwfDigitalIOOutputSet(hdwf, c_int( (  dwRead.value << 4 )) )    
	except:
		# Any other Error, also close
		print("Exception!")
		dwf.FDwfDeviceClose(hdwf)
		break;

 

Share this post


Link to post
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