I am trying to write a script that enables two DIO pins to be used as a 30 MHz clock source(seems that DD only supports frequencies like 50M, 25M, 12.5M) and a piece-wise linear enable signal & thirteen DIN pins to get a timing signal (negative edge will be used for logic analyzer trigger) and twelve digital output signals from DUT. I referred to Waveforms help manual and help page, but examples utilizing logic analyzer and pattern generator were not available.
I wrote a practice code, but Patterns feature only works when I manually add corresponding DIO pin to Patterns window in GUI. Otherwise, output log says, 'TypeError: Result of expression 'Patterns1.Channels.DIO33' [undefined] is not an object.'
Also, I am also having hard time setting logic analyzer details with a script. Which properties should be defined in the script for activating thirteen DIN pins is not clear.
Could someone advise me how to write a proper script based on the following block diagram and my code?
Thanks in advance!
Best, J.J.
Code:
clear();
print("Fresh start");
if(!('Logic1' in this) || !('Patterns1' in this)) throw "Please open a Logic analyzer and a pattern generator instrument";
// patterns window should be opended already
// required signal IO pin should be assigned in GUI. if not, error evoked: Patterns1.Channels.DIO## 'undefined' is not an object
// PP: push-pull (0 and 1); OD: open drain (0 and Z); OS: open source (Z and 1); TS: three state (0 and 1 and Z)
// pins used in patterns window need to be created in GUI. failed to activate ceratin pins
Patterns1.Channels.DIO33.setEnable();
Patterns1.Channels.DIO33.Output.text = "PP"; // output type is push-pull (allowed pattern values are 0 and 1)
Question
J.J.
Hi.
I am trying to write a script that enables two DIO pins to be used as a 30 MHz clock source(seems that DD only supports frequencies like 50M, 25M, 12.5M) and a piece-wise linear enable signal & thirteen DIN pins to get a timing signal (negative edge will be used for logic analyzer trigger) and twelve digital output signals from DUT. I referred to Waveforms help manual and help page, but examples utilizing logic analyzer and pattern generator were not available.
I wrote a practice code, but Patterns feature only works when I manually add corresponding DIO pin to Patterns window in GUI. Otherwise, output log says, 'TypeError: Result of expression 'Patterns1.Channels.DIO33' [undefined] is not an object.'
Also, I am also having hard time setting logic analyzer details with a script. Which properties should be defined in the script for activating thirteen DIN pins is not clear.
Could someone advise me how to write a proper script based on the following block diagram and my code?
Thanks in advance!
Best, J.J.
Code:
clear();
print("Fresh start");
if(!('Logic1' in this) || !('Patterns1' in this)) throw "Please open a Logic analyzer and a pattern generator instrument";
// patterns window should be opended already
// required signal IO pin should be assigned in GUI. if not, error evoked: Patterns1.Channels.DIO## 'undefined' is not an object
// PP: push-pull (0 and 1); OD: open drain (0 and Z); OS: open source (Z and 1); TS: three state (0 and 1 and Z)
// pins used in patterns window need to be created in GUI. failed to activate ceratin pins
Patterns1.Channels.DIO33.setEnable();
Patterns1.Channels.DIO33.Output.text = "PP"; // output type is push-pull (allowed pattern values are 0 and 1)
Patterns1.Channels.DIO33.Type.text = "Clock";
Patterns1.Channels.DIO33.Frequency.value = 25E6; // 20 MHz clock (scientific notation works)
Patterns1.run();
Logic1.Trigger.Trigger.text = "Auto";
//Logic1.Trigger.Clock.text = "Internal";
Logic1.Channels.DIN23.Trigger.text = "Fall"; // falling edge of CLK_S will be the sampling timing
print("End of code.");
Edited by J.J.
Link to comment
Share on other sites
12 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now