How to connect an external sensor to Zynq-7000 module? - simulink

I'm currently working on a project to be implemented on a Xilinx Zedboard, using Simulink Embedded Coder methodology.
i need to interface an analog sensor (Electret Microphone) with the Zynq,i know that the XADC need to be instanciated in the PL then linked to the PS with the AXI, the DATA will be in the SDRAM that i need in my algorithm, but i don't know how to do it actually.
Thank you

Sami, there are many things you have to do. Instantiation of XADC is the first one. Then, you need to instantiate DMA and connect it properly in the FPGA part. Then, you have to write driver for DMA initialization. These isues are described (but not solved anyway) also e.g. here. After these steps you can use Simulink Embedded Coder methodology.

Check at the PDF with the link, section: 2.5.1 I/O Peripheral (IOP) Interface Routing
http://www.xilinx.com/support/documentation/user_guides/ug585-Zynq-7000-TRM.pdf
Good luck.

Related

Porting a project that is written for STM32 (ARM-Cortex M7 to NXP (ARM-Cortex M7)

The STM32 supply is very bad at the moment hence I am considering moving away from the STM32 and going for NXP since the supply is much better.
I would like to ask for advice regarding migrating from STM32 to NXP:
Have anyone tried to migrate their project from STM32 to NXP? Can this be done easily if the Core is the same?
What are the major difficulties that I may encounter?
Can I easily just remap pins, copy paste SPI/I2C and other drivers and they will just simply "work"
I have not gone through the migration, but consider that every single peripheral device (timers, Flash, SPI, I2C, etc) between two different micro manufacturers has a completely different register interface. This means that not a single thing works until you've implemented the new register interface. Usually this is handled by the manufacturers HAL, but those also have completely different C interfaces - so you're going to have to implement that, at the very least. So it's going to be a massive change no matter what. People who predict moving their code from one manufacturer to another usually build a porting layer in advance that hides the HAL, and swap out the HALs behind this layer. It mostly moves the development effort to another place (upfront) and starts reducing the work if there are more than 2 ports to maintain.
To get started it's best to have a quick look at the NXP HAL documentation on the peripherals you're using.

When simulating verilog output using Icarus, is there a way to include FPGA hardware features such as RAM in the simulation?

I'm new to FPGA, and have started out with an iceBreaker board using the ICE40UP5K chip. I'm aiming to make a LED display driver, driving something similar to HUB75 used on popular display modules.
I've been able to simulate waveform generation, and view it in GtkWave using the tutorial here:
https://brng.dev/blog/technical/tutorial/2019/05/11/icarus_gtkwave/
My next steps involve making use of the RAM banks inside of the ICE40UP5K. Is there some way to include the existence of this RAM in my simulation?
Yes, of course - there is a library of simulated ICE40 cells included in Yosys: https://github.com/YosysHQ/yosys/blob/master/techlibs/ice40/cells_sim.v

How do I control a Beckhoff EtherCAT Coupler with powershell?

We have a Beckhoff EtherCAT Coupler which is currently being controlled by some c# code, we call that c# code from a powershell script. We want to move the entire process of toggling slots on the coupler to the powershell script but I'm not sure how to do that. If you could provide me even with information on how to send/receive Modbus commands in powershell that would be hugely helpful.
Thank you!
EDIT:
Here is the code used in C# to toggle one slot of the IO coupler:
using System.Net.Sockets;
using Modbus.Device;
TcpClient tcp_connection = new TcpClient(ip, MODBUS_TCP_PORT);
ModbusIpMaster coupler = ModbusIpMaster.CreateIp(tcp_connection);
coupler.WriteSingleRegister(0x1120, 0);
coupler.WriteSingleCoil(slot, state);
Acontis offers an EtherCAT Master for Windows library and a C# example application you could leverage to include into your own application: https://acontis.com/en/ecsta.html
Working with machine automation controllers is highly manufacturer specific. I've got working knowledge only about Omron PLC & MACs, so I cannot provide exact details.
Anyway, one way would be to create a C# DLL and call it from Powershell. As how to program the coupler, start by finding out which model, exactly, you are working with and searching Beckhoff's documentation. Maybe there are suitable samples available.
Consider also contacting manufacturer's support. They might be able to provide advice with very reasonable pricing, unless the task grows into a consulting gig.
Programming PLCs and MACs is often done via manufacturer specific solutions. Those are much simpler to use than general-purpose language such as C#.

MATLAB code for object detection using a webcam?

I am using an Arduino to control a car and I want to make it autonomous by using a webcam to see the object I want and make the car move to this location. I need several things:
MATLAB code
Interface between MATLAB and Arduino
How do I connect between them (software, not hardware)
I need any tutorial to learn or any instructions to make my project. I see many people have done this before, but unfortunately they did not mention how to start these kind of projects.
This question is fairly broad, so I apologize in advance for my somewhat general response.
The easiest way to interface a webcam with MATLAB is to make use of the Image Acquisition Toolbox. This link provides documentation detailing how to do this.
There is a good chance that you'll also want to make use of the Image Processing toolbox in MATLAB to be able to process the acquired images to determine where to go. See this doc. Though, after you've determined more specifically how you plan to process these images, there are probably numerous algorithms that you could find online that would not explicitly require this toolbox.
As far as interfacing with Arduino is concerned, there is a support package from the MathWorks that allows you to interface MATLAB code and Simulink models with Arduino. See this link
The only other general suggestion that I have is to consider using Simulink for this project rather than MATLAB. I feel that the model based approach of Simulink is a much better fit when designing control systems.
I hope that this helps you get things started.

TMS320C64x Quick start reference for programmers

Is thare any quickstart guide for programmers for writing DSP-accelerated appliations for TMS320C64x?
I have a program with custom algorythm (not the fft, or usial filtering) and I want to accelerate it using multi-DSP coprocessor. So, how should I modify source to move computation from main CPU to DSPs? What limitations are there for DSP-running code?
I have some experience with CUDA. In CUDA I should mark every function as being host, device, or entry point for device (kernel). There are also functions to start kernels and to upload/download data to/from GPU. There are also some limitations, for device code, described in CUDA Reference manual. I hope, there is an similar interface and a documentation for DSP.
Please consider doing a search "TMS320C64x programmer's guide" - here is what I think is the most appropriate link
focus.ti.com/lit/ug/spru565b/spru565b.pdf
Also check this book - to help you get started (uses the previous generation)
Embedded image processing on the TMS320C6000 DSP : examples in code composer studio and MATLAB