{"id":1133,"date":"2011-03-21T00:17:39","date_gmt":"2011-03-21T03:17:39","guid":{"rendered":"http:\/\/tangopardo.com.ar\/2cf7\/?p=1133"},"modified":"2011-03-22T12:18:53","modified_gmt":"2011-03-22T15:18:53","slug":"controlling-an-lb1946-via-usb-with-an-avr","status":"publish","type":"post","link":"https:\/\/tangopardo.com.ar\/2cf7\/2011\/03\/21\/controlling-an-lb1946-via-usb-with-an-avr","title":{"rendered":"Controlling an LB1946 via usb with an AVR"},"content":{"rendered":"<p>The LB1946 is a very nice chopper driver, the only downside is that it has a serial interface. So, for a project I need to control some steppers. I have a box full of printer boards, picked this one from and old epson inkjet because it had the same chips and also looks like I can chop it in half with a hacksaw and use them as they are.<\/p>\n<p>The logic and the original power supply were toast so I used another I had at hand. To make some tests I hacked the <a title=\"PowerSwitch is an example application using Objective Development\u2019s firmware-only USB driver for Atmel\u2019s AVR microcontrollers (V-\" href=\"http:\/\/www.obdev.at\/products\/vusb\/powerswitch.html\">PowerSwitch<\/a> circuit from Objective Development to send raw commands and spin the motor with an usb interface.<\/p>\n<p>At the end it doesn&#8217;t look quite like the original but it works. Still can&#8217;t get more than 1000 steps per second but I think that&#8217;s because of the supply. Now that I have the basic code working I&#8217;ll have to make a parallel interface so I can use them with EMC.<\/p>\n<h3>Sourcecode \/ References:<\/h3>\n<ul>\n<li><a href=\"http:\/\/www.obdev.at\/products\/vusb\/index.html\">V-USB <\/a>a software-only implementation of a low-speed USB device for\u00a0<a href=\"http:\/\/www.atmel.com\/\" target=\"_blank\">Atmel\u2019s<\/a>AVR\u00ae microcontrollers<\/li>\n<li><a href=\"http:\/\/tangopardo.com.ar\/pub\/src\/lb1946_usb.tar.bz2\">lb1946_usb.tar.bz2<\/a> &#8211; Firmware and host software to control the lb1946.<\/li>\n<li><a title=\"LB1946 datasheet\" href=\"http:\/\/tangopardo.com.ar\/pub\/docs\/LB1946.pdf\">LB1946 datasheet<\/a> (local mirror, may be outdated)<\/li>\n<\/ul>\n<h3>Pics:<\/h3>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 33%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div data-carousel-extra='{\"blog_id\":1,\"permalink\":\"https:\\\/\\\/tangopardo.com.ar\\\/2cf7\\\/2011\\\/03\\\/21\\\/controlling-an-lb1946-via-usb-with-an-avr\"}' id='gallery-1' class='gallery galleryid-1133 gallery-columns-3 gallery-size-thumbnail'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/tangopardo.com.ar\/2cf7\/2011\/03\/21\/controlling-an-lb1946-via-usb-with-an-avr\/avr-based-lb1946-controller'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2011\/03\/s7302466-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" aria-describedby=\"gallery-1-1135\" data-attachment-id=\"1135\" data-permalink=\"https:\/\/tangopardo.com.ar\/2cf7\/2011\/03\/21\/controlling-an-lb1946-via-usb-with-an-avr\/avr-based-lb1946-controller\" data-orig-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2011\/03\/s7302466.jpg\" data-orig-size=\"1536,1152\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;2.8&quot;,&quot;credit&quot;:&quot;Adrian Pardini pardo.bsso AT gmail.com - adrian AT tangopardo.com.ar&quot;,&quot;camera&quot;:&quot;&lt;KENOX S730  \\\/ Samsung S730&gt;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1297971819&quot;,&quot;copyright&quot;:&quot;CC BY-SA-NC 2.5 AR Adrian Pardini - pardo.bsso AT gmail.com - adrian AT tangopardo.com.ar&quot;,&quot;focal_length&quot;:&quot;5.8&quot;,&quot;iso&quot;:&quot;100&quot;,&quot;shutter_speed&quot;:&quot;0.033333333333333&quot;,&quot;title&quot;:&quot;avr based LB1946 controller&quot;}\" data-image-title=\"avr based LB1946 controller with usb interface.\" data-image-description=\"&lt;p&gt;avr based LB1946 controller with usb interface.&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;avr based LB1946 controller with usb interface.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2011\/03\/s7302466-300x225.jpg\" data-large-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2011\/03\/s7302466-1024x768.jpg\" \/><\/a>\n\t\t\t<\/dt>\n\t\t\t\t<dd class='wp-caption-text gallery-caption' id='gallery-1-1135'>\n\t\t\t\tavr based LB1946 controller with usb interface.\n\t\t\t\t<\/dd><\/dl>\n\t\t\t<br style='clear: both' \/>\n\t\t<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>The LB1946 is a very nice chopper driver, the only downside is that it has a serial interface. So, for a project I need to control some steppers. I have a box full of printer boards, picked this one from and old epson inkjet because it had the same chips and also looks like I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[32,13,24,22],"tags":[],"class_list":["post-1133","post","type-post","status-publish","format-standard","hentry","category-dumpster-diving","category-electronica","category-hacks","category-software-libre"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pmnbC-ih","_links":{"self":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts\/1133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/comments?post=1133"}],"version-history":[{"count":6,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts\/1133\/revisions"}],"predecessor-version":[{"id":1142,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts\/1133\/revisions\/1142"}],"wp:attachment":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/media?parent=1133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/categories?post=1133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/tags?post=1133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}