{"id":44,"date":"2012-03-09T16:05:00","date_gmt":"2012-03-09T16:05:00","guid":{"rendered":"https:\/\/blog.hslracing.com\/3dprinters\/2012\/03\/09\/firmware-and-making-fumes\/"},"modified":"2012-03-09T16:05:00","modified_gmt":"2012-03-09T16:05:00","slug":"firmware-and-making-fumes","status":"publish","type":"post","link":"https:\/\/blog.hslracing.com\/3dprinters\/2012\/03\/firmware-and-making-fumes.html","title":{"rendered":"Firmware and Making Fumes"},"content":{"rendered":"<p>I was browsing through the new items on <a href=\"http:\/\/www.thingiverse.com\/\">Thingiverse<\/a> when I found an item that made use of a screen and referenced a different firmware &#8211; <a href=\"http:\/\/reprap.org\/wiki\/Marlin\">Marlin<\/a>.<\/p>\n<p>I had a quick read and thought it would be worth a try, cloned the <a href=\"https:\/\/github.com\/ErikZalm\/Marlin\">github<\/a> repository, downloaded yet another version of <a href=\"http:\/\/arduino.cc\/\">Arduino<\/a> (0.22), I now have 4 different versions installed!<\/p>\n<p>Adjusted the configuration.h file and compiled &#8211; first stumbling block, seems a fair bit more configuration is required, not exactly an out of the box solution!<\/p>\n<p>Some more tweaking of the various pin header files later and we have something that will at least compile.<\/p>\n<p>The preferred serial speed is 250000, so I updated my other bluetooth module to the nearest approximation of 230400 and adjust the&nbsp;<a href=\"http:\/\/reprap.org\/wiki\/Marlin\">Marlin<\/a>&nbsp;config accordingly, communications work seamlessly.<\/p>\n<p>I was having a closer look at the pins intended for use with the LCD and it would appear that since this code was originally written for use on an <a href=\"http:\/\/blog.ultimaker.com\/\">Ultimaker<\/a>, or <a href=\"http:\/\/arduino.cc\/en\/Main\/ArduinoBoardMega\">Arduino Mega<\/a> based <a href=\"http:\/\/reprap.org\/wiki\/Ramps\">Ramps<\/a>&nbsp;board, where there are loads of I\/O pins to spare, I was going to need to define some alternatives for me to be able to use the available pins on the <a href=\"http:\/\/reprap.org\/wiki\/Sanguinololu\" style=\"text-align: left\">sanguinololu<\/a>&nbsp;board that I am using.<\/p>\n<p>There are just about enough available &#8211; I need 6 pins for the LCD, 1 for the SD card, 3 for the encoder, and one for the beeper &#8211; there are 10 available, so I will have to forgo the beeper.<\/p>\n<p>Pin definitions as assigned in Sd2PinMap.h for available pins as I have chosen to use them are:<\/p>\n<table>\n<tbody>\n<tr>\n<th>Physical Pin #<\/th>\n<th>Pin Name<\/th>\n<th>Assigned Pin #<\/th>\n<th>Use<\/th>\n<\/tr>\n<tr>\n<td>40<\/td>\n<td>A0<\/td>\n<td>31<\/td>\n<td>SD card SS<\/td>\n<\/tr>\n<tr>\n<td>39<\/td>\n<td>A1<\/td>\n<td>30<\/td>\n<td>Encoder 1<\/td>\n<\/tr>\n<tr>\n<td>38<\/td>\n<td>A2<\/td>\n<td>29<\/td>\n<td>LCD RS<\/td>\n<\/tr>\n<tr>\n<td>37<\/td>\n<td>A3<\/td>\n<td>28<\/td>\n<td>LCD EN<\/td>\n<\/tr>\n<tr>\n<td>36<\/td>\n<td>A4<\/td>\n<td>27<\/td>\n<td>LCD D4<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>B4<\/td>\n<td>4<\/td>\n<td>LCD D7<\/td>\n<\/tr>\n<tr>\n<td>22<\/td>\n<td>C0<\/td>\n<td>16<\/td>\n<td>Encoder C<\/td>\n<\/tr>\n<tr>\n<td>23<\/td>\n<td>C1<\/td>\n<td>17<\/td>\n<td>Encoder 2<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>D2<\/td>\n<td>10<\/td>\n<td>LCD D5<\/td>\n<\/tr>\n<tr>\n<td>17<\/td>\n<td>D3<\/td>\n<td>11<\/td>\n<td>LCD D6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Some of these pins are labelled differently on the&nbsp;<a href=\"http:\/\/reprap.org\/wiki\/Sanguinololu\" style=\"text-align: left\">sanguinololu<\/a>&nbsp;board: B4 is shown as D12, C0 as D16, C1 as D17, D2 as D10 and D3 as D11, these can all be determined by looking at the Extension Header section of the <a href=\"http:\/\/reprap.org\/mediawiki\/images\/8\/83\/Sanguinololu-schematic.jpg\">sanguinololu schematic<\/a>.<\/p>\n<p>Having spent enough time playing on the breadboard, I decided it was high time I actually soldered up the board.<\/p>\n<p>I have another ATmega644p chip, so the one I have been testing is still on the breadboard.<\/p>\n<p>I followed the instructions on the <a href=\"http:\/\/reprap.org\/wiki\/Sanguinololu\">Reprap Wiki<\/a>&nbsp;regarding what order to install the components, but left out all of the ones associated with the FTDI chip.<\/p>\n<p>Looks like my Soldering skills aren&#8217;t too rusty after all.<\/p>\n<div style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-qEpaQggK5so\/T1noAnztvRI\/AAAAAAAAAOc\/O1p_5DR702o\/s1600\/Sanguinololu1.jpg\" style=\"margin-left: 1em;margin-right: 1em\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"184\" src=\"http:\/\/3.bp.blogspot.com\/-qEpaQggK5so\/T1noAnztvRI\/AAAAAAAAAOc\/O1p_5DR702o\/s320\/Sanguinololu1.jpg\" width=\"320\" \/><\/a><\/div>\n<p><\/p>\n<div style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-1zN0O-s9RY8\/T1noBAuNRdI\/AAAAAAAAAOg\/vmOQ1MDvAak\/s1600\/Sanguinololu2.jpg\" style=\"margin-left: 1em;margin-right: 1em\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"208\" src=\"http:\/\/3.bp.blogspot.com\/-1zN0O-s9RY8\/T1noBAuNRdI\/AAAAAAAAAOg\/vmOQ1MDvAak\/s320\/Sanguinololu2.jpg\" width=\"320\" \/><\/a><\/div>\n<div style=\"clear: both;text-align: left\">Had a few issues soldering the <a href=\"http:\/\/reprap.org\/wiki\/Stepstick\">stepstick<\/a> drivers, solder did not want to stick to the board, or flow down the pins. A liberal application of flux soon sorted that out though along with a load more smoke.&nbsp;<\/div>\n<div style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-UQDsstksti8\/T1noBhW_7-I\/AAAAAAAAAOo\/vEYikvUQa3k\/s1600\/Sanguinololu3.jpg\" style=\"margin-left: 1em;margin-right: 1em\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"143\" src=\"http:\/\/2.bp.blogspot.com\/-UQDsstksti8\/T1noBhW_7-I\/AAAAAAAAAOo\/vEYikvUQa3k\/s320\/Sanguinololu3.jpg\" width=\"320\" \/><\/a><\/div>\n<div style=\"clear: both;text-align: left\">Finished <a href=\"http:\/\/reprap.org\/wiki\/Sanguinololu\">sanguinololu<\/a> board with an ATmega644p in place and&nbsp;<a href=\"http:\/\/reprap.org\/wiki\/Stepstick\">stepstick<\/a>&nbsp;drivers installed.&nbsp;<\/div>\n<div style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/--hii__kZ8Vw\/T1noCJwd8KI\/AAAAAAAAAOw\/dHIhjruAuPw\/s1600\/Sanguinololu4.jpg\" style=\"margin-left: 1em;margin-right: 1em\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"170\" src=\"http:\/\/2.bp.blogspot.com\/--hii__kZ8Vw\/T1noCJwd8KI\/AAAAAAAAAOw\/dHIhjruAuPw\/s320\/Sanguinololu4.jpg\" width=\"320\" \/><\/a><\/div>\n<div style=\"clear: both;text-align: left\">Hooked it up to my USBasp programmer via the 6 pin ISP header and burnt the bootloader, then attached my serial programmer to the 6 pin TTL interface and loaded the&nbsp;<a href=\"http:\/\/reprap.org\/wiki\/Marlin\">Marlin<\/a>&nbsp;software.<\/div>\n<div style=\"clear: both;text-align: left\"><\/div>\n<div style=\"clear: both;text-align: left\">Replaced the programmer with a bluetooth module and then connected via PrintRun &#8211; we can see the board via bluetooth.<\/div>\n<div style=\"clear: both;text-align: left\"><\/div>\n<div style=\"clear: both;text-align: left\">You may also notice I have added some legs to the circuit board, these are from my huge stock of spare screws and standoffs from numerous scrapped PCs.<\/div>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was browsing through the new items on Thingiverse when I found an item that made use of a screen and referenced a different firmware &#8211; Marlin. I had a quick read and thought it would be worth a try, cloned the github repository, downloaded yet another version of Arduino (0.22), I now have 4&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/blog.hslracing.com\/3dprinters\/wp-json\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.hslracing.com\/3dprinters\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hslracing.com\/3dprinters\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hslracing.com\/3dprinters\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hslracing.com\/3dprinters\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":0,"href":"https:\/\/blog.hslracing.com\/3dprinters\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.hslracing.com\/3dprinters\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hslracing.com\/3dprinters\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hslracing.com\/3dprinters\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}