<?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>VIDOR 4000: Servo Interface</title><link>/technologies/fpga-group/b/blog/posts/vidor-4000-servo-interface</link><description>Introduction Now a little project: a servo interface. This will give me a chance to experiment with some very simple communication between the microcontroller and the FPGA on my VIDOR 4000 board. I&amp;#39;m going to have 8 servo channels...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: VIDOR 4000: Servo Interface</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/vidor-4000-servo-interface</link><pubDate>Mon, 02 Aug 2021 11:46:33 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb451b64-fed0-4c16-9f62-2a8c67a9ed53</guid><dc:creator>jc2048</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Mine works with a servo, too. This is 15 degree steps from -60 to +60, and then go back and start again.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span id="d3ee9f64_4483_4084_b1d3_4eb92055a619"&gt;&lt;span&gt;[View:https://players.brightcove.net/1362235890001/NkxiVJdjx_default/index.html?videoId=6266222611001:740:466]&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;But as &lt;span&gt;[mention:b0bc65b9ecdc4307bd967592f00e340a:e9ed411860ed4f2ba0265705b8793d05]&lt;/span&gt; predicted, the timing is out. The last step is missing and the one prior to that is a short one, so the limit at that end of the travel is a good bit lower than the &amp;#39;standard&amp;#39; 2000us I was working to.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11615&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: VIDOR 4000: Servo Interface</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/vidor-4000-servo-interface</link><pubDate>Sat, 31 Jul 2021 10:46:44 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb451b64-fed0-4c16-9f62-2a8c67a9ed53</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The design works.&amp;nbsp; Tested with an Sparkfun micro servo.&lt;/p&gt;&lt;p&gt;&lt;span id="1aadb91e_e9ae_44e1_837a_3ddc6d3e479c"&gt;&lt;span&gt;[View:https://www.youtube.com/watch?v=SC4h4herhw8:370:240]&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I think that servo is the same as the blue ones you use, just older black housing.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11615&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: VIDOR 4000: Servo Interface</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/vidor-4000-servo-interface</link><pubDate>Sat, 31 Jul 2021 06:36:54 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb451b64-fed0-4c16-9f62-2a8c67a9ed53</guid><dc:creator>Andrew J</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Very interesting. The back-and-forth discussions on these (types of) posts give some really useful insights on considerations and what to check for. &lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11615&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: VIDOR 4000: Servo Interface</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/vidor-4000-servo-interface</link><pubDate>Fri, 30 Jul 2021 20:12:17 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb451b64-fed0-4c16-9f62-2a8c67a9ed53</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I&amp;#39;m trying to implement your design on the Zynq.&lt;/p&gt;&lt;p&gt;The only change I make is the interface.&lt;/p&gt;&lt;p&gt;Because the processor and the FPGA are on the same silicon, an internal memory mapped register (shared between ARM part and FPGA fabric) makes more sense than an external SPI.&lt;/p&gt;&lt;p&gt;I kept the same format: 16 bits wide, with 3 bits to select the servo and 8 to set the angle. The remaining MSBs ignored.&lt;/p&gt;&lt;p&gt;But I get them in bulk. Not bit per bit from the SPI data pin.&lt;/p&gt;&lt;p&gt;To reflect that, I renamed the received data register from spi_shift_register to data_register.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x323/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-bb451b64-fed0-4c16-9f62-2a8c67a9ed53/4503.contentimage_5F00_208368.png:620:323]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;VHDL, untested:&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+servo.vhd+++++++++++++++++++++++++++++++++++++---%0A---+Target+device%3A+16CL016YU256C8G++++++++++++++++++++++++++---%0A---+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---%0A---+8-Channel+Servo+driver+with+output+at+100Hz+++++++++++++---%0A---+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---%0A---+Interfaces+to+microcontroller+with+SPI+%5Bwrite+only%5D+++++---%0A---+16-bit+data%2C+msb+first%2C+and+mode+%280%2C0%29+for+the+clock++++---%0A---+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---%0A---+msb+++++++++++++++++++++++++++++++++++++lsb+++++++++++++---%0A---+x+x+x+x+x+A2+A1+A0++D7+D6+D5+D4+D3+D2+D1+D0+++++++++++++---%0A---+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---%0A---+where+A+is+the+channel+address++++++++++++++++++++++++++---%0A---+D+is+two%27s+complement+setting+in+half+degree+increments+---%0A---+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---%0A---+Jon+Clift+18th+July+2021++++++++++++++++++++++++++++++++---%0A---+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---%0A---------------------------------------------------------------%0A---+Rev++++Date+++++++++Comments++++++++++++++++++++++++++++---%0A---+1.0++++18-Jul-21++++++++++++++++++++++++++++++++++++++++---%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+servo_top+is+port%28%0A+++---+system+signals%0A+++CLKi%3A+++++++++++++in+std_logic%3B%0A+++RESn%3A+++++++++++++in+std_logic%3B%0A+++++++--+DATA+IN%0A+++data_register%3A+in+std_logic_vector%2815+downto+0%29%3B%0A+++++---+MKR+PINS%0A+++MKR_D%3A++++++++++++out+std_logic_vector%287+downto+0%29%0A%29%3B%0Aend+servo_top%3B%0A%0Aarchitecture+arch_servo_top+of+servo_top+is%0Asignal+prescaler%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_en%2C+servo_transfer_en%3A+std_logic%3B%0Asignal+servo_counter%3A+std_logic_vector%2812+downto+0%29%3B%0A--signal+data_register%3A+std_logic_vector%2815+downto+0%29%3B%0Asignal+servo_hold_0%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_hold_1%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_hold_2%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_hold_3%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_hold_4%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_hold_5%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_hold_6%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_hold_7%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_data_0%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_data_1%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_data_2%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_data_3%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_data_4%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_data_5%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_data_6%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_data_7%3A+std_logic_vector%287+downto+0%29%3B%0Asignal+servo_out%3A+std_logic_vector%287+downto+0%29%3B%0A%0Abegin%0A++---+everything+that+runs+from+the+48MHz+clock+input+on+CLKi%0A++clocked_stuff%3A+process+%28CLKi%29%0A++begin%0A++++if+%28CLKi%27event+and+CLKi+%3D+%271%27%29+then%0A++++++---+prescaler+down+to+4.16666us+period+%28divide+by+200%29%0A++++++if+%28prescaler%287+downto+0%29+%3D+%2200000000%22%29+then+---+if+reached+0%0A++++++++prescaler%287+downto+0%29+%3C%3D+%2211000111%22%3B+---+++preset+to+199%0A++++++++servo_en+%3C%3D+%271%27%3B+---+++and+set+enable+for+one+cycle%0A++++++else+---+else+count+down%0A++++++++prescaler+%3C%3D+prescaler+-+1%3B%0A++++++++servo_en+%3C%3D+%270%27%3B+---+++keeping+enable+low+rest+of+time%0A++++++end+if%3B%0A%0A++++++---+the+servo+counter+counts+every+4.16666us+%28equivalent+to+half+a+degree+on+the+servo%29%0A++++++---+period+is+4800+counts%3A+4.16666us+x+4800+%3D+20ms+%28100Hz%29%0A%0A++++++if+%28servo_en+%3D+%271%27%29+then%0A++++++++if+%28servo_counter%2812+downto+0%29+%3D+%221000111010111%22%29+then+---+if+reached+4567%0A++++++++++servo_counter%2812+downto+0%29+%3C%3D+%221111100011000%22%3B+---+preset+%28skip+ahead%29+to+7960+%28-232%29%0A++++++++++servo_out%287+downto+0%29+%3C%3D+%2211111111%22%3B+---+and+set+all+the+servo+outputs+high%0A++++++++++servo_transfer_en+%3C%3D+%271%27%3B+---+++%0A++++++++else+---+else%0A++++++++++servo_counter+%3C%3D+servo_counter+%2B+1%3B+---+count+down%0A++++++++++servo_transfer_en+%3C%3D+%270%27%3B+---+++%0A++++++++end+if%3B%0A++++++end+if%3B%0A%0A++++++---+at+end+of+ss+%28SPI+%27chip+select%27+going+high+at+end+of+transfer%29%0A++++++---+transfer+data+from+spi+shift+register+to+the+addressed+%0A++++++---+servo+data+holding+register%0A++++++---+bit+7+is+negated+to+convert+2%27s+complement+back+to+binary%0A++++++++case+%28data_register%2810+downto+8%29%29+is%0A++++++++when+%22000%22+%3D%3E%0A++++++++++servo_hold_0%286+downto+0%29+%3C%3D+data_register%286+downto+0%29%3B%0A++++++++++servo_hold_0%287%29+%3C%3D+not+data_register%287%29%3B%0A++++++++when+%22001%22+%3D%3E%0A++++++++++servo_hold_1%286+downto+0%29+%3C%3D+data_register%286+downto+0%29%3B%0A++++++++++servo_hold_1%287%29+%3C%3D+not+data_register%287%29%3B%0A++++++++when+%22010%22+%3D%3E%0A++++++++++servo_hold_2%286+downto+0%29+%3C%3D+data_register%286+downto+0%29%3B%0A++++++++++servo_hold_2%287%29+%3C%3D+not+data_register%287%29%3B%0A++++++++when+%22011%22+%3D%3E%0A++++++++++servo_hold_3%286+downto+0%29+%3C%3D+data_register%286+downto+0%29%3B%0A++++++++++servo_hold_3%287%29+%3C%3D+not+data_register%287%29%3B%0A++++++++when+%22100%22+%3D%3E%0A++++++++++servo_hold_4%286+downto+0%29+%3C%3D+data_register%286+downto+0%29%3B%0A++++++++++servo_hold_4%287%29+%3C%3D+not+data_register%287%29%3B%0A++++++++when+%22101%22+%3D%3E%0A++++++++++servo_hold_5%286+downto+0%29+%3C%3D+data_register%286+downto+0%29%3B%0A++++++++++servo_hold_5%287%29+%3C%3D+not+data_register%287%29%3B%0A++++++++when+%22110%22+%3D%3E%0A++++++++++servo_hold_6%286+downto+0%29+%3C%3D+data_register%286+downto+0%29%3B%0A++++++++++servo_hold_6%287%29+%3C%3D+not+data_register%287%29%3B%0A++++++++when+%22111%22+%3D%3E%0A++++++++++servo_hold_7%286+downto+0%29+%3C%3D+data_register%286+downto+0%29%3B%0A++++++++++servo_hold_7%287%29+%3C%3D+not+data_register%287%29%3B%0A++++++++when+others+%3D%3E%0A++++++++end+case%3B%0A%0A++++++---+update+the+data+registers+from+the+holding+registers%0A++++++---+do+this+at+start+of+period%2C+well+before+they+get+used%0A++++++if%28servo_transfer_en+%3D+%271%27%29+then%0A++++++++servo_data_0+%3C%3D+servo_hold_0%3B%0A++++++++servo_data_1+%3C%3D+servo_hold_1%3B%0A++++++++servo_data_2+%3C%3D+servo_hold_2%3B%0A++++++++servo_data_3+%3C%3D+servo_hold_3%3B%0A++++++++servo_data_4+%3C%3D+servo_hold_4%3B%0A++++++++servo_data_5+%3C%3D+servo_hold_5%3B%0A++++++++servo_data_6+%3C%3D+servo_hold_6%3B%0A++++++++servo_data_7+%3C%3D+servo_hold_7%3B%0A++++++end+if%3B%0A%0A++++++---+set+each+servo+output+low+at+the+appropriate+time%0A++++++---+%28they+were+all+set+high+at+the+same+instant%3A+see+servo+counter+above%29%0A++++++if+%28%28servo_en+%3D+%271%27%29+and+%28servo_counter%2810+downto+8%29+%3D+%22000%22%29%29+then%0A++++++++if+%28servo_counter%287+downto+0%29+%3D+servo_data_0%287+downto+0%29%29+then+---+if+same%0A++++++++++servo_out%280%29+%3C%3D+%270%27%3B+---+set+output+low%0A++++++++end+if%3B%0A++++++++if+%28servo_counter%287+downto+0%29+%3D+servo_data_1%287+downto+0%29%29+then%0A++++++++++servo_out%281%29+%3C%3D+%270%27%3B%0A++++++++end+if%3B%0A++++++++if+%28servo_counter%287+downto+0%29+%3D+servo_data_2%287+downto+0%29%29+then%0A++++++++++servo_out%282%29+%3C%3D+%270%27%3B%0A++++++++end+if%3B%0A++++++++if+%28servo_counter%287+downto+0%29+%3D+servo_data_3%287+downto+0%29%29+then%0A++++++++++servo_out%283%29+%3C%3D+%270%27%3B%0A++++++++end+if%3B%0A++++++++if+%28servo_counter%287+downto+0%29+%3D+servo_data_4%287+downto+0%29%29+then%0A++++++++++servo_out%284%29+%3C%3D+%270%27%3B%0A++++++++end+if%3B%0A++++++++if+%28servo_counter%287+downto+0%29+%3D+servo_data_5%287+downto+0%29%29+then%0A++++++++++servo_out%285%29+%3C%3D+%270%27%3B%0A++++++++end+if%3B%0A++++++++if+%28servo_counter%287+downto+0%29+%3D+servo_data_6%287+downto+0%29%29+then%0A++++++++++servo_out%286%29+%3C%3D+%270%27%3B%0A++++++++end+if%3B%0A++++++++if+%28servo_counter%287+downto+0%29+%3D+servo_data_7%287+downto+0%29%29+then%0A++++++++++servo_out%287%29+%3C%3D+%270%27%3B%0A++++++++end+if%3B%0A++++++end+if%3B%0A++++end+if%3B%0A++end+process+clocked_stuff%3B%0A%0A---+connect+servo+outs+to+the+MKR+pins%0AMKR_D+%3C%3D+servo_out%3B%0A%0Aend+arch_servo_top%3B]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Now I&amp;#39;ll connect the outputs and try to test this ...&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11615&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: VIDOR 4000: Servo Interface</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/vidor-4000-servo-interface</link><pubDate>Fri, 30 Jul 2021 15:11:28 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb451b64-fed0-4c16-9f62-2a8c67a9ed53</guid><dc:creator>shabaz</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Jon,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Great blog, and very useful seeing how you implemented the SPI interface.. I&amp;#39;ve never tried that before, and want to give that a go sometime.&lt;/p&gt;&lt;p&gt;I&amp;#39;ve not used hobby servos often enough to know for sure, but I think 8-bit might not be enough, 9-bit could be better to see visible movement with some servos with a single bit change,&lt;/p&gt;&lt;p&gt;and ballpark 0.6msec to 2.4 msec pulse width allows for the servos that don&amp;#39;t strictly obey the recommended range.&lt;/p&gt;&lt;p&gt;Still, these are just slight changes to the HDL if you experience that whenever you try the servos.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11615&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: VIDOR 4000: Servo Interface</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/vidor-4000-servo-interface</link><pubDate>Fri, 30 Jul 2021 10:16:16 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb451b64-fed0-4c16-9f62-2a8c67a9ed53</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I&amp;#39;ve tackled servos in VHDL &lt;a class="jive-link-blog-small" href="https://www.element14.com/community/people/jancumps/blog/2015/07/15/rotary-encoders--part-5-capturing-input-on-an-fpga"&gt;earlier&lt;/a&gt;, but then I adapted a&amp;nbsp; &lt;a class="jive-link-external-small" href="https://www.hackmeister.dk/2010/07/controlling-an-rc-servo-with-an-fpga/" rel="nofollow ugc noopener" target="_blank"&gt;module from the internet&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;I didn&amp;#39;t start from scratch. I just removed the IEEE.STD_LOGIC_ARITH and IEEE.STD_LOGIC_UNSIGNED libraries, as Michael suggests here.&lt;/p&gt;&lt;p&gt;But not for that reason. I read it they were to be avoided, but I didn&amp;#39;t have the context provided by MK.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11615&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: VIDOR 4000: Servo Interface</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/vidor-4000-servo-interface</link><pubDate>Fri, 30 Jul 2021 08:55:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb451b64-fed0-4c16-9f62-2a8c67a9ed53</guid><dc:creator>michaelkellett</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Thanks for the blog.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;ll offer a couple of suggestions re. the VHDL which I hope may be useful to you and others.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;LIBRARIES&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In your VHDL you have:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; library IEEE;&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; use IEEE.std_logic_1164.all;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---use IEEE.numeric_std.all;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; use ieee.std_logic_arith.all;&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; use ieee.std_logic_unsigned.all;&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The true standard is numeric_std and this should always be used.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt; ieee.std_logic_arith and&amp;nbsp; ieee.std_logic_unsigned are not actually standards and have problems.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;To get lots of information and opinion about why, I suggest Googling - ieee.std_logic_arith.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;To my mind one of the major problems with ...arith and ... unsigned is that they break VHDLs strong typing.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;For example, in your code you declare signal prescaler: &lt;strong&gt;std_logic_vector(7 downto 0);&lt;/strong&gt;&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;and then later you have:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;prescaler &amp;lt;= prescaler - 1;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Prescalar has been declared as std_logic_vector -&amp;nbsp; which is group of logical bits. You use exactly the same declaration for servo_out.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The intention is that prescaler is an integer and that servo_out is 8 independent logic signal bits.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you use numeric.std then you just can&amp;#39;t subtract 1 from a std_logic_vector. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You would need to decalre it as &lt;strong&gt;signal prescaler unsigned(7 downto 0);&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This is good because you are not able to make mistakes like servo_out &amp;lt;= servo_out - 1;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;ARRAYS&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you made servo_hold and servo_data into arrays you could save a great deal of typing (and sources of error).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;But even better you could easily make you code much more flexible so that the exact same code could give you 1, 2 ....n servos.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It wouldn&amp;#39;t use any less resources but it would be much easier to maintain.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;MEMORY BLOCK&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You are using registers for servo_data and servo_hold, but as you mention the FPGA has a great many clock cycles available for &lt;/p&gt;&lt;p&gt;each pulse width step. You could use a memory block in the FPGA for the servo registers and easily manage as many as 64 with no loss of performance.&lt;/p&gt;&lt;p&gt;This is probably not worth the effort for 8 servos (swaps 128 registers for 1 memory block) but at 64 would swap 1024 regsiters for 1 memory block.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I hope this is useful.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;MK&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11615&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: VIDOR 4000: Servo Interface</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/vidor-4000-servo-interface</link><pubDate>Thu, 29 Jul 2021 21:48:36 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb451b64-fed0-4c16-9f62-2a8c67a9ed53</guid><dc:creator>genebren</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Nice blog on VHDL and servo signaling.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=11615&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>