<?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 Xilinx Zynq: a Quadrature Oscillator - 2 implementations</title><link>/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-quadrature-oscillator---2-implementations</link><description>shabaz made a Software Defined Radio (SDR) Experiment Board . One of the components is a digital quadrature oscillator.
It&amp;#39;s a circuit with 4 PWM outputs that are each 90&amp;#176; shifted.
 
In Shabaz&amp;#39; blog, the oscillator is made with flip-flops, and cont..</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Learning Xilinx Zynq: a Quadrature Oscillator - 2 implementations</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-quadrature-oscillator---2-implementations</link><pubDate>Sun, 29 Aug 2021 21:15:53 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:828b79e0-2304-4e6d-b22b-47f04565d501</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;While I&amp;#39;m building up &lt;a class="jive-link-blog-small" href="/challenges-projects/project14/radiocontrol/b/blog/posts/software-defined-radio-sdr-experiment-board"&gt;Shabaz&amp;#39; SDR&lt;/a&gt;, I&amp;#39;m refining the FPGA quadrature oscillator.&lt;/p&gt;&lt;p&gt;I&amp;#39;d like to make its frequency change in steps. Programmable from the Zynq ARM/Linux PS.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;To prevent that I have to alter the quadrature oscillator VHDL, I&amp;#39;m adding a clock changer at the input of its clock input.&lt;/p&gt;&lt;p&gt;At this moment a naive one. A clock divider.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x131/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-828b79e0-2304-4e6d-b22b-47f04565d501/4786.contentimage_5F00_208482.png:620:131]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The output frequency of the quadrature oscillator is always its input frequency / 8.&lt;/p&gt;&lt;p&gt;So if I divide the input clock by 2, the effective frequency is input / 16.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11633&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning Xilinx Zynq: a Quadrature Oscillator - 2 implementations</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-quadrature-oscillator---2-implementations</link><pubDate>Thu, 05 Aug 2021 21:30:27 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:828b79e0-2304-4e6d-b22b-47f04565d501</guid><dc:creator>Andrew J</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I‘m hoping to understand at least some of this by the end of summer!&amp;nbsp; It’s impressive to develop so quickly&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11633&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning Xilinx Zynq: a Quadrature Oscillator - 2 implementations</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-quadrature-oscillator---2-implementations</link><pubDate>Thu, 05 Aug 2021 15:14:05 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:828b79e0-2304-4e6d-b22b-47f04565d501</guid><dc:creator>jc2048</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Here is another alternative, running on my VIDOR 4000.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/480x234/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-828b79e0-2304-4e6d-b22b-47f04565d501/contentimage_5F00_208481.png:480:234]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;But this one is bland and boring, because it&amp;#39;s just a very simple finite-state machine. Here&amp;#39;s the VHDL:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=---------------------------------------------------------------%0A---+Filename%3A+quad.vhd++++++++++++++++++++++++++++++++++++++---%0A---+Target+device%3A+16CL016YU256C8G++++++++++++++++++++++++++---%0A---+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---%0A---+Quadrature+generator++++++++++++++++++++++++++++++++++++---%0A---+using+classic+two-process+FSM+%28finite+state+machine%29++++---%0A---+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---%0A---+Jon+Clift+5th+August+2021+++++++++++++++++++++++++++++++---%0A---+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---%0A---------------------------------------------------------------%0A---+Rev++++Date+++++++++Comments++++++++++++++++++++++++++++---%0A---+1.0++++05-Aug-21++++++++++++++++++++++++++++++++++++++++---%0A---------------------------------------------------------------%0A%0A%0Alibrary+IEEE%3B%0Ause+IEEE.std_logic_1164.all%3B++%0A---use+IEEE.numeric_std.all%3B++%0Ause+ieee.std_logic_arith.all%3B%0Ause+ieee.std_logic_unsigned.all%3B%0A%0Aentity+quad_top+is+port%28%0A%0A+++---+system+signals%0A+++CLKi%3A+++++++++++++in+std_logic%3B%0A+++RESn%3A+++++++++++++in+std_logic%3B%0A++%0A+++---+MKR+PINS%0A+++MKR_D%3A++++++++++++out+std_logic_vector%283+downto+0%29%3B%0A+++%0A+++---+SDRAM%0A+++SDRAM_CK%3A+++++++++out+std_logic%3B%0A+++SDRAM_CSn%3A++++++++out+std_logic%3B%0A+++SDRAM_CKE%3A++++++++out+std_logic%3B%0A++%0A+++---+NINA+module%0A+++WM10_RESn%3A++++++++out+std_logic%0A%0A+++%29%3B%0Aend+quad_top%3B%0A%0Aarchitecture+arch_quad_top+of+quad_top+is%0A%0Atype+StateType+is+%28deg0%2C+deg90%2C+deg180%2C+deg270%29%3B%0Asignal+present_state%2C+next_state%3A+StateType%3B%0Asignal+quad%3A+std_logic_vector%283+downto+0%29%3B%0Asignal+next_a%2C+next_b%3A+std_logic%3B%0A%0Abegin%0A%0A+++---+first+process+runs+from+the+48MHz+clock+input+on+CLKi%0A+++---+this+moves+us+on+to+the+next+state%0A+++---+and+latches+the+new+outputs%0A%0A++++clocked_stuff%3A+process+%28CLKi%29+begin%0A++++++++if+%28CLKi%27event+and+CLKi+%3D+%271%27%29+then%0A++++++++++++present_state+%3C%3D+next_state%3B%0A++++++++++++quad%280%29+%3C%3D+next_a%3B%0A++++++++++++quad%281%29+%3C%3D+next_b%3B%0A++++++++++++quad%282%29+%3C%3D+not+next_a%3B%0A++++++++++++quad%283%29+%3C%3D+not+next_b%3B%0A++++++++++++end+if%3B%0A++++++end+process+clocked_stuff%3B%0A%0A+++---+second+process+is+all+the+combinatorial+stuff%0A+++---+...what+the+next+state+is%0A+++---+and+what+the+outputs+are+going+to+be+when+clocked%0A%0A++++combi_stuff%3A+process+%28present_state%29+begin%0A++++++case+present_state+is%0A+++++++++when+deg0+%3D%3E%0A++++++++++++next_state+%3C%3D+deg90%3B%0A++++++++++++next_a+%3C%3D+%271%27%3B%0A++++++++++++next_b+%3C%3D+%270%27%3B%0A+++++++++when+deg90+%3D%3E%0A++++++++++++next_state+%3C%3D+deg180%3B%0A++++++++++++next_a+%3C%3D+%271%27%3B%0A++++++++++++next_b+%3C%3D+%271%27%3B%0A+++++++++when+deg180+%3D%3E%0A++++++++++++next_state+%3C%3D+deg270%3B%0A++++++++++++next_a+%3C%3D+%270%27%3B%0A++++++++++++next_b+%3C%3D+%271%27%3B%0A+++++++++when+deg270+%3D%3E%0A++++++++++++next_state+%3C%3D+deg0%3B%0A++++++++++++next_a+%3C%3D+%270%27%3B%0A++++++++++++next_b+%3C%3D+%270%27%3B%0A+++++++++end+case%3B%0A++++++end+process+combi_stuff%3B%0A%0A++++++---+connect+servo+outs+to+the+MKR+pins%0A%0A++++++MKR_D+%3C%3D+quad%3B%0A%0A++++++---+hold+some+of+the+unused%2C+board+hardware+components+in+inactive+state%0A+++++++++%0A++++++SDRAM_CK+%3C%3D+CLKI%3B%0A++++++SDRAM_CSn+%3C%3D+%271%27%3B%0A++++++SDRAM_CKE+%3C%3D+%271%27%3B%0A+++++++++%0A++++++WM10_RESn+%3C%3D+%270%27%3B%0Aend+arch_quad_top%3B]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11633&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning Xilinx Zynq: a Quadrature Oscillator - 2 implementations</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-quadrature-oscillator---2-implementations</link><pubDate>Wed, 04 Aug 2021 22:21:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:828b79e0-2304-4e6d-b22b-47f04565d501</guid><dc:creator>genebren</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Jan,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Great work!&lt;/p&gt;&lt;p&gt;Just thinking out loud, but can&amp;#39;t two of the clock signals be defined as &amp;#39;not&amp;#39; of the other two clocks?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Gene&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11633&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning Xilinx Zynq: a Quadrature Oscillator - 2 implementations</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-quadrature-oscillator---2-implementations</link><pubDate>Wed, 04 Aug 2021 22:14:33 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:828b79e0-2304-4e6d-b22b-47f04565d501</guid><dc:creator>jc2048</dc:creator><slash:comments>2</slash:comments><description>&lt;blockquote class="jive-quote"&gt;&lt;p&gt;Or do you have an alternative?&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Does the Zync clock block allow you to dynamically set the frequency under the control of either the processor or the fabric? If so, it may also give you the ability to produce four outputs at different phases. Then you don&amp;#39;t need the logic at all.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The Cyclone 10 part seems to allow control of a PLL, though whether the resolution would be fine enough for sensible tuning of Shabaz&amp;#39;s radio I don&amp;#39;t know. I&amp;#39;m not sure how accurate the phase settings would be either, though it does seem to allow for adjusting phase.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11633&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning Xilinx Zynq: a Quadrature Oscillator - 2 implementations</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-quadrature-oscillator---2-implementations</link><pubDate>Wed, 04 Aug 2021 21:39:23 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:828b79e0-2304-4e6d-b22b-47f04565d501</guid><dc:creator>shabaz</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hi Jan,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Great work, and impressively fast development.&lt;/p&gt;&lt;p&gt;The waveforms look excellent on the &amp;#39;scope screenshot. Very good idea to do this on the FPGA!!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11633&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning Xilinx Zynq: a Quadrature Oscillator - 2 implementations</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-quadrature-oscillator---2-implementations</link><pubDate>Wed, 04 Aug 2021 21:09:49 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:828b79e0-2304-4e6d-b22b-47f04565d501</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;There is a subtle difference. The output is different during the first 3 clock ticks, until the very first full shift is completed.&lt;/p&gt;&lt;p&gt;That can be fixed by setting initial and reset values for buffer and counter to the state expected during a 4th tick.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11633&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning Xilinx Zynq: a Quadrature Oscillator - 2 implementations</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-quadrature-oscillator---2-implementations</link><pubDate>Wed, 04 Aug 2021 20:54:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:828b79e0-2304-4e6d-b22b-47f04565d501</guid><dc:creator>fmilburn</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Impressive that you did this so quickly and with so little code&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11633&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Learning Xilinx Zynq: a Quadrature Oscillator - 2 implementations</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/learning-xilinx-zynq-a-quadrature-oscillator---2-implementations</link><pubDate>Wed, 04 Aug 2021 20:37:08 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:828b79e0-2304-4e6d-b22b-47f04565d501</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The Vivado / Zynq / Pynq artifacts:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Block diagram:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x291/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-828b79e0-2304-4e6d-b22b-47f04565d501/6663.contentimage_5F00_208465.png:620:291]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Constraints:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/407x117/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-828b79e0-2304-4e6d-b22b-47f04565d501/1805.contentimage_5F00_208466.png:407:117]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Jupyter notebook:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x148/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-828b79e0-2304-4e6d-b22b-47f04565d501/0410.contentimage_5F00_208467.png:620:148]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;ve used one of the Zync fabric clocks as input. Any clock works, and output will be clock/4.&lt;/p&gt;&lt;p&gt;Here, the input clock was set to 4 MHz:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x422/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-828b79e0-2304-4e6d-b22b-47f04565d501/3542.contentimage_5F00_208468.png:620:422]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11633&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>