Jump to content

Search the Community

Showing results for tags 'waveforms'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • New Users Introduction
    • Announcements
  • Digilent Technical Forums
    • FPGA
    • Test and Measurement
    • Measurement Computing (MCC)
    • Add-on Boards
    • Digilent Microcontroller Boards
    • Non-Digilent Microcontrollers
    • LabVIEW
    • FRC
    • Other
  • General Discussion
    • Project Vault
    • Learn
    • Suggestions & Feedback
    • Buy, Sell, Trade
    • Sales Questions
    • Off Topic
    • Educators
    • Technical Based Off-Topic Discussions
    • Archived

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Hello all, I'm trying to run an Analog Discovery 2 off a Raspberry Pi Zero W for long duration data recording. I'm running into an issue with getting Waveforms to start on the Pi. When I start it from the command line I get "Illegal Instruction" and nothing else. I think it has something to do with the libdwf.so because i was seeing the same error with a Python script. I don't get an error with ldd libdwf.so but I do get the same illegal instruction error with python3 -c "from ctypes import *; dwf = cdll.LoadLibrary('libdwf.so')" Installed SW: digilent.adept.runtime_2.26.1-armhf.deb digilent.waveforms_3.17.1_armhf.deb Also tried with digilent.waveforms_3.18.1-armhf.deb Raspberrypios 5.10.103+ I have run apt update, upgrade, -f install, --fix-broken. Any other suggestions on what I could try would be appreciated!
  2. Hi. I successfully measured my unit DUT with the forum's help. Now I am trying to expand the measurement by connecting more DUTs and do some calculations to generate integer values that can be assigned to bus inputs of the DUTs. Most of the controls will be implemented in Script. To be more specific, the whole system goes like this: 30 MHz clock signal and enable signal are assigned to three DUTs. (This can be done manually, or simply by running Patterns1.run() with settings done in GUI) Three 5-bit bus values range between integer 0 and 31. Initializing is not that important here. Logic analyzer will capture 3 DUT digital output signals whenever the sync signal falls. Only one of the three signals will be valid. The other two are prohibited to be changed for three cycles. So the other two values will be replaced with previously saved digital values. (if statement starting from line 50) Predefined integers are multiplied with corresponding DUT outputs and added to implement a weighted sum (IN1, IN2, IN3). Weighted sum values will be converted into binary expressions and assigned to corresponding DUTs. The procedure iterates 1000 times, and each start should be synchronized with falling edge of DIN0. DIN0 receives a 10 MHz toggling signal that comes from a DUT. I am having hard time coding how to sync for loop with DIO0, and assigning three 5-bit bus signals with calculated IN1, IN2, IN3. I attached my workspace. Could someone show me a way to do this? Thanks always. J.J. DUT3.dwf3work
  3. This is no important issue, I'm just doing some finger exercises with Waveforms. The thought behind my actual problem: When signals enter the analyzer through different ways like isolators and such, they gather different time offsets. As the Waveforms logic analyzer provides no timeshift functionality out of the box I came to think about a custom logic script to move the data of one channels rgData array to rgValue with an offset index. But to calculate the array offset from the expected time offset I would need to know the actual sample rate of the data. This data I don't have because custom logic scripts don't have access to the Device information. Would it make sense, or be feasible, to provide a time offset functionality for each channel? Would it make sense to provide access to the device settings in a custom logic script?
  4. 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.");
  5. // This posted here so that Google and Bing search the script to help other users of Digilent Analog Discovery AD2 // and Digilent wave forms find programming examples which are very difficult to find. // This driver is work in progress . SPI & I2C functionality not working yet . // for use with Digilent Analog Discovery AD2 script engine. // // Attila : Please leave this post up on the forum as I spent a very long time curating the script to find all the // small example pieces of code . // // ------------------------------------------------------------------------------------------------------------------- //************************************************************ // // Notes on the basic script syntax can be found here // // You can use the links in the Help, other educational pages or google... // // https://doc.qt.io/qt-5/ecmascript.html // // https://www.w3schools.com/jsref/jsref_obj_array.asp // // Note for this script to work the following Waveforms window panels have to be open // - Supplies - the internal AD2 PSU can be used // - Main script -- location where this script is cut and pasted // - Protocol ** - required to have acces to the AD2 internal SPI or UART or I2C bus engines // // edit using Notepad++ with the langauge Javascript selected. // // //************************************************************ //************************************************************ //Function blocks //************************************************************ function bitExtracted( number, k, p) { // Function to extract k bits from p position // and returns the extracted value as integer // eg first 11 bits of a 16 bit number // bitExtracted(int 0xfff,10,0) return (((1 << k) - 1) & (number >> (p - 1))); } function spi_initialise() { if(!('Protocol' in this)) throw "Please open the Protocol tool window"; //************************************************************ // Script using Protocol SPI. // SPI BUS Set up //************************************************************ // // SPI Bus physical wired set up // // Select AD_2_DIO3 // SPI: /CS // Clock AD_2_DIO4 // SPI: Clock // DQ0 AD_2_DIO5 // SPI: MOSI // DQ1 AD_2_DIO6 // SPI: MOS0 // // !! Remember to change the set up in function spi_pin_io_setup() if the SPI Pins are re assigned on the AD2 DIO GPIO pins !! Protocol.Mode.text = "SPI"; // make sure SPI tab is selected Protocol.SPI.Select.Active.value=0; Protocol.SPI.Clock.Polarity.value=0 ; // set up spi clock initial Polarity Protocol.SPI.Clock.Phase.value=0 ; // set up spi clock initial Phase Protocol.SPI.Clock.Frequency.value=1e6 ; // set spi clock freqncy at 1MHz page 19 of the data sheet min spi clock 1MHz if(Protocol.SPI.Clock.Frequency.value > 1e6) Protocol.SPI.Clock.Frequency.value = 1e6; Protocol.SPI.Select.value = 3; //Assigns pin Analog Disovery 2 GPIO Pin DIO 3 Protocol.SPI.Clock.value = 4; //Assigns pin Analog Disovery 2 GPIO Pin DIO 4 Protocol.SPI.DQ0.value = 5; //Assigns pin Analog Disovery 2 GPIO Pin DIO 5 // // SPI: MOSI Protocol.SPI.DQ1.value = 6; //Assigns pin Analog Disovery 2 GPIO Pin DIO 6 // SPI: MOS0 Protocol.config() // apply configuration changes now print(" SPI initialised " + "\n\r" ); print(" SPI Select is connect to AD2 DIO Port : " + Protocol.SPI.Select.value + "\n\r" ) ; print(" SPI Clock connect to AD2 DIO Port : " + Protocol.SPI.Clock.value + "\n\r" ) ; print(" SPU MOSI port connect to AD2 DIO Port : " + Protocol.SPI.DQ0.value + "\n\r" ) ; print(" SPU MOSO port connect to AD2 DIO Port : " + Protocol.SPI.DQ1.value + "\n\r" ) ; print("\n\r"+" SPI initialisation complete " + "\n\r" ) ; //************************************************************ // notes // ===== // // 1. On the AD and AD2 the digital IO pins use LVCMOS 3V3 standard. These are supplied at 3.3V and have 200 Ohm PTC and clamping diodes to GND and to 3.3V for protection. // It will drive the digital wires at 3.3V and connecting 5V signals directly, without series resistor, it will sink about 10mA through the PTC and 3v3 diode. // As for noise, make sure to have ground connection between the two devices. // // 2. The WF/Protocol/UART uses the Stop length option only for transmission, this is not relevant for reception. // // 3. The UART TX filed lets you type in characters, hexadecimal values are not supported here. // Special chars you can copy/paste from other place or send from file. //************************************************************ } function i2c_initialise() { if(!('Protocol' in this)) throw "Please open the Protocol tool window"; //************************************************************ // Script using Protocol I2C. // i2C BUS Set up //************************************************************ // // I2C Bus physical wired set up // // I2C SDA AD_2_DIO0 // I2C SCL AD_2_DIO1 // /Reset AD_2_DIO3 // // // // // Note Only DIO pins 0 through to 9 can be used for Protocol functions { SPI , I2C or UART} // // var I2C_reset_AD2_DIO_port = 3 ; // Set to AD2 DIO Port which controls I2C /Reset io line Protocol.Mode.text = "I2C"; // make sure SPI tab is selected Protocol.I2C.Mode.value = 1; //Set the I2C Protocol tool into Master Mode Protocol.I2C.SCL.value = 1; //Set the SCL pin to be DIO 0 Protocol.I2C.SDA.value = 0; //Set the SDA pin to be DIO 1 Protocol.I2C.SCL.Frequency.value = 100000; //Set the SCL clock frequency to 100 kHz //Protocol.I2C.Clockstretching.value = 1; //Enable Clock Stretching´.. This line is not functioning Protocol.I2C.ClockStretching.enable; // This is the replacement lines Protocol.config() // apply configuration changes now // flip the GPIO active low reset line set low then set high set_static_io_pin(I2C_reset_AD2_DIO_port,0); wait(0.1); // wait 100 milli second before next instruction. set_static_io_pin(I2C_reset_AD2_DIO_port,1); wait(0.1); // wait 100 milli second before next instruction. // ref https://forum.digilentinc.com/topic/4942-i2c-subaddress-not-working-properly-in-the-script-tool/ // Ref https://forum.digilentinc.com/topic/21906-how-to-measure-scope-and-protocol/ // ref https://forum.digilentinc.com/topic/18944-reading-i2c-via-script-displays-wrong-data/ print(" I2C initialised " + "\n\r" ); print(" I2C SCL connect to AD2 DIO Port " + Protocol.I2C.SCL.value + "\n\r" ) ; print(" I2C SDA connect to AD2 DIO Port " + Protocol.I2C.SDA.value + "\n\r" ) ; print(" I2C /RESET port connect to AD2 DIO Port " + I2C_reset_AD2_DIO_port + "\n\r" ) ; print("\n\r"+" I2C initialisation complete " + "\n\r" ) ; //************************************************************ // notes // ===== // // 1. On the AD and AD2 the digital IO pins use LVCMOS 3V3 standard. These are supplied at 3.3V and have 200 Ohm PTC and clamping diodes to GND and to 3.3V for protection. // It will drive the digital wires at 3.3V and connecting 5V signals directly, without series resistor, it will sink about 10mA through the PTC and 3v3 diode. // As for noise, make sure to have ground connection between the two devices. // // 2. The WF/Protocol/UART uses the Stop length option only for transmission, this is not relevant for reception. // // 3. The UART TX filed lets you type in characters, hexadecimal values are not supported here. // Special chars you can copy/paste from other place or send from file. //************************************************************ } function i2c_notes_read_with_i2c_sub_address() { // // Ref https://forum.digilentinc.com/topic/4942-i2c-subaddress-not-working-properly-in-the-script-tool/ // // // Special sub-addressing is only required for read operations. In this process the sub-address write is followed by a restart and read. // ref https://www.i2c-bus.org/repeated-start-condition/ // For write operations you can just concatenate the "sub-address" with the array of data you have to write. var a = [1,2] // sub-address var b = [3,4] // data var c = a.concat(b) Protocol.I2C.Write(0x48, c) } function i2c_write( address , data_array_to_write) { // // Examples of i2c_write // // address = 0x60 // data_array_to_write = [0,1] // Protocol.I2C.Write(address, data_array_to_write ) ; // notes // ===== // // 1. On the AD and AD2 the digital IO pins use LVCMOS 3V3 standard. These are supplied at 3.3V and have 200 Ohm PTC and clamping diodes to GND and to 3.3V for protection. // It will drive the digital wires at 3.3V and connecting 5V signals directly, without series resistor, it will sink about 10mA through the PTC and 3v3 diode. // As for noise, make sure to have ground connection between the two devices. // // 2. The WF/Protocol/UART uses the Stop length option only for transmission, this is not relevant for reception. // // 3. The UART TX filed lets you type in characters, hexadecimal values are not supported here. // Special chars you can copy/paste from other place or send from file. } function i2c_read( address , number_of_bytes_to_read_back ) { // // Examples of i2c_read // // address = 0x60 // number_of_bytes_to_read_back =32 // var bytes = Protocol.I2C.Read( address, number_of_bytes_to_read_back) ;// returns array of x bytes read from device address 0x0D return bytes ; } function i2c_read_example() { // From the Script tool you can perform I2C transfer like this: var bytes = Protocol.I2C.Read(0x0D, 2) ;// returns array of 2 bytes read from device address 0x0D var temp = (((bytes[0]<<26) | (bytes[1]<<18)) >>18)/32; print("Temp: "+temp+"*C") // ref https://forum.digilentinc.com/topic/17333-digital-discovery-logic-dios-are-different-to-dios-from-the-patterngenerator/ } function spi_pin_io_setup() { print(" The SPI setup should be :- "); print(" "); print(" Select AD_2_DIO3 // SPI: /CS "); print(" Clock AD_2_DIO4 // SPI: Clock "); print(" DQ0 AD_2_DIO5 // SPI: MOSI "); print(" DQ1 AD_2_DIO6 // SPI: MOS0 "); } function UART_initialise() { clear(); // clear Output log // // Note Only DIO pins 0 through to 9 can be used for Protocol functions { SPI , I2C or UART} // // if(!('Protocol' in this)) throw "Please open the Protocol instrument"; Protocol.Mode.text = "UART"; // make sure UART tab is selected Protocol.UART.TX.value = 0; // Set up UART TX pin on Digilent AD2 :: DIO_0 Pin Protocol.UART.RX.value = 1; // Set up UART RX pin on Digilent AD2 :: DIO_1 Pin Protocol.UART.Bits.value=8; // Sets or gets the UART number of bits. Protocol.UART.Parity.text="None" ;// Sets or gets the parity setting: “None”, “Even”, “Odd”, “Mark (High)”, “Space (Low)”. Protocol.UART.Rate.value=9600; // Sets or gets the baud rate setting Protocol.config(); // apply configuration changes now Protocol.UART.Receiver(); // reset receiver - that is too start receiving data print(" UART Serial Bus initialised . Beware this is 3V3 Logic RS232 & Not True +/- 15V Rs232" + "\n\r" ); print(" I2C SCL connect to AD2 DIO Port " + Protocol.I2C.SCL.value + "\n\r" ) ; print(" I2C SDA connect to AD2 DIO Port " + Protocol.I2C.SCL.value + "\n\r" ) ; print("\n\r"+" I2C initialisation complete " + "\n\r" ) ; // // ref https://forum.digilentinc.com/topic/21308-ad2-protocol-uart-script-reading-vaillant-ebus/ // // https://forum.digilentinc.com/topic/21353-use-of-multiple-protocol-uart-ports-via-script-possible-at-different-times/ // // notes // ===== // // 1. On the AD and AD2 the digital IO pins use LVCMOS 3V3 standard. These are supplied at 3.3V and have 200 Ohm PTC and clamping diodes to GND and to 3.3V for protection. // It will drive the digital wires at 3.3V and connecting 5V signals directly, without series resistor, it will sink about 10mA through the PTC and 3v3 diode. // As for noise, make sure to have ground connection between the two devices. // // 2. The WF/Protocol/UART uses the Stop length option only for transmission, this is not relevant for reception. // // 3. The UART TX filed lets you type in characters, hexadecimal values are not supported here. // Special chars you can copy/paste from other place or send from file. } function UART_Test() { UART_initialise(); Protocol.UART.Receiver(); // start receiver wait(); Protocol.UART.Send("hello"); // TX wait(0.1); // 100ms wait for RX, depends on the external device and rate print(Protocol.UART.Receive()); // RX } function UART_Test_example_2() { UART_initialise(); Protocol.UART.Receiver(); // reset receiver - that is start receiving data var rx = []; while(wait(1)) { // wait 1 sec and repeat while not stopped rx = rx.concat(Protocol.UART.ReceiveArray()); // append new words while(rx.length>10) { if(rx.shift()==0xAA) continue; if (rx[1] == 0xB5 && rx[2]== 0x11 && rx[7] == 0x09) { // find the temperatures for displaying print ("Temp 1: " + (rx[8]/2).toFixed(1) + " °C Temp 2: " + (rx[9]/2).toFixed(1) + " °C"); // decimal data devided by 2 bring °Celsius } } } } function UART_Test_example_3() { UART_initialise(); Protocol.UART.Receiver(); // reset receiver - that is start receiving data // Protocol.UART.Send("Hello") ; // send text with ending var rx = Protocol.UART.Receive(); // receive text print(rx) ; // Protocol.UART.Send("Hello ", false); // send text custom ending var rx = Protocol.UART.Receive(); // receive text print(escape(rx)); // Protocol.UART.SendArray([1,2,3,4,5,0], false); // send array custom ending var rx = Protocol.UART.ReceiveArray(); // receive array print(rx); } function spi_write( address , data_to_write) { Protocol.SPI.Start(); Protocol.SPI.Write( address ,data_to_write ); // Read Register, Device ID Protocol.SPI.Stop(); wait(0.1); // wait 100 milli second before next instruction. } function spi_write_read( address , data_to_write, number_of_bytes_to_read_back) { Protocol.SPI.Start(); Protocol.SPI.Write( address ,data_to_write ); // Read Register, Device ID wait(0.1); // wait 100 milli second before reading data. var rg_data = Protocol.SPI.Read(address, number_of_bytes_to_read_back); Protocol.SPI.Stop(); wait(0.1); // wait 100 milli second before next instruction. return rg_data ; } function static_io_example() { // ref https://forum.digilentinc.com/topic/21512-how-to-energize-multiople-staticio-given-only-when-a-certain-dio-is-on/ // ref https://forum.digilentinc.com/topic/2150-staticio-scripting-documentations-for-waveforms3/ // ref https://forum.digilentinc.com/topic/18737-export-issues/ // ref https://forum.digilentinc.com/topic/18789-some-functional-problems/ clear() if(!('StaticIO' in this)) throw "Please open the StaticIO instrument"; const IO = 7; const delay = 0.3; print("Running StaticIO script"); for(var c = 0; c <= IO; c++) { StaticIO.Channel0.DIO[c].Mode.text = "Switch"; } StaticIO.run() while(wait()){ // while script not stopped if(StaticIO.Channel1.DIO8.Input.value == 1) { for(var c = 0; c <= IO; c++) { StaticIO.Channel0.DIO[c].text = "1"; StaticIO.config(); // apply changes now if(!wait(delay)) return; // exit on script stop StaticIO.Channel0.DIO[c].text = "0"; StaticIO.config(); if(!wait(delay)) return; } for(var c = IO; c > 0; c--) { StaticIO.Channel0.DIO[c-1].text = "1"; StaticIO.config(); if(!wait(delay)) return; StaticIO.Channel0.DIO[c-1].text = "0"; StaticIO.config(); if(!wait(delay)) return; } } } } function static_io_example_2() { // ref https://forum.digilentinc.com/topic/21512-how-to-energize-multiople-staticio-given-only-when-a-certain-dio-is-on/ // ref https://forum.digilentinc.com/topic/2150-staticio-scripting-documentations-for-waveforms3/ // ref https://forum.digilentinc.com/topic/18737-export-issues/ // ref https://forum.digilentinc.com/topic/18789-some-functional-problems/ clear(); if(!('StaticIO' in this)) throw "Please open the StaticIO instrument"; // 1.Probe print("Running pin 1, channel 1") StaticIO.Channel0.DIO[3].text = "0"; StaticIO.Channel0.DIO[4].text = "1"; StaticIO.Channel0.DIO[5].text = "1"; StaticIO.Channel0.DIO[0].text = "0"; StaticIO.Channel0.DIO[1].text = "0"; StaticIO.Channel0.DIO[2].text = "0"; StaticIO.config(); // force immediate configuration wait(1); // wait on external device/circuit } function static_io_example_3() { // // This is what's available on the wiki: // // .StaticIO // // .Channel#: groups of 8 signals // .Mode.text: select between: I/Os, Slider, Progress // .Input.value: input value // .DIO#: I/Os // .Input.checked: input value // .Mode.text: select between: LED, Button, Switch // .Button.text: select between: 0/1, 1/0, Z/1, 1/Z, Z/0, 0/Z // .Switch.text: select between: TS, PP, OS, OD // ref https://forum.digilentinc.com/topic/2150-staticio-scripting-documentations-for-waveforms3/ // I got the DIO13 configured as a PushPull Switch, but how do you set the actual value that you want the pin to output? // Configure Static IO StaticIO.Channel1.Mode.text = "I/Os" // Configure Red LED StaticIO.Channel1.DIO13.Mode.text = "Switch" StaticIO.Channel1.DIO13.Switch.text= "PP" } function set_static_io_pin( AD2_Dio_pin , boolean_state ) { if(!('StaticIO' in this)) throw "Please open the StaticIO instrument"; if( boolean_state == 1) { StaticIO.Channel0.DIO[AD2_Dio_pin].text = "1"; StaticIO.config() // force immediate configuration } if( boolean_state == 0) { StaticIO.Channel0.DIO[AD2_Dio_pin].text = "0"; StaticIO.config() // force immediate configuration } } function power_up_psu( Power_supply_voltage ) { //************************************************************ // Set up mini PSU inside Analogue Discovery 2 to supply 3.3V //************************************************************ if(!('Supplies' in this)) throw "Please open the Supplies tool window"; Supplies.Output.PositiveSupply.Voltage.value=Power_supply_voltage; Supplies.Output.PositiveSupply.Enable.setEnable(); Supplies.Output.NegativeSupply.Enable.setDisable(); Supplies.run(); // Turn on PSU unit inside AD2 print(" Power supply is UP VCC = " + Power_supply_voltage + "\n\r" ); wait(5); // wait 1 seocnds for system to stabilise. //*********************************************************** } function power_down_psu() { //************************************************************ // Power down mini PSU inside Analogue Discovery 2 to supply 3.3V //************************************************************ print(" PSU is powering down" ); Supplies.stop(); wait(5); // wait 5 second before reading data. Supplies.Output.PositiveSupply.Voltage.value=0.3; Supplies.Output.PositiveSupply.Enable.setEnable(); Supplies.Output.NegativeSupply.Enable.setDisable(); Supplies.run(); // Turn on PSU unit inside AD2 wait(10); // wait 10 second before reading data. Supplies.stop(); // Turn off PSU unit inside AD2 after measurment has finished. print(" PSU is powered down" ); //*********************************************************** } function PMOD_ADXL362_not_working() { //************************************************************ // Example block read ADXL362 Device ID : Start //************************************************************ clear(); // clear display screen print(" SPI Script for PMOD ACL2 3 axis accelometer with Analog devices ADXL362 running " + "\n\r "); power_up_psu( 3.3 ) ; // Power up PSU to VCC = 3v3 spi_initialise(); // set up spi bus var STATUS_reg =spi_write_read( 8, [0x0B, 0x00], 1) ; // Read ADXL362 STATUS_reg Page 23 & 25 of the ADXL362 Data sheet & read 1 words of 8 bit length print(" ADXL362 Status regiser raw data after reset = " + STATUS_reg + "\n\r" ); wait(0.01); // wait 10 milli second before reading data. var rgID = spi_write_read( 8, [0x0B, 0x00], 4) ; var Device_ok=0; if(rgID[0] != 0xAD || rgID[1] != 0x1D || rgID[2] != 0xF2){ print(" Device ID mismatch rgid(0) " + rgID[0] ); print(" Device ID mismatch rgid(1) " + rgID[1] ); print(" Device ID mismatch rgid(2) " + rgID[2] ); print(" "); print(" Is the physical SPI Bus physical wired set up correctly ?? " ); print(" "); spi_pin_io_setup(); } else { print(" Device is ADXL362 : SPI register 0x00 read { 0dxx in decimal} : " + rgID + "\n\r" ); Device_ok=1; } //********************************************************************************** // // Result shoudl be : Read: hAD, h1D, hF2, h02, // Output : 173,29,242,2 in dec --> hex --> 0xAD 0x1D 0xF2 Ox02 // //********************************************************************************* if ( Device_ok==1) { /*--------------------------------------------------------------------------------------------------------------- * * ADXSL262 SPI register setup for POWER_CTL to be permantly on without sleep * * Bit 7 Reserved 0x0 * Bit 6 External CLK =1 int=0 0x0 * Bit 5:4 Power ns Noise Trade off 0x10 = Ultra Low Noise * Bit 3 Wakeup mode 0x0 = OFF * Bit 2 Autosleep 0x0 = OFF * BIT 1:0 Measurement state 0x10 = Measurment Mode * * Resultant setting = b00 10 00 10 = 0x22 *---------------------------------------------------------------------------------------------------------------*/ spi_write( 8,[0x0A, 0x2D, 0x02] ); // Power Control Register, Measurement Mode var rg = spi_write_read( 8, [0x0B, 0x0E], 8) ; // convert data bits to signed value relative to gravitational constant // MSbit sign, LSBit 0.001g for default 2g mode var gx = (0.001* ((rg[1]<<28) | (rg[0]<<20)) /1048576).toFixed(3); var gy = (0.001* ((rg[3]<<28) | (rg[2]<<20)) /1048576).toFixed(3); var gz = (0.001* ((rg[5]<<28) | (rg[4]<<20)) /1048576).toFixed(3); var tp = (0.065* ((rg[7]<<28) | (rg[6]<<20)) /1048576).toFixed(2); print(" Raw data {16 bit data} {x,y,z,temp} = " + rg + "\n\r" ); print(" Accelerometer initial X value = " + gx ); print(" Accelerometer initial y value = " + gy); print(" Accelerometer initial z value = " + gz); print(" Accelerometer initial temp value = " + tp); } } //************************************************************ // Main program block : Start //************************************************************ clear(); // clear display screen print(" Script Main body start " + "\n\r "); power_up_psu( 3.3 ) ; // Power up PSU to VCC = 3v3 // ********************** // User code start // ********************** // ********************** // User code stop // ********************** power_down_psu(); //************************************************************ //************************************************************ // Main program block : Stop End //************************************************************ Digilent_AD2_Script_master.js
  6. I am trying to automate testing using scripting. I want to use the network and spectrum analysers which is why I am not using the SDK option. Question, If I am executing script from the command line, for example, "waveforms example.dwf3work -script example.js" Is there any way of piping the output console in waveforms to the command line so i can externally access status information. The only way in the documentation seems to be through saving of information to files. A simple example is knowing when the script is complete by printing to the command line "COMPLETE"
  7. Hello, while waiting for my hardware to arrive I play with WaveForms a bit and found some things that don't work out as they should. I use the 64bit WaveForms 3.16.17 rpm from the beta page on Fedora 27. For my tests I always started it with vanilla settings by deleting static.dwf3 1. On startup the application tells me that no device could be found and presents the "Device Manager" window, in which I select a demo device. When I select DDiscovery, sometimes (not always) a half transparent window "Opening device" stays open. This seems to not happen when I select a different device. 2. I can't select fonts in the options dialog. The application starts with Cantarell and Monospace. Regardless what I do Cantarell stays the same and the script font changes to DejaVu Sans Mono. 3. When I choose the "Dark" style in the options the digital color option also changes from default to dark. When I switch back to another style like "Fusion", the digital color stays dark. This can easily be changed manually, but 2 options changing at the same time confuses at first. Have a nice day Stefan
  8. I use WaveForms 3.17.18 on Windows 11 with Analog Discovery 2. The wave generator output (W2) is directly connected to scope input CH1. W2 is set to 123.4567 Hz Sine wave with 500 mV amplitude. I set the Scope to 1kHz and its rage to 200mV/div. I use the built-in FFT in the range of 120 - 130 Hz with the Peak(V) setting. It normally looks good but periodically I get a strange reading like this: I'm not sure what is happening here, could you help me find out? I also made a screencap of this and uploaded here: https://drive.google.com/file/d/1Bxn0S0H6SM2J9r3cXOgJ3lleH5cPN6v7/view?usp=sharing
  9. Hi, I have a small problem with I2C master tab. I am at waveforms 3.17.1 and I am trying to use the protocol tab with DD device. My intent is to read an address on a device, which is 16bits wide address. It happens that I can only read the first address 0000h. Even if I change the SubAddress to 0001h, it will still read 0000h. I made it work in the custom tab, but not in this. Is it supposed to be this way? Thanks,
  10. Hello Forum :-) I will first wish all a happy new year :-) One question is it possible to set really complex-trigger-scenarios in waveform at osciloscope? E.g. trigger fire when: Ch1 <= 20 and Ch2 == 10 E.g. trigger fire when: RisingEdge(Ch1, 20) OR FallingEdge(Ch2, 2) E.g. trigger fire when: (Ch1 + 3) == 8 E.g. trigger fire when: (Ch1 + 3) == SQRT(Ch2) E.g. trigger fire when: (Ch1 + Ch2) == (Ch3+ 10) E.g. trigger fire when: (Ch1 / Ch2) <= (Ch3 + Abs(Ch4)) ...such things (in any compexity, combinations and deepnees) I work in my company at HIL-Testing ( https://en.wikipedia.org/wiki/Hardware-in-the-loop_simulation ) For complex trigger-definitions use dSPACE-Tools ( https://www.dspace.com/en/inc/home.cfm ) and I itself in my own software-implementations the GE-Syntax which is really good for definition of flexible and complex trigger-definitions https://www.asam.net/active-projects/resources/ (view there: ASAM Expression v1.0.1 ) REMARK: This is perhaps an similar question (and wish) like here: Best regards Alfons
  11. Hi Analog Discovery 2 with impedance adapter. I am trying to use the digital I/O (as output) that are not used by the impedance adapter 0-3 and 8-11. I mainly need 4 to control a front-end multiplexer for the impedance adapter. The adapter use I/O 4-7 and 12-15 as output. As soon the Impedance measure is triggered, these I/O goes to zero. Is there a way to control them or I need to use a second Discovery 2 to control the multiplexer and found some way to operate them in sync? Thanks in advance for any suggestions.
  12. I know the likely answer is no - due to limits of and script looping in terms of window timer etc accuracy. But I'm always surprised by the capability in this thing. But any simple way to do a PI loop closure ? Like measure on CH1 and CH2 and command? It can certainly do "seconds" for things like temp control but I'm looking for less than 10 ms delay lag.
  13. Hello, I'm using a Digital Discovery with Waveforms 2.16.40 in Logic mode and I want to make a longer scan at a low rate using the full 256 Mi sample space by limiting the inputs to 8. But when I zoom in to reaquire a higher resolution detail view the sample rate goes up to 800 MHz. Maybe it makes sense to add an option to limit the maximum rate. From your company view this could be a checkbutton in device configuration "High speed adapter" yes/no. With which you set the maximum to 200 MHz when no, even in "800MHzx8" mode. From a user point of view this could be a number entry or selector where the user can say "That's the maximum rate I get valid results for in my current setup".
  14. Dear Attila Please find enclosed the following . This took more than 4 hours to prepare all the documentation please treat as such. I am using the latest version of Digilent Waveforms and the latest Waveforms SDK. - Master Javascript driver for Digilent Analogue Discover AD2 which can be used inside Waveforms - SPI Setup , read & write & Initialise (1) . Status NOT Working . Needs Digilent Help to fix (%%) - I2C Setup , read & write & Initialise (2) . Status NOT Working . Needs Digilent Help to fix - UART Setup , read & write & Initialise(3) . ** - GPIO Setup, Set individual GPIO Pin Output States (4) Working - PSU Control, Set PSU voltage , turn on and off (5) Working - Python driver directly to control ON-SEMI CAT9532 using Digilent Analogue Discover AD2 & Digilent Waveforms ## Enclosed are all the attached scripts . ** Mostly likely works as driver details taken from working examples . See driver for while for web links reference. (%%) See previous efforts here to get it working &nbsp; &nbsp;https://forum.digilentinc.com/topic/21997-waveforms-with-accelerometer-digilent-analog-discovery-2-with-pmod-acl2-java-script-spi/#comment-63633 https://forum.digilentinc.com/topic/19237-waveforms-with-accelerometer/page/2/#comment-52495 I am trying to get the I2C driver function of the AD2 to work to drive a ON-SEMI CAT9532 LED driver. Set up , I have two Digilent Analogue Discover AD2 - Device 1 : Digilent AD2 (Device A) I2C driver source . A) Device is programed using Digilent Waveforms Javascript B) Direct control though Digilent Waveforms I2C Master interface C) Direct control though Digilent Waveforms I2C Master script interface D) Direct control Waveforms SDK & Python - Device 2 : Dilenet AD2 (Device B) as I2C spy device - Device 3 : TotalPhase Advark I2C/SPI professional I2C development tool Direct control & Programming by XML program script. https://www.totalphase.com/products/aardvark-i2cspi/ I own (2) two Analogue Discovery devices. What worked Device 2 : It could work perfectly as a I2C spy mode device Device 3: Worked perfectly straight out of the box using the GUI interface. Took 20 mins to have working solution. This is professional I2C product that has been in the market for 10 years plus. What failed Device 1: Did not output the correct I2C packet no mater how it was programmed. Device 1 : Had 10K pull up resistor attached to the VCC 3V3 rail on the I2C: SDA & I2C:SCL & I2C:/RESET. Conclusion There seems to be general issue with the AD2 and getting it to work as driver for I2C and SPI . Which is a long term issue. I have spent a long time searching for all the small details to build up the driver set so that should work with Digilent Analogue Discover AD2 & Digilent Waveforms but if the hardware of the AD2 is not co-operative or the staff in Digilent not being supportive there is only so much I can do . Requested Help 1. Fix the Waveforms AD2 Javascript and Python Waveforms SDK so it works for SPI & I2C . There is something missing here, where it would be good to fix to improved your AD2 products for the whole community of AD2 users 2. Have a Digilent published AD2 drivers that work for SPI & I2C & UART & GPIO & PSU control for waveforms and waveforms SDK. So Attila the case is in your lap now .. Please put some effort in to fix it or show me how to fix it . I have the feeling your quite a skilled person. The result should be posted here as a product example : https://projects.digilentinc.com/products/waveforms?sort=updated Background I am a electronic engineer with 20+ years development experience , I have have successfully used Digilent AD2 to design 3 products end to end and have been using it for quite a few years. I can program in Python , Microsoft VB.net and Javascript. I have personally purchased two pieces of AD2 out of my own money as feel they are such a good tool. I am committed to using the AD2 as I can see and experience that it is a super swiss army knife for use in a development of embedded electronics. I have also purchased a full profesional copy of National instruments Labview for use with AD2 but , have suspended learning to use labview until this I2C & SPI issue is resolved with the AD2 Digilent_AD2_Script_I2C_control_of_on-semi_CAT9532.py Digilent_AD2_Script_I2C_control_of_on-semi_CAT9532.js Digilent_AD2_Script_I2C_control_of_on-semi_CAT9532.dwf3work Digilent_AD2_Script_master.js
  15. Hello Friends, I am using Waveforms ver 3.14.3 with the Analog Discovery 2. I would like to create a custom measurement that utilizes the frequency value in the defined frequency measurement. How can I refer to this value in script? The original plan was to copy and modify the script in the defined frequency measurement but when I open the Modify window only a comment is present in the script.
  16. Hello, I'm doing my first steps with Waveforms and a Digital Discovery and found a curious situation where single data lines where out of sync depending on zoom. Have a look at the screenshots to see that I configured a 10 second record of various data. The record has been stopped manually. If you look at the first screenshot the Serial Out and its related Data line are askew. When I zoom in a bit via mousewheel they are in sync. This effect does not occur after I saved and reloaded the data.
  17. The actual beta version of Waveforms is 3.16.35, but the last one featuring a Linux rpm is 3.16.17. Overall these betas are released as a wild mixture sometimes with only the Windows version. Why is that so? I would like to testdrive, but need rpm. Thanks
  18. Hi With the waveforms tool is it possible using python scripting in the Waveforms platform to do the following ?? Use the Digilent Analogue discovery 2 - Attach a device like a PMOD device eg accelerometer https://store.digilentinc.com/pmod-acl-3-axis-accelerometer/ using the Analogue discovery 2 ability to chat SPI & IC2 - pmod DEVICES SUPPORT 12-pin Pmod connector with SPI interface and 2×4-pin I²C interface - Then using the read information from the PMOD device treat it like an extra oscilloscope channel . Either as a Analog channel or Digital channel depending on the the signal type acquired from the PMOD device. This is possible with Labview but that would also require a lot of code writing. If this is possible this is outstanding feature when considering all the available PMOD devices available from the list https://store.digilentinc.com/by-function/input/ This would be a real product enhancement for Digilent and the Analog Discovery and help sell the AD2 in to many new places . Best wishes Simon
  19. Hi, while measuring the I-V characteristic of a two-terminal current source with my Analog Discovery 2, I noticed the vertical position of the trace in the x-y plot is not quite correct. In the following screen capture, CH1 (yellow) is the voltage across the source plus a current measurement (shunt) resistor, and CH2 (blue) is the voltage across the shunt resistor. The x-y plot on the right looks fine on this vertical scale. For example, the CH2 peak is 300 mV in both plots. When I zoom CH2's vertical scale to more closely examine the difference between the rising and falling halves of the triangle wave, the trace in the x-y plot appears to be too low relative to the x-y plot's graticule. For example, CH2 peaks around 299 mV in the normal y-t trace on the left, but in the x-y plot on the right that peak is low by about 0.3 mV. Exported data and the cursor suggest the zoomed y-t plot is good, so I'm thinking the calculation for where points go on a vertically zoomed x-y plot is not quite right. Is this something you can look into? Note this concern is not about the two vertical graticules on the left and right being slightly misaligned. While it would be nice if the two graticules were aligned, my concern is that reading CH2 values off the x-y plot on the right gives me some (slightly) wrong numbers. Thanks! I'm still having a blast with the AD2. Have a great day.
  20. I am trying to read 16bit integers sent to an Analog Discovery 2 over UART using the Protocol section in waveforms. The integers are sent in two bytes, 8 bit high byte then 8 bit low byte. When I set the RX to binary and the bits to 8, I can receive all the bytes correctly. When I set it to receive 16 bits, then errors occur because I am sending the data as two 8 bit messages. I want to be able to set RX to decimal and have the Protocol correctly convert two 8 bit transmissions to a single 16 bit decimal integer. Is this possible? Note: I cannot send a full 16 bit message, my microcontroller registers are limited to sending 8 bits at a time. I only want to do this so that I do not have to manually change the pairs of 8 bit values into 16 bit decimals. Example: Correct values in decimal: 2 64 128 2048 RX Binary, 8 bit: 00000000 00000010 00000000 01000000 00000000 10000000 00001000 00000000 RX Binary, 16 bit: 0000100100000000 0000000100000000 0000010000000001 0000000100001000 RX Decimal, 8 bit: 0 0 2 0 64 0 128 8 0 RX Decimal, 16 bit: 0 2304 256 1025 264
  21. The oscilloscope channel signals don't stay aligned with the cursors, grid, and reference waveforms when zoomed out. The image "zoomed_in.png" has a signal (yellow), a reference waveform created from that signal (green), and two cursors. The signal and reference waveform are perfectly overlapping as expected. This is at 1ms/div. When I zoom out one step to 2ms/div, the signal becomes misaligned with respect to the reference and the cursors. In the third image, "badly_aligned.png", I have a capture of a periodic signal. I zoomed in on two of the pulses and placed the cursors in the middle of the pulses. When I zoom out, the cursors no longer look like they match up with pulses. Also notice that the cursor on the right appears farther away from the pulse than does the cursor on the left. The misalignment seems to be more of an issue toward the end of the full capture than at the beginning. This is an issue with both 3.16.3 and beta_3.16.23. I'm using Ubuntu 20.04.
  22. I'm not sure if this is the right place to report what I think is a bug in waveforms. I'm using version 3.16.3 64-bit on windows 10. I was having difficulty using averaging in the scope timebase controls to eliminate some noise. When I click on 'single' acquisition, the scope appears to trigger the appropriate number of times (e.g., 100) before displaying a new trace. But the noise is not reduced, as if the scope is showing me just the trace from the first (or maybe the last) trigger. Clicking on 'run' similarly counts the appropriate number of triggers and then displays a new trace, but with the expected noise reduction from averaging. I can then click on 'stop' to export the averaged traces, so I'm not stuck. Hopefully this is easy to fix in subsequent versions of waveforms, so that a 'single' acquisition does the requested averaging. I am otherwise having a great time so far with waveforms and my analog discovery 2. Thanks!
  23. During device opening internal chips are enabled and configured. This results in consumption increases, specially when the 100 MHz clock (PLL) is started. The needed current increases from 100mA to 500mA. In case the USB can't provide enough current the voltage drops below the minimal required for the device to operate and communication fails. In case you get “Device configuration failed (PLL 1)" or "Communication with the device failed.” error message: The device needs at least 2W/400mA from USB cable. To satisfy this: - Try to use different USB cable and computer plug. - Use the USB plug on the back of the PC, not the one on the front panel. - Use short cable, do not use long cable or cable extender. - Use powered USB-hub, avoid un-powered hub. - Use USB-Y cable to load power from two plugs. Device not detected by WaveForms: Open Windows Device Manager then connect the device and wait up to one minute for a device to appear: - USB Serial Converter, with warning - Connect the device directly to the computer's USB plug without using external hub. - Restart the computer. - Reinstall WaveForms, including the Adept Runtime section. - USB Serial Converter, without warning - Restart the computer. - Reinstall WaveForms, including the Adept Runtime section. - Other application might have erased the USB controller EEPROM (FT_Prog, programming cable drivers...) Use the "My device is not listed" button in WaveForms application Device Manager to reprogram the EEPROM. - Unknown Device Check the Hardware IDs under device Properties, Details tab - USBVID_0403&PID_6014 The USB driver is not installed. - Restart the computer. - Reinstall WaveForms, including the Adept Runtime section. - USBVID_0000&PID_0000 Device not identified or malfunction. See "Nothing shows up". - Nothing shows up: - Connect the device directly to the computer's USB plug without using external hub. - Try to use different USB cable and computer plug. The device or its plug might be damaged.
  24. Hi, I'm running into an issue when using Python3 with Analog Discovery 2 on Ubuntu 20.04 LTS box. Platform: AD2 on Ubuntu 20.04 LTS. Here is a dump for a small 'enumerate' script used to identify the device and software, let me know if you need anything else. FTDI Version: 0x10408 Devices: 1 1: SN: b'210321A36017' : b'Digilent USB Device' Flags: 0x2 Type: 0x8 ID: 0x4036014 Loc ID: 0x10c DMGR Version: b'2.9.3' Devices: 1 1: SN: b'SN:210321A36017' : b'Analog Discovery 2' PDID: 0x40300360 DWF Version: b'3.14.3' Devices: 1 1: SN: b'SN:210321A36017' : b'Analog Discovery 2' Goal: I am using the AD2 to interface with an IMU. The IMU has a 'Data Ready' signal. The desired outcome would be that I can initiate a SPI read when the 'Data Ready' signal goes low. Perhaps this isn't the right way to do this but I configured the logic analyzer tool to tell me when the 'Data Ready' line goes low. To exercise this I use the pattern generate to toggle a pin and then trigger off of that signal in the logic analyzer, much like the example script does. Problem: If I perform the steps above (configure and run a pattern generator with a toggling waveform and use the logic analyzer to capture it) everything works fine and I get a status of '2' (Done) If I then configure the SPI tool, specifically the chip select signal, the logic analyzer doesn't work anymore, I keep getting a status of '1' (Arm) after the SPI device is running. Here is the output I get >$ ./digital_in_strange_test.py Opening first device Waiting for acquisition... Status: 2 done Configuring SPI Device Waiting for acquisition... Status: 1 Status: 1 Status: 1 Status: 1 Error I've played around with it for a bit but I haven't figured it out, sometimes instead of showing state '1' (Arm) it shows state '3' (Trig). I'm not sure but I think this might happen when I actually toggle the select signal. Here is the script that will demonstrate the issue: #! /usr/bin/env python3 from ctypes import * from dwfconstants import * import math import sys import time import numpy if sys.platform.startswith("win"): dwf = cdll.LoadLibrary("dwf.dll") elif sys.platform.startswith("darwin"): dwf = cdll.LoadLibrary("/Library/Frameworks/dwf.framework/dwf") else: dwf = cdll.LoadLibrary("libdwf.so") hdwf = c_int() sts = c_byte() print("Opening first device") #dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf)) # device configuration of index 3 (4th) for Analog Discovery has 16kS digital-in/out buffer TEST_OUT = 7 if __name__ == "__main__": #dwf.FDwfDeviceConfigOpen(c_int(-1), c_int(3), byref(hdwf)) dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf)) if hdwf.value == 0: print("failed to open device") szerr = create_string_buffer(512) dwf.FDwfGetLastErrorMsg(szerr) print(str(szerr.value)) quit() ''' Use the Pattern Generator to toggle pin 7''' # generate counter dwf.FDwfDigitalOutEnableSet(hdwf, c_int(TEST_OUT), c_int(1)) dwf.FDwfDigitalOutDividerSet(hdwf, c_int(TEST_OUT), c_int(1<<2)) dwf.FDwfDigitalOutCounterSet(hdwf, c_int(TEST_OUT), c_int(1), c_int(1)) dwf.FDwfDigitalOutConfigure(hdwf, c_int(1)) ''' Configure the Logic Analyzer to capture Pin 7''' cSamples = 8 rgbSamples = (c_ubyte*cSamples)() dwf.FDwfDigitalInReset(hdwf) dwf.FDwfDigitalInInputOrderSet(hdwf, c_int(1)) # with 8 bits DIO-0:7 dwf.FDwfDigitalInSampleFormatSet(hdwf, c_int(8)) # set number of sample to acquire dwf.FDwfDigitalInBufferSizeSet(hdwf, c_int(cSamples)) dwf.FDwfDigitalInTriggerSourceSet(hdwf, c_ubyte(3)) # trigsrcDetectorDigitalIn #dwf.FDwfDigitalInTriggerSourceSet(hdwf, trigsrcDetectorDigitalIn) #dwf.FDwfDigitalInTriggerPositionSet(hdwf, c_int(int(cSamples/2-1))) dwf.FDwfDigitalInTriggerPositionSet(hdwf, c_int(0)) dwf.FDwfDigitalInTriggerSet(hdwf, c_int(0), c_int(0), c_int(1<<TEST_OUT), c_int(0)) # DIO7 falling edge # begin acquisition dwf.FDwfDigitalInConfigure(hdwf, c_bool(0), c_bool(1)) print("Waiting for acquisition...") count = 0 while count < 4: dwf.FDwfDigitalInStatus(hdwf, c_int(1), byref(sts)) print("Status:", str(sts.value)) if sts.value == 2 : # done break time.sleep(1) count += 1 if sts.value != 2: print ("Error") else: print(" done") ''' Enable SPI Device ''' print ("Configuring SPI Device") SPI_FREQ = 1e6 #SPI_FREQ = 1e3 SPI_SEL = 1 SPI_SCLK = 0 SPI_MOSI = 3 SPI_MISO = 2 SPI_MODE = 3 SPI_MSB_FIRST = 1 dwf.FDwfDigitalSpiReset(hdwf) dwf.FDwfDigitalSpiFrequencySet(hdwf, c_double(SPI_FREQ)) dwf.FDwfDigitalSpiClockSet(hdwf, c_int(SPI_SCLK)) dwf.FDwfDigitalSpiDataSet(hdwf, c_int(0), c_int(SPI_MOSI)) # 0 DQ0_MOSI_SISO = DIO-2 (SPI_MOSI) dwf.FDwfDigitalSpiDataSet(hdwf, c_int(1), c_int(SPI_MISO)) # 1 DQ1_MISO = DIO-3 (SPI_MISO) dwf.FDwfDigitalSpiIdleSet(hdwf, c_int(2), c_int(3)) # 0 DQ0_MOSI_SISO = DwfDigitalOutIdleZet dwf.FDwfDigitalSpiIdleSet(hdwf, c_int(3), c_int(3)) # 1 DQ1_MISO = DwfDigitalOutIdleZet dwf.FDwfDigitalSpiModeSet(hdwf, c_int(SPI_MODE)) dwf.FDwfDigitalSpiOrderSet(hdwf, c_int(SPI_MSB_FIRST)) # 1 MSB first dwf.FDwfDigitalSpiSelect(hdwf, c_int(SPI_SEL), c_int(1)) # CS DIO-1 high (SPI_SEL) # begin acquisition dwf.FDwfDigitalInConfigure(hdwf, c_bool(0), c_bool(1)) print("Waiting for acquisition...") count = 0 while count < 4: dwf.FDwfDigitalInStatus(hdwf, c_int(1), byref(sts)) print("Status:", str(sts.value)) if sts.value == 2 : # done break time.sleep(1) count += 1 if sts.value != 2: print ("Error") else: print(" done") dwf.FDwfDeviceCloseAll() Perhaps I'm missing something. Thanks for any help. Dave
  25. josif

    Prof.

    Hallo Atilla, I find the possibility to use a low cost USB sound card with WaveForms for some simple student experiments at home, during this pandemic, very engaging for the students. Unfortunately those sound cards have only one input channel and cannot display time delays or phase shifts. I was thinking if there is a possibility to add cross-triggering between the generator (sound card output) and the oscilloscope (sound card input), it would provide them additional insight into circuit behaviour. Thank you, J.Kjosev
×
×
  • Create New...