Jump to content
  • 0

PWM output


Jegan_03

Question

Hi all,

I am trying to generate PWM signals in zedboard. I have four PWM outputs with different duty cycle. How to i get this output through the FMC connector of the zedboard. which pins to use? and do i need a DAC to use analog discovery 2 and see  the output of PWM?

Thank you

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

Hello @Jegan_03,

The analog and digital inputs and outputs of the Analog Discovery 2 can be connected to a circuit using simple wire probes, you don't need a DAC for this.

As for the FMC connector, you'll have to do some research about this connector and about its signals description. Zedboard has a LPC FMC connector. You'll have to use a FMC card for this something like https://fmchub.github.io/appendix/VITA57_FMC_HPC_LPC_SIGNALS_AND_PINOUT.html#lpc_pinout

Also you'll have to be very careful with the voltage for the for IO Banks. I recommend to use the default 1.8V.

You'll just have to assign the correct names for the desired LA_X (yellow as it's shown below) pins in the constrain file https://github.com/Digilent/digilent-xdc/blob/master/Zedboard-Master.xdc

Please read the signals description of each pin https://fmchub.github.io/appendix/VITA57_FMC_HPC_LPC_SIGNALS_AND_PINOUT.html#fmc_pin_description

image.thumb.png.1d814c4fdaff62c415970aff28b23a8d.png

Link to comment
Share on other sites

22 hours ago, Jegan_03 said:

do i need a DAC to use analog discovery 2 and see  the output of PWM?

Your first question is to figure out how you are going to probe the FMC connector pins without shorting pins and creating a catastrophe.

A better approach might be to send your PWM signals to one of the PMODs and use a scope to measure duty cycle. Have you thought about how you intend to vary the duty cycle to test your implementation? If you don't have a scope then there are creative ways to design test modules in your PL that use counters to measure high/low time in clock periods. If you can use the UART then that's a nice way to set and report PWM duty cycle data.

Once you are satisfied with the results it's fairly easy to change pin assignments if you really do need to use the FMC connector. I'm assuming that your PWM switching rates are within the toggling limits of PMOD IO. If that's not the case then you'll have make adjustments or figure out probing on the mezzanine board connected to the FMC connector.

Link to comment
Share on other sites

Hallo zygot,

I just followed this tutorial, I am new to using Zed board.

https://reference.digilentinc.com/learn/programmable-logic/tutorials/zedboard-creating-custom-ip-cores/start

In this tutorial they target the LED, But i was just planning to target External pins and check the PWM in analog discovery 2, through FMC connector. 

I think the PWM , digital values are 32  bits and so it is not possible to connect the analog discovery 2 to Pmod. As PMOD is 8 bits. 

I am not sure, can you look at the tutorial once and help me out. 

Kind regards 

Jegan

Link to comment
Share on other sites

@Jegan_03,

The tutorial you reference seems to be pretty basic. I was assuming that you have basic HDL design and Vivado tool skills. Perhaps I was wrong. I mention this because it's important to providing helpful advice. Given your reaction to my previous reply I'm now guessing that you are hoping to use the Zedboard with the GUI tools and avoid HDL design. I need some more information about what your experience level is. My approach to ZYNQ design is to do the minimal possible board design, get Vivado to create a board design HDL file, and instantiate that in my own toplevel design source so that I can do a mostly all HDL project design.

Link to comment
Share on other sites

 

I am just now starting to study HDL.! I am just studying it by doing some tutorials. Actually finally i am aiming to create a PWM by comparing both sine and triangular wave. for now i need to know can i use this tutorial and target the FMC pins and see the output in analog discovery 2.

Link to comment
Share on other sites

6 minutes ago, Jegan_03 said:

I am just now starting to study HDL.

Thanks.

So, I just noticed ..

22 minutes ago, Jegan_03 said:

I think the PWM , digital values are 32  bits and so it is not possible to connect the analog discovery 2 to Pmod. As PMOD is 8 bits. 

When I think of PWM signals I think of std_logic or 1-bit wires. I now understand why you think that you need to use the FMC connector. There's no reason measure anything except the duty cycle of the 4 PWM output signals. If you need to debug your IP you can instantiate an ILA in your PL and then capture any of the internal signals regardless of the width.

Forget trying to capture lots of wide signals on the FMC connector. You should be able to see all 4 PWMs in action on 1 PMOD.

Let me try and re-direct your attention for a moment.

Before trying to create custom board design IP you need to verify that the IP works. Part of this process is simulation. If you want to learn how to use an HDL you need to start learning how to use Vivado simulator and write a testbench to verify your HDL code. Simulation is complicated in a ZYNQ design but you can add an ILA to your board design. Vivado Hardware Manager will let you capture signals in the PL as if you were using FPGA device and can work along side the SDK tools. I've created a few board design IP and for me it starts off simulating the basic HDL functionality. AXI busses just make that work harder which is one reason why I advise beginners to use a non-ZYNQ board until they are feeling competent with the HDL design flow. Even if you are committed to using a ZYNQ, sooner or later you will need those basic HDL skills anyway. It's just a whole lot easier to develop them without AXI or ARM PS/PL connectivity being involved. That's particularly true on the tools level alone.

Link to comment
Share on other sites

On 5/14/2020 at 11:09 AM, zygot said:

There's no reason measure anything except the duty cycle of the 4 PWM output signals.

I should also correct myself here. You want to measure the duty cycle and also the frequency at which the pulses occur. While the on/off ratio might not change with frequency the device that's getting subjected to your PWM probably does care about frequency, or in other terms the absolute on or off time of the enabling pulse.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...