Jump to content
  • 0

[FEATURE REQ] AD2 Pattern Output from Logic Input


enliteneer

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.

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

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;

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...