{"id":173,"date":"2009-11-19T11:32:31","date_gmt":"2009-11-19T16:32:31","guid":{"rendered":"http:\/\/elegans.uky.edu\/blog\/?p=173"},"modified":"2009-11-19T11:32:31","modified_gmt":"2009-11-19T16:32:31","slug":"pic-servo-control","status":"publish","type":"post","link":"http:\/\/jimlund.org\/blog\/?p=173","title":{"rendered":"PIC servo control"},"content":{"rendered":"<p>Second PIC program, this one moves a hobby servo motor to one of two positions.  The switch needs to be pulled up with a resistor.<\/p>\n<p>It has one light that is always on and a second that switches on\/off when the servo moves.<\/p>\n<p>PIC12F683 servo motor movie:<\/p>\n<p> <object width='480' height='360' id='flvPlayer'><param name='allowFullScreen' value='true'><\/param><param name='movie' value='player.swf?movie=pics\/PIC12F683_servo1.flv&#038;bgcolor=0x051615&#038;fgcolor=0x13ABEC&#038;volume=80&#038;autoload=on&#038;autorewind=on&#038;clickurl=&#038;clicktarget=_self&#038;postimage='><embed src='player.swf?movie=pics\/PIC12F683_servo1.flv&#038;bgcolor=0x051615&#038;fgcolor=0x13ABEC&#038;volume=80&#038;autoload=on&#038;autorewind=on&#038;clickurl=&#038;clicktarget=_self&#038;postimage=' width='480' height='360' allowFullScreen='true' type='application\/x-shockwave-flash'><\/embed><\/param><\/object><\/p>\n<p>Here are the code files: <a href=\"pics\/p12_servo1.asm\">p12_servo1.asm<\/a> and <a href=\"pics\/p12_servo1.hex\">p12_servo1.hex<\/a>.<\/p>\n<p>Assembly of the .asm to a .hex:<br \/>\n>gpasm p12_servo1.asm<\/p>\n<p>Write it to the PIC12 using:<br \/>\nwine &#8220;C:\\Program Files\\PICPgm\\WinPICPgm.exe&#8221;<\/p>\n<p>It is wired as shown in the video.<\/p>\n<p>The servo timing is off from what I calculated.  A calculated 1ms to 2ms gave about 60 degrees of movement, what&#8217;s shown is 0.75 to 1.25 ms pulses every 20 ms.  I haven&#8217;t measured the pulse lengths with a scope.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Second PIC program, this one moves a hobby servo motor to one of two positions. The switch needs to be pulled up with a resistor. It has one light that is always on and a second that switches on\/off when the servo moves. PIC12F683 servo motor movie: Here are the code files: p12_servo1.asm and p12_servo1.hex. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-173","post","type-post","status-publish","format-standard","hentry","category-hobbies"],"_links":{"self":[{"href":"http:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/jimlund.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=173"}],"version-history":[{"count":0,"href":"http:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/173\/revisions"}],"wp:attachment":[{"href":"http:\/\/jimlund.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/jimlund.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/jimlund.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}