<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><description>yepe has to resolve this problem for a project assignment:




Hi Jan Cumps, I hope you don&amp;#39;t mind if I ask a question regarding the PYNQ half-bridge PWM driver. I am working on a student project for school and I need to drive a half-...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><pubDate>Sat, 06 May 2023 14:43:25 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8def4c35-9107-4561-8590-4f2bb77b675a</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you &lt;a href="/tags/amdzynqultrasoundpulse"&gt;follow this story&lt;/a&gt;: this will be the end state:&lt;br /&gt;&lt;img src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/pastedimage1683384186166v1.png" alt=" " /&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25747&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><pubDate>Sat, 22 Apr 2023 18:03:55 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8def4c35-9107-4561-8590-4f2bb77b675a</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;last questions of the day:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the delay between PRF falling edge and the start of the pulse train, do you have an idea of the order of magnitude?&lt;/li&gt;
&lt;li&gt;how many pulses in a train? Is that always 2, varying, or&amp;nbsp;an other number&amp;nbsp;that can be predefined during the design?&lt;/li&gt;
&lt;li&gt;the delay between PRF rising edge and&amp;nbsp;GATE rising edge?&lt;/li&gt;
&lt;/ul&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25747&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><pubDate>Sat, 22 Apr 2023 13:06:07 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8def4c35-9107-4561-8590-4f2bb77b675a</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;To disable the PWM, you could putand AND gate at&amp;nbsp;output A, and an OR gate at output B. &lt;br /&gt;Link the other input of&amp;nbsp;A to a&amp;nbsp;enable&amp;nbsp;signal that you can control.&lt;br /&gt;And the other input of B to the inverted enable signal.&lt;br /&gt;This would cause that A was always LOW, and B always HIGH, when disabled.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve taken another approach: add an enable input to the PWM generator:&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:8c48db07-e674-4edd-bdba-b43660edf195:type=text&amp;text=library%20IEEE%3B%0D%0Ause%20IEEE.std_logic_1164.all%3B%0D%0A%0D%0Apackage%20PulsePckg%20is%0D%0A%0D%0A%20%20constant%20HI%20%20%20%3A%20std_logic%20%3A%3D%20%271%27%3B%0D%0A%20%20constant%20LO%20%20%20%3A%20std_logic%20%3A%3D%20%270%27%3B%0D%0A%20%20constant%20ONE%20%20%3A%20std_logic%20%3A%3D%20%271%27%3B%0D%0A%20%20%0D%0Acomponent%20Pwm%20is%0D%0A%20%20generic%20%28%0D%0A%20%20%20%20resolution%20%3A%20integer%20%3A%3D%206%3B%20--%20bit%20width%20of%20the%20counter%20used%20for%20duty%20cycle%0D%0A%20%20%20%20duty_bits%20%3A%20integer%20%3A%3D%204%20%20%20--%20bit%20width%20of%20the%20variable%20that%20holds%20the%20desired%20deadband%20%0D%0A%20%20%29%3B%0D%0A%20%20port%20%28%0D%0A%20%20%20%20n_reset_i%20%3A%20in%20%20std_logic%3B%20%20%20%20%20%20%20%20%20%20--%20async%20reset%0D%0A%20%20%20%20enable_i%20%3A%20in%20%20std_logic%3B%20%20%20%20%20%20%20%20%20%20%20--%20enable%20the%20outputs%0D%0A%20%20%20%20clk_i%20%20%3A%20in%20%20std_logic%3B%20%20%20%20%20%20%20%20%20%20%20%20%20--%20Input%20clock.%0D%0A%20%20%20%20duty_i%20%3A%20in%20%20std_logic_vector%20%28resolution%20-%201%20downto%200%29%3B%20%20%20%20%20%20--%20Duty-cycle%20input.%0D%0A%20%20%20%20band_i%20%3A%20in%20%20std_logic_vector%20%28duty_bits%20-%201%20%20downto%200%29%3B%20%20%20%20%20%20--%20number%20of%20clock-ticks%20to%20keep%20both%20signals%20low%20before%20rising%20edge%0D%0A%20%20%20%20pwmA_o%20%20%3A%20out%20std_logic%3B%20%20%20%20%20%20%20%20%20%20%20%20--%20PWM%20output.%0D%0A%20%20%20%20pwmB_o%20%20%3A%20out%20std_logic%20%20%20%20%20%20%20%20%20%20%20%20%20--%20PWM%20output%20inverse.%0D%0A%20%20%20%20%29%3B%0D%0Aend%20component%3B%20%20%0D%0A%0D%0Aend%20package%3B%0D%0A%0D%0A--%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0D%0A--%20PWM%20module.%0D%0A--%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0D%0A%0D%0Alibrary%20IEEE%3B%0D%0Ause%20IEEE.MATH_REAL.all%3B%0D%0Ause%20IEEE.std_logic_1164.all%3B%0D%0Ause%20IEEE.numeric_std.all%3B%0D%0Ause%20WORK.PulsePckg.all%3B%0D%0A%0D%0Aentity%20Pwm%20is%0D%0A%20%20generic%20%28%0D%0A%20%20%20%20resolution%20%3A%20integer%20%3A%3D%206%3B%0D%0A%20%20%20%20duty_bits%20%3A%20integer%20%3A%3D%204%0D%0A%20%20%29%3B%0D%0A%20%20port%20%28%0D%0A%20%20%20%20n_reset_i%20%3A%20in%20%20std_logic%3B%20%20%20%20%20%20%20%20%20%20--%20async%20reset%0D%0A%20%20%20%20enable_i%20%3A%20in%20%20std_logic%3B%20%20%20%20%20%20%20%20%20%20%20--%20enable%20the%20outputs%0D%0A%20%20%20%20clk_i%20%20%3A%20in%20%20std_logic%3B%20%20%20%20%20%20%20%20%20%20%20%20%20--%20Input%20clock.%0D%0A%20%20%20%20duty_i%20%3A%20in%20%20std_logic_vector%20%28resolution%20-%201%20downto%200%29%3B%20%20%20%20%20%20--%20Duty-cycle%20input.%0D%0A%20%20%20%20band_i%20%3A%20in%20%20std_logic_vector%20%28duty_bits%20-%201%20downto%200%29%3B%20%20%20%20%20%20--%20number%20of%20clock-ticks%20to%20keep%20both%20signals%20low%20before%20rising%20edge%0D%0A%20%20%20%20pwmA_o%20%20%3A%20out%20std_logic%3B%20%20%20%20%20%20%20%20%20%20%20%20--%20PWM%20output.%0D%0A%20%20%20%20pwmB_o%20%20%3A%20out%20std_logic%20%20%20%20%20%20%20%20%20%20%20%20%20--%20PWM%20output%20inverse.%0D%0A%20%20%20%20%29%3B%0D%0Aend%20entity%3B%0D%0A%0D%0Aarchitecture%20arch%20of%20Pwm%20is%0D%0A%20%20signal%20timer_r%20%20%20%20%20%20%20%3A%20natural%20range%200%20to%202%2A%2Aduty_i%27length-1%3B%0D%0Abegin%0D%0A%0D%0A%20%20clocked%3A%20process%28clk_i%2C%20n_reset_i%29%0D%0A%20%20begin%0D%0A%20%20%20%20pwmA_o%20%20%20%3C%3D%20LO%3B%0D%0A%20%20%20%20pwmB_o%20%20%20%3C%3D%20LO%3B%0D%0A%20%20%20%0D%0A%20%20%20%20--%20async%20reset%0D%0A%20%20%20%20if%20n_reset_i%20%3D%20%270%27%20then%0D%0A%20%20%20%20%20%20%20%20timer_r%20%3C%3D%200%3B%0D%0A%20%20%20%20%20%20%20%0D%0A%20%20%20%20elsif%20rising_edge%28clk_i%29%20then%0D%0A%20%20%20%20%20%20--%20timer%0D%0A%20%20%20%20%20%20timer_r%20%3C%3D%20timer_r%20%2B%201%3B%0D%0A%20%20%20%20if%20enable_i%20%3D%20%270%27%20then%0D%0A%20%20%20%20%20%20pwmB_o%20%20%20%3C%3D%20HI%3B%0D%0A%20%20%20%20%0D%0A%20%20%20%20else%0D%0A%20%20%20%20%20%20--%20output%20a%0D%0A%20%20%20%20%20%20if%20timer_r%20%3C%3D%20unsigned%28duty_i%29%20and%20timer_r%20%3E%3D%20unsigned%28band_i%29%20%20then%0D%0A%20%20%20%20%20%20%20%20pwmA_o%20%3C%3D%20HI%3B%0D%0A%20%20%20%20%20%20end%20if%3B%0D%0A%20%20%20%20%20%20--%20output%20b%0D%0A%20%20%20%20%20%20if%20timer_r%20%3E%20to_integer%28unsigned%28band_i%29%29%20%2B%20to_integer%28unsigned%28duty_i%29%29%20then%20%09%09%0D%0A%20%20%20%20%20%20%20%20pwmB_o%20%3C%3D%20HI%3B%0D%0A%20%20%20%20%20%20end%20if%3B%0D%0A%20%20%20%20end%20if%3B%20--%20enable%0D%0A%20%20%20%20end%20if%3B%20--%20rising_edge%0D%0A%20%20end%20process%20clocked%3B%0D%0A%20%20%0D%0A%20%20%0D%0Aend%20architecture%3B]&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve added a new register that can hold 32 flags. Position 0 reserved for the enabled flag. The rest (currently) unused:&lt;/p&gt;
&lt;p&gt;&lt;img height="304" src="/resized-image/__size/1114x608/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/pastedimage1682168539875v1.png" width="557" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Helper function:&lt;/p&gt;
&lt;p&gt;&lt;img height="144" src="/resized-image/__size/792x288/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/pastedimage1682168612627v2.png" width="396" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The register is only to test it in Pynq. In your design, you would enable it in the VHDL block (not existing yet :) ) that also controls the other signals.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25747&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><pubDate>Sat, 22 Apr 2023 11:48:19 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8def4c35-9107-4561-8590-4f2bb77b675a</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Calculation of a good clock frequency to give:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;5 MHz&lt;/li&gt;
&lt;li&gt;decent resolution for dead time (in increments of the driving&amp;nbsp;clock&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img height="103" src="/resized-image/__size/528x206/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/pastedimage1682163998347v2.png" width="264" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If I use&amp;nbsp;6&amp;nbsp;bit resolution, a&amp;nbsp;320 MHz clock gives exactly 5 MHz.&lt;br /&gt;Deadband can then be set in 2.5 ns increments.&lt;/p&gt;
&lt;p&gt;Capture below is 50% duty cycle, 20 units of deadband:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/pastedimage1682164096161v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25747&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><pubDate>Fri, 21 Apr 2023 23:42:15 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8def4c35-9107-4561-8590-4f2bb77b675a</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;[mention:09481a563d9943b88fef2c3472c7d1fe:e9ed411860ed4f2ba0265705b8793d05]&amp;nbsp;, in rest, your PWMN signal is high. Is it the desired state when the bridge is not active?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25747&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><pubDate>Fri, 21 Apr 2023 23:30:34 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8def4c35-9107-4561-8590-4f2bb77b675a</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;To check if things worked, I created a constant for the duty cycle (set to 50%), and a register for the deadband. Now that I got this working, and refreshed my Pynq brain, I made both duty cycle and band a register. You recognise them as the two AXI_GPIO blocks&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/pastedimage1682119155783v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;In the Jupyter testbed that I created, I can control both values:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/pastedimage1682119352608v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I have set the resolution back to 6 bits&amp;nbsp;for my tests. Because I turned the resolution into a generic in the VHDL code, I can&amp;nbsp;adapt&amp;nbsp;it in the block diagram.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25747&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><pubDate>Fri, 21 Apr 2023 21:54:04 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8def4c35-9107-4561-8590-4f2bb77b675a</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With the VHDL PWM from my previous blogs, I can get a 5 MHz differential from a 20MHz clock, if I reduce the&amp;nbsp;resolution to 2 bits.&lt;br /&gt;There&amp;#39;s&amp;nbsp;virtually no&amp;nbsp;wiggle room for deadband then. There are 1 clock pulse left to deal with it.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;To support that, I made the resolution bit width generic:&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:ea8987c7-c813-4d71-ac75-baca58a1572d:type=text&amp;text=--%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0D%0A--%20Copyright%20%28c%29%202011-2014%20by%20XESS%20Corp%20%3Chttp%3A%2F%2Fwww.xess.com%3E.%0D%0A--%20All%20rights%20reserved.%0D%0A--%0D%0A--%20This%20library%20is%20free%20software%3B%20you%20can%20redistribute%20it%20and%2For%0D%0A--%20modify%20it%20under%20the%20terms%20of%20the%20GNU%20Lesser%20General%20Public%0D%0A--%20License%20as%20published%20by%20the%20Free%20Software%20Foundation%3B%20either%0D%0A--%20version%203.0%20of%20the%20License%2C%20or%20%28at%20your%20option%29%20any%20later%20version.%0D%0A--%20%0D%0A--%20This%20library%20is%20distributed%20in%20the%20hope%20that%20it%20will%20be%20useful%2C%0D%0A--%20but%20WITHOUT%20ANY%20WARRANTY%3B%20without%20even%20the%20implied%20warranty%20of%0D%0A--%20MERCHANTABILITY%20or%20FITNESS%20FOR%20A%20PARTICULAR%20PURPOSE.%20%20See%20the%20GNU%0D%0A--%20Lesser%20General%20Public%20License%20for%20more%20details.%0D%0A--%20%0D%0A--%20You%20should%20have%20received%20a%20copy%20of%20the%20GNU%20Lesser%20General%20Public%0D%0A--%20License%20along%20with%20this%20library.%20%20If%20not%2C%20see%20%0D%0A--%20%3Chttp%3A%2F%2Fwww.gnu.org%2Flicenses%2F%3E.%0D%0A--%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0D%0A%0D%0A--%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0D%0A--%20Module%20for%20generating%20repetitive%20pulses.%0D%0A--%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0D%0A%0D%0Alibrary%20IEEE%3B%0D%0Ause%20IEEE.std_logic_1164.all%3B%0D%0A%0D%0Apackage%20PulsePckg%20is%0D%0A%0D%0A%20%20constant%20HI%20%20%20%3A%20std_logic%20%3A%3D%20%271%27%3B%0D%0A%20%20constant%20LO%20%20%20%3A%20std_logic%20%3A%3D%20%270%27%3B%0D%0A%20%20constant%20ONE%20%20%3A%20std_logic%20%3A%3D%20%271%27%3B%0D%0A%20%20%0D%0Acomponent%20Pwm%20is%0D%0A%20%20generic%20%28%0D%0A%20%20%20%20resolution%20%3A%20integer%20%3A%3D%206%3B%20--%20bit%20width%20of%20the%20counter%20used%20for%20duty%20cycle%0D%0A%20%20%20%20duty_bits%20%3A%20integer%20%3A%3D%204%20%20%20--%20bit%20width%20of%20the%20variable%20that%20holds%20the%20desired%20deadband%20%0D%0A%20%20%29%3B%0D%0A%20%20port%20%28%0D%0A%20%20%20%20n_reset_i%20%3A%20in%20%20std_logic%3B%20%20%20%20%20%20%20%20%20%20--%20async%20reset%0D%0A%20%20%20%20clk_i%20%20%3A%20in%20%20std_logic%3B%20%20%20%20%20%20%20%20%20%20%20%20%20--%20Input%20clock.%0D%0A%20%20%20%20duty_i%20%3A%20in%20%20std_logic_vector%20%28resolution%20-%201%20downto%200%29%3B%20%20%20%20%20%20--%20Duty-cycle%20input.%0D%0A%20%20%20%20band_i%20%3A%20in%20%20std_logic_vector%20%28duty_bits%20-%201%20%20downto%200%29%3B%20%20%20%20%20%20--%20number%20of%20clock-ticks%20to%20keep%20both%20signals%20low%20before%20rising%20edge%0D%0A%20%20%20%20pwmA_o%20%20%3A%20out%20std_logic%3B%20%20%20%20%20%20%20%20%20%20%20%20--%20PWM%20output.%0D%0A%20%20%20%20pwmB_o%20%20%3A%20out%20std_logic%20%20%20%20%20%20%20%20%20%20%20%20%20--%20PWM%20output%20inverse.%0D%0A%20%20%20%20%29%3B%0D%0Aend%20component%3B%20%20%0D%0A%0D%0Aend%20package%3B%0D%0A%0D%0A--%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0D%0A--%20PWM%20module.%0D%0A--%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0D%0A%0D%0Alibrary%20IEEE%3B%0D%0Ause%20IEEE.MATH_REAL.all%3B%0D%0Ause%20IEEE.std_logic_1164.all%3B%0D%0Ause%20IEEE.numeric_std.all%3B%0D%0Ause%20WORK.PulsePckg.all%3B%0D%0A%0D%0Aentity%20Pwm%20is%0D%0A%20%20generic%20%28%0D%0A%20%20%20%20resolution%20%3A%20integer%20%3A%3D%206%3B%0D%0A%20%20%20%20duty_bits%20%3A%20integer%20%3A%3D%204%0D%0A%20%20%29%3B%0D%0A%20%20port%20%28%0D%0A%20%20%20%20n_reset_i%20%3A%20in%20%20std_logic%3B%20%20%20%20%20%20%20%20%20%20--%20async%20reset%0D%0A%20%20%20%20clk_i%20%20%3A%20in%20%20std_logic%3B%20%20%20%20%20%20%20%20%20%20%20%20%20--%20Input%20clock.%0D%0A%20%20%20%20duty_i%20%3A%20in%20%20std_logic_vector%20%28resolution%20-%201%20downto%200%29%3B%20%20%20%20%20%20--%20Duty-cycle%20input.%0D%0A%20%20%20%20band_i%20%3A%20in%20%20std_logic_vector%20%28duty_bits%20-%201%20downto%200%29%3B%20%20%20%20%20%20--%20number%20of%20clock-ticks%20to%20keep%20both%20signals%20low%20before%20rising%20edge%0D%0A%20%20%20%20pwmA_o%20%20%3A%20out%20std_logic%3B%20%20%20%20%20%20%20%20%20%20%20%20--%20PWM%20output.%0D%0A%20%20%20%20pwmB_o%20%20%3A%20out%20std_logic%20%20%20%20%20%20%20%20%20%20%20%20%20--%20PWM%20output%20inverse.%0D%0A%20%20%20%20%29%3B%0D%0Aend%20entity%3B%0D%0A%0D%0Aarchitecture%20arch%20of%20Pwm%20is%0D%0A%20%20signal%20timer_r%20%20%20%20%20%20%20%3A%20natural%20range%200%20to%202%2A%2Aduty_i%27length-1%3B%0D%0Abegin%0D%0A%0D%0A%20%20clocked%3A%20process%28clk_i%2C%20n_reset_i%29%0D%0A%20%20begin%0D%0A%20%20%20%20pwmA_o%20%20%20%3C%3D%20LO%3B%0D%0A%20%20%20%20pwmB_o%20%20%20%3C%3D%20LO%3B%0D%0A%20%20%20%20%0D%0A%20%20%20%20--%20async%20reset%0D%0A%20%20%20%20if%20n_reset_i%20%3D%20%270%27%20then%0D%0A%20%20%20%20%20%20%20%20timer_r%20%3C%3D%200%3B%0D%0A%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20elsif%20rising_edge%28clk_i%29%20then%0D%0A%20%20%20%20%20%20--%20timer%0D%0A%20%20%20%20%20%20timer_r%20%3C%3D%20timer_r%20%2B%201%3B%0D%0A%20%20%20%20%20%20--%20output%20a%0D%0A%20%20%20%20%20%20if%20timer_r%20%3C%3D%20unsigned%28duty_i%29%20and%20timer_r%20%3E%3D%20unsigned%28band_i%29%20%20then%0D%0A%20%20%20%20%20%20%20%20pwmA_o%20%3C%3D%20HI%3B%0D%0A%20%20%20%20%20%20end%20if%3B%0D%0A%20%20%20%20%20%20--%20output%20b%0D%0A%20%20%20%20%20%20if%20timer_r%20%3E%20to_integer%28unsigned%28band_i%29%29%20%2B%20to_integer%28unsigned%28duty_i%29%29%20then%20%09%09%0D%0A%20%20%20%20%20%20%20%20pwmB_o%20%3C%3D%20HI%3B%0D%0A%20%20%20%20%20%20end%20if%3B%0D%0A%20%20%20%20end%20if%3B%20--%20rising_edge%0D%0A%20%20end%20process%20clocked%3B%0D%0A%20%20%0D%0A%20%20%0D%0Aend%20architecture%3B]&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;used a clock wizard to generate the 5 MHz:&lt;/p&gt;
&lt;p&gt;&lt;img height="291" src="/resized-image/__size/806x582/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/pastedimage1682113778981v1.png" width="403" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I set the resolution to 2 bits in the block diagram:&lt;/p&gt;
&lt;p&gt;&lt;img height="351" src="/resized-image/__size/820x702/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/pastedimage1682113999118v4.png" width="410" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Block design:&lt;/p&gt;
&lt;p&gt;&lt;img height="328" src="/resized-image/__size/1542x656/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/pastedimage1682113970017v3.png" width="771" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;p&gt;&lt;img src="/cfs-file/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8def4c35-9107-4561-8590-4f2bb77b675a/IMAGE1.BMP" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25747&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><pubDate>Fri, 21 Apr 2023 16:54:36 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8def4c35-9107-4561-8590-4f2bb77b675a</guid><dc:creator>michaelkellett</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I&amp;#39;m a bit puzzled by the statement:&lt;/p&gt;
&lt;p&gt;&amp;quot;The&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;PWM&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;pulse-train should be 5 MHz.&amp;quot;&lt;/p&gt;
&lt;p&gt;And the more I look the more puzzled I am:&lt;/p&gt;
&lt;p&gt;&amp;quot;First off, I need to simplify that I only need 50% duty cycle and no other duty cycles needed&amp;quot;&lt;/p&gt;
&lt;p&gt;This doesn&amp;#39;t sound like PWM at all.&lt;/p&gt;
&lt;p&gt;I think it&amp;#39;s more that yepe wants to drive a half bridge at 5MHz, but his diagram shows all the &amp;quot;PWM&amp;quot; pulses driving in the same direction.&lt;/p&gt;
&lt;p&gt;At this point I&amp;#39;m feeling I want to look at the whole menu again before I order the elephant sandwich.&lt;/p&gt;
&lt;p&gt;Or, rather, see a schematic of the half bridge and its load.&lt;/p&gt;
&lt;p&gt;MK&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25747&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><pubDate>Fri, 21 Apr 2023 13:37:13 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8def4c35-9107-4561-8590-4f2bb77b675a</guid><dc:creator>shabaz</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;The PRF signal sounded interesting, I couldn&amp;#39;t tell if it is internally generated, or externally generated since they mention having to sync to it. If it&amp;#39;s external then that might need a PLL. A block diagram showing all signals would also helps that they can implement it in chunks as you recommended.&amp;nbsp;Maybe this is a uni project, in which case if it is a team project and they must have worked on some sort of diagrams of the system to share the work, but hasn&amp;#39;t been shared.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25747&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning AMD Zynq: a project to generate a set of PWM signals. 1 - problem statement and possible approach</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-school-project-to-generate-a-set-of-pwm-signals-1---problem-statement-and-possible-approach</link><pubDate>Fri, 21 Apr 2023 12:53:12 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8def4c35-9107-4561-8590-4f2bb77b675a</guid><dc:creator>scottiebabe</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;That is very kind of you to help a student out. Action shot [emoticon:9b06bfad0e6a482e801e5eb8fd9025d6]!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25747&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>