Search the Community

Showing results for tags 'matlab'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • New Users Introduction
    • Announcements
  • Digilent Technical Forums
    • FPGA
    • Digilent Microcontroller Boards
    • Non-Digilent Microcontrollers
    • Add-on Boards
    • Scopes & Instruments and the WaveForms software
    • LabVIEW
    • FRC
    • Other
  • General Discussion
    • Project Vault
    • Learn
    • Suggestions & Feedback
    • Buy, Sell, Trade
    • Sales Questions
    • Off Topic
    • Educators
    • Technical Based Off-Topic Discussions


  • Community Calendar

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 26 results

  1. Hi all, Maybe it's just a small detail that is missing but I don't know how to solve it exactly. I’m trying to communicate my laptop with my ZedBoard but for some reason, it suddenly stops. I follow the procedure indicated in instructions included with the ZedBoard package and are also indicated in this tutorial. I download the USB to UART adapter driver (controller version by Cypress which controls the USB serial port (in this case COM9). The device is identified as Cypress-USB2UART-Ver1.0G. The settings form COM9 are like the figures. When I turn on the ZedBoard with the SD Card boot configuration, my laptop detects the new device, the green power led turns on (LD13), a few seconds later the DONE blue led turns on (LD12) and the MI07 led turns on (LD9) but later it turns off and at the end the LD11 flicker for a few second. In the TeraTerm terminal appears the instructions and commands which indicates that the booting starts but it stops at line [ 1.130000] (see image). I tried to start the communication independently through Matlab using the command: hdlsetuptoolpath('ToolName', 'Xilinx Vivado', 'Toolpath', 'D:\Vivado\2019.1\bin\vivado.bat'); And next, to communicate with the ZedBoard I used the instruction z = zynq which show the following error message: -------- Error using codertarget.zynq.internal.LinuxShell/setupZynqHardware (line 574) Cannot connect to "Zynq hardware". Details: Could not connect to the hardware over Serial Port. Check that USB cable is plugged into 'USB-to-UART' port of the hardware and the power switch is turned on. If this error persists, switch off the hardware, wait for 10 seconds, switch on the hardware and then repeat this step. Error in codertarget.zynq.internal.LinuxShell (line 212) obj.setupZynqHardware(username,password,remotedir); Error in zynq (line 113) h = codertarget.zynq.internal.LinuxShell('ZC702', varargin{:}); --------- I really don’t know what exactly is going on, the error indicates that’s probably a driver issue, but I checked the drivers and it seems that all was installed correctly, and they are the proper versions. Maybe, the problem could be from the SD card files, which are back-up files that I downloaded from the Digilen webpage additional resources in the zip file named “”. How we can check if the SD card files are ok? If the problem is in the drivers so, what is the proper driver version which works in this case? I’m using Windows 10, 64 bits, processor x64, with Matlab R2019b and Vivado 2019.1 For Matlab with FPGA applications, I have the following toolboxes: Embedded Coder, HDL Coder, and HDL Verifier. Please I really need help with this issue, I cannot finish my project if I cannot communicate with the card with the UART. --Eduardo
  2. I'm a newbie here and I’m working on a inverter test bench project where I have two three-phase inverters connected through an inductive load. The idea is to emulate in real time the behave of an electrical machine. To be clearer, the first inverter is going to be tested (Device Under Test) and the second one plus the inductive load must behave like an electrical machine. To do so, we are going to use a FPGA board, which must have the following specifications: - Capable to drive both inverters switching at 50kHz (each inverter has 6 MOSFETs switching at this frequency) - 20 digital I/O - 4 ADC with 16 bits (ideally) and 20MHz at least. The ADCs can be integrated or not in the FPGA board - Capable to communicate in real time with Matlab/Simulink - The board will be placed inside the test bench, in a temperature around 50°C We know that we are going to use Vivado to the VHDL coding, but we are not sure about the ADCs, regarding the Eclypse Z7 with the two Zmod ADCs. We want to code the least possible in VHDL (no VHDL coding if possible), so my questions are: 1) Are we going to have to code the ADC data acquisition? 2) Is the VHDL code generation done automatically by Matlab? I do have the toolbox for HDL coding. Our budget is around €1000,00. I would like to know if the board Eclypse Z7 with the two Zmod ADCs is a good choice for the application and if you have another advices it would be highly appreciated. I hope I made myself clear. Thank you!
  3. Is it possible to control the power supply and set the voltage of the positive and negative respectively? The aquisition toolbox of matlab (2019a) doesn't allow the possibility of controlling the power supply. The closets solution seems to be to use a h-file library from the SDK (see below). However the header of the h-file (dwf.h) says "This spans all 4 main instruments supported by the WaveForms system: Analog In, Analog Out, Analog I/O, and Digital I/O", the text doesn't leave any information about that the supply can be controlles as well. Further, looking through the functions in the h-file, it doesn't seem to be possible either - or have I missed a line? So the questions remains: how to control the power supply of the analog discovery 2? /Henrik Link to discription regarding using h-files from Matlab:
  4. Dear all, I'm using Vivado 2018.3 and a Zybo Z7010 board. I have finally finished my project (I actually owe this forum much), and I am now trying to use the board without having to open nor Vivado neither the SDK. Basically, I know that I can program the QSPI flash memory of the board so that the program can run without having to upload it. How this works is still unclear, is switching from JTAG to QSPI enough or should I do something on Vivado? However, I am also using the Zynq processor which runs an application that I start from the SDK. Can I avoid opening the SDK? The better thing would be if I could programm the FPGA through Matlab but I don't know if this is possible. Could you point me to some tutorials or the matlab functions (if they exist...). Thank you very much, NotMyCupOfTea
  5. Hello everyone! I'm Harri, an EE Master's student. Me and my team are currently working on assignments for three different courses around the topics of FreeRTOS, digital filtering and hardware-in-the-loop with MATLAB and Simulink. We are using the Zybo Z7-10 board and Vivado/SDK v.2018.2. In the first project, we are trying to use the Xilinx port of FreeRTOS to run a control engineering state-space-model on the ARM side. The vision is to have the model, which is a DC-converter, run at 10 kHz and the output of the model is shown as PWM to the onboard RGB LED. The project should also have a menu system via UART/Ethernet or by buttons and switches. These should be mutually exclusive, so when one input method is in use, the other will be blocked. We are kind of puzzled with this one, because our initial plan was to enable interrupts for GPIO and UART and then have those either take a semaphore from the ISR or send a struct to a queue from ISR. So far using the xscugic and registering the interrupts has been a huge puzzle for us and the workflow around this is unclear to us. We have managed to get task notifications to work from button press to periodic task, but trying anything more than that e.g. queues seems to not work. Any help on these topics would be highly appreciated! The other two project are on digital filtering. We are simply trying to run some simple audio effects on the music from LINE/MIC IN -> OUR FILTER -> HPHOUT. We have used this example as a starting point and got that to work. Now we would like to remove the DMA part and just add our filtering IP in the middle. The PS side and buttons would be used for simple visuals for amplitude on LEDs or enable/disable certain effects inside the block. Any guidance on this one? We have already read the audio codec manual/register map, but we are missing something. Also, if someone has experience with Mathworks MATLAB and Simulink and this Zybo Z7-10 board, that would be awesome, as the other project is actually more focused on the filter design part and not FPGA stuff. Also, our professor would be glad to have this kind of HIL setup demoed: We have tried following the setup guide for that one, but we are tripping at the point of connecting to the board and running the simulation. The SD card setup also is not well explained. I'm hoping to get help, ideas and inspiration from here! I'll be glad to also share the projects when they're done. Cheers, Harri
  6. I am kind of new on electronics. I am trying to set a trigger connection to analog discovery 2(AD2) from matlab. Since matlab has a supporting package of AD2 for data acquisition tool, I tried to set a trigger with the function addTriggerConnection() but i got the message You cannot use "addTriggerConnection" with Digilent hardware. Is there any other suggestions on how to trigger data Recording from matlab data acquisition tool for AD2.
  7. Hey there I'm thinking about to get a AD2 for my project and I want to make sure, if everything will be working fine. I want to achive a closed loop with the AD2. I want to set a PWM to control a motor though the Matlab Data Acquisition Toolbox and check simultaneously the pulse signals of the hall sensor with the ADC. Is this possible? The ADC should work with 10Ms/s to get the data. The PWM will be around 20KHz Square/Sinus output. Thanks in advance
  8. Hi, I'am currently using my AD2 in Matlab 2018b and altough I'm capable of using some functionalities (the ADCs, for ex), I couldn't find a way of setting the power supply. Which, by the way, is doable in Waveforms. Does anyone know how can I set the DC power supply from Matlab? Thank you in advance for your time!
  9. Hello For a project I have to analyze two analog signals at a frequency of 78.4 kHz. Sampling rate must be at least 1 MHz. I have a Analog Discovery 2, I generate for now a signal square of 100kHz. I can observe this signal but only on a few periods. I wish I could get them back on a spreadsheet excel in order to treat them with Matlab. I can get a spreadsheet excel, but only with 8000 values, or I would need 1M values. Is it possible with a Analog Discovery 2 ?
  10. I wish to use the Analog Discovery 2 as a power supply for a set up which will involve variable currents through a helmholtz coil configuration in order to model the Upper Atmosphere's Magnetic Field. I will be running a real time model in Simulink that will contain values of the magnetic field in several directions. I have the coils set up so that a known current, and thus voltage, should be able to create the magnetic field in the center, which will be detected by a magnetometer. I would like to send the Simulink values to the Analog discovery to alter the voltage output of the Analog Discovery accordingly so that the current in the coil setup can vary in real time, thus spoofing the magnetic field for the magnetometer. Is this something that is possible with the Analog Discovery 2.
  11. The MatLab DAQ toolbox support for Analog Discovery offers limited functionality, but the underlying WaveForms SDK functions can be accessed too. For manual and examples in Python and C++ see the SDK located in the default Windows installation path: - 32bit C:Program FilesDigilentWaveFormsSDK - 64bit C:Program Files (x86)DigilentWaveFormsSDK function DWFtest(); % 32 bit system %hfile = 'C:Program FilesDigilentWaveFormsSDKincdwf.h'; %64 bit system hfile = 'C:Program Files (x86)DigilentWaveFormsSDKincdwf.h'; display(['Set variable hfile: ' hfile]); if ~libisloaded('dwf') loadlibrary('dwf', hfile); end islibloaded = libisloaded('dwf'); fprintf('Check if dwf library is loaded: islibloaded = %dn',islibloaded) % This is necessary to get the character strings pBuffer = libpointer('int8Ptr',zeros(32,1)); calllib('dwf','FDwfGetVersion',pBuffer); display(['Version: ' char(pBuffer.Value')]); %Just opening and making sure the device is in a known state phdwf = libpointer('int32Ptr',0); calllib('dwf','FDwfDeviceOpen',-1,phdwf); display(['FDwfDeviceOpen returned: ' num2str(phdwf.Value)]) % Close device and unload library if phdwf.Value > 0 calllib('dwf','FDwfDeviceCloseAll'); end unloadlibrary('dwf') end
  12. It is my understanding that the dual processor in a ZYBO board can be used in parallel, each with their own code. I have a project where I need to run two parallel tasks, one of which was developed in SDK and the other in MATLAB using Embedded Coder. I know how to target a specific processor using Vivado/SDK, however, when using Embedded Coder in MATLAB this is more difficult to achieve and I haven't found a way to do it yet (i.e. I can upload my code onto the board but there's no indication of which processor it is using). Therefore, I was wondering if there is any way I can check the contents of the board using Vivado or SDK. Is there a way I can check which files the board is using and where these are being used? Alternatively, if anyone has any experience with MATLAB's Embedded Coder, could you let me know which generated files I could manually import into SDK to finish my application there? Many thanks.
  13. Hi, I have been working on system generator Matlab r2017a. I have encountered a problem. I couldn't find the boards in hardware co-simulation.I need boards files to add. Can anyone help? Where can i find the files? Regards, Chandu
  14. Some questions about Matlab compatibility with Analog Discovery Module before I make a purchase. First, is the Analog Discovery hardware version 2 driver the same as version 1? Matlab tech rep says there is no listing for version 2. I want to make sure which versions are supported by matlab. Second, besides typical DAQ features, can Matlab control the digital I/O and the power supplies? I'm wondering if all the features of Analog Discover are supported by Matlab DAQ toolbox and Simulink? Thanks
  15. Hello All, I see that the data acquisition toolkit( MATLAB ) supports the original Discovery module. Has anyone tried the Discovery 2 with Matlab ? I am debating weather or not to get the toolkit. Thanks !
  16. Hello. I have to adjust the speed (baud), parity bit (if I want), stop bit. For both software alike. I would like to know if anyone has that code in VHDL / VERILOG ? (UART/JTAG)
  17. I hear you may be working on at Matlab interface for the AD2 but in the meantime it seems it would be possible to use the API in the SDK to talk to the AD2 directly. I am somewhat new to this and can see two ways to go. One would be to use VISA which Matlab supports through the instrument control toolbox. However when I install NI VISA I can't detect the AD2 so maybe it isn't VISA compatible? Am I missing something here? Another way would be to use the included Python scripts and call Python from Matlab ( This seems a little clunkier. Of course this is a waste of time if you are coming out with Matlab support for the AD2 in the near future. If not any advice on the best way to proceed would be appreciated.
  18. Hello, I have created a TCP server on Xilinx Zynq 7000 Zedboard and TCP client on MATLAB on host computer. Zedboard and the host computer are connected through the Ethernet. The client requests the connection to the server, SYN, SYNACK and ACK packets are delivered successfully and the connection is established. (Packets are monitored on wireshark on the host computer). Now, If the client keeps sending the data continuously to the server, then server receives the data and process them. BUT the server crashes if I take some time interval in sending the data. For example: If I send data from client to server at time 0, and I take a gap of 60 seconds and then try to send the data from client to server, then by this time the TCP server has crashed and it does not receive data.If I keep sending data continuously then it does not crash, but if I take some time sending the next data, then TCP crashes. can anyone suggest where I am going wrong I have been looking over the Internet to find solutions but any help/suggestions would be appreciated.Thanks
  19. Dear, Hello, I've considered using Analog Discovery for 100MHz ( >20MHz) ADC. I have some questions about it. I found some discussion that Matlab does not provide connection to Analog Discovery 2. Have you ever used Matlab Data Acquisition Toolbox to connect Analog Discovery 2? I wonder if the data acquisition toolbox only support Analog Discovery (old version). I have one more question. I'd like to measure 4 channels simultaneously. Can I use two Analog Discovery modules simultaneously? and is it able to run two S/W to handle two Analog Discovery modules at the same time? I appreciate if you give some idea for 4 ch. measurements using Analog Discovery.
  20. I am trying to control the analog discovery 1 with MatLab commands for the project that i am on. We can control everything except the +-5v power supply. We need it to power an op-amp we have in the circuit. Does anyone know the MatLab command to turn on the Power Supply in the Analog Discovery?
  21. Good afternoon everyone, I am working on a project to connect the Zedboard and FMCOMMS2 using the HDL workflow advisor. What I want to do is to have the Zynq FPGA (PL, not the processor) generate samples of a sine wave and send these to the RF for transmission FMCOMMS2, and to have this system operating stand-alone, without any further connection to the PC running Simulink. It seems to me that, the way I have the project set up, I need to keep Simulink connected to the board, even if it is not doing any processing. If I disconnect the ZedBoard from the PC, I get an error message on the PC. By "disconnect", I mean literally unplugging the Ethernet cable from the PC's port. The error message specifies that "a runtime error occurred in the System Object 'comm.internal.SDRTxZedBoardFMC234SL', while executing the 'stepImpl' method" . I would also like to know if it's possible to save the generated bitstream into a bootable image, so that I whenever I turn the board on, I get the desired functionality. I have followed the instructions in the PicoZed SDR SpeedWay 2015 Training but it doesn' work. I have attached a Word document with more details about how I have my project set up; also, the project folder with all the files. I'd be grateful if you could take a look at it and see if I'm doing everything correctly. Word document: and FMCOMMS2.docx?dl=0 Project files: Thanks for your help, Romel
  22. Hi I want to record approx 50-1000 us long square wave signals from a separate waveform generator with Analog Discovery (Portable Analog Circuit Design Kit) via Matlab. The official Matlab code for recording with an Analog Discovery does not work ( Instead, the program is continuously busy when executing startForeground(s) and does not produce results. The official Matlab code for waveform generation and acquisition at the same time ( ) works but allows only for a lower sample rate and takes too long to start measuring for my experiment. Which is why I would prefer to only record rather than outputting zero and recording the actual target signal simultaneously. My Matlab code is s = daq.createSession('digilent'); ch = s.addAnalogInputChannel('ad1', 1, 'Voltage'); s.Rate = 1e6; s.Channels.Range = [-2.5 2.5]; s.DurationInSeconds = 2; [data, timestamps, triggerTime] = startForeground(s); figure plot(timestamps, data); xlabel('Time (seconds)') ylabel('Voltage (Volts)') title(['Clocked Data Triggered on: ' datestr(triggerTime)]) Additional Info: I use the 1+ and 1- pins of the Analog Discovery, the support package Digilent Analog Discovery 15.2.0 is installed, MATLAB version R2015b.
  23. Francesco

    Matlab files

    Hello, I am working on preparing Labs for my Circuit class using Digilent Analog Discovery (Real Analog - Circuits 1) and I have a question about MATLAB files. In a few labs, he mentions about required MATLAB files in order to complete the lab. For example, in Lab 12.4.1, this is the line that I have copied from the PDF document: "The calculations are simple, but rather tedious. The MATLAB m-file associated with this lab can be used to streamline these calculations. Run the m-file and input the appropriate resistance values when prompted. Assume that the inductor resistance is zero for the pre-lab calculations." Could you please help me find out where the MATLAB files are? Thanks! Kind Regards, Francesco Madaro, Ph.D.
  24. I would like to use the Analog Discovery via the MATLAB DAQ interface. I would like to output a custom signal to both AWG1 and AWG2 simultaneously. I am able to produce a signal on a single channel using the following code (where output1 is an array of 0s or 3.3s to produce a square wave). When I monitor this at the headphone jack I receive a frequency sweep in my right ear. s=daq.createSession('digilent') ; ch=s.addAnalogOutputChannel('AD1',1,'Voltage'); s.Rate=100e3; s.queueOutputData(output1.'); s.startForeground; If i change the second line to this: ch=s.addAnalogOutputChannel('AD1',2,'Voltage'); I am able to get a signal from AWG2. When I monitor this at the headphone jack I receive a frequency sweep in my left ear, as expected. I would like to get output from both AWGs simultaneously. In the code below the attempt is to duplicate the same signal on both AWGs. When I monitor this at the headphone jack I get a single frequency square wave in only the right ear. s=daq.createSession('digilent') ; ch=s.addAnalogOutputChannel('AD1',1:2,'Voltage'); s.Rate=100e3; s.queueOutputData([output1.' output1.']); s.startForeground; The entire length of the playback is 90 seconds. I have tried reducing the number of data points and the sample rate by a factor of 2 thinking it was a buffering issue. I would expect that cutting it in half would work since I am using the same data two times over, but even cutting it by a factor of 10 yielded no different results. Can you provide any suggestion as to what I might do to get the desired output?
  25. Hello everyone, I have a quick question regarding the Zynq 7000-Development Board. I will be inputting a sound into the board, filtering and delaying the sound, and emitting the new sound through another speaker. My question is if the board has a built in audio codec to produce the new sound or will I have to develop some code for an audio codec? I have been looking at the product page and I haven't really noticed anything saying that it does. If I do need to produce code for an audio codec, would anyone have some links to help me get started in creating some code? VHDL or Matlab (I heard Matlab was easier). Thank you in advance for all your help.