Sunday, 19 June 2011

Sprinter firmware and Sanguinololu

I installed Sprinter firmware into my Sanguinololu

The process has a few niggles I had to work out, so I will mention them here.

Firstly you need to get the Arduino Software from here or if you have Ubuntu 11 you can simply apt-get install arduino

Then you need to get the sanguino software from here
Extract this into the appropriate place your your system.

[edit: only needed for version 1.0 or 1.1 boards]
Once you have extracted the files edit the boards.txt file and change the line
sanguino.upload.protocol=stk500 to  sanguino.upload.protocol=arduino

Without this line Arduino would not upload the firmware, insisting that the hardware ID didn't match.


You also need to get a copy of Sprinter from here

Load up arduino and change your board type to  Sanguino and set your serial port to the one that is connected to your Sanguinololu.

Now load the Sprinter Sketch 

Go to the configuration.h page and edit the line
#define MOTHERBOARD to be #define MOTHERBOARD 62 [for version 1.3a]
 
You also need to edit other parts of this file to match you hardware.

I also don't have any end stops, so I had to disable these, to do this edit pins.h

At the bottom of this file you will find a section that starts with
#elif MOTHERBOARD == 62 [for version 1.3a] 
 
In this section change  
#define X_MIN_PIN
#define Y_MIN_PIN
#define Z_MIN_PIN
 
to all be -1, ie disabled.

Hit compile,there should be no errors

Hit upload and it should upload to the Sanguinololu. It should upload without issues

Sometimes I find arduino just wont connect, I find that pressing the reset button on the
Sanguinololu and the upload button simultainiously seem to get around this.

15 comments:

  1. Does your LED blink when you press the reset button? Mine doesn't, and that leads me to believe that something is wrong with the bootloader... even though I can read it back and verify the flash with my stk500 programmer...

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. The installed LED is directly connected to power, it doesn't blink.
    The LED the bootloader blinks is actually in use by the Pololu, Remove the E-motor pololu and connect in a led and a 1K resistor to the last top and bottom pins of the pololu header, under the power LED. Dir and ground pins on the pololu header. Make sure you get the polarity correct. Also have you set the fuses? if not it will not run the boot code.

    ReplyDelete
  4. yeah - I got everything working - thanks for the reply. I finally got lucky with the reset button timing!

    Now I just need to figure out how to configure support for my steppers.

    ReplyDelete
  5. Unfortunately no metter what I do Arduino still says:
    avrdude stk500_getsync(): not in sync: resp=0x48
    avrdude stk500_disable(): protocol error......

    ReplyDelete
  6. if your Sl is a newer model it has a auto reset jumper, this needs to be on.

    ReplyDelete
  7. When I go to verify the code I get an error.

    The error is on the SD2CARD.CPP tab. About a quarter of the way down the page it has the following text highlighted.

    digitalWrite(chipSelectPin_, HIGH);

    and says "'HIGH' was not declared in this scope"

    Any ides how to fix this?

    ReplyDelete
  8. I had another person with this same issue yesterday, we tracked it down the the version of Arduino compiler. It doesn't currently compile on version 1, install Arduino 0022 from http://www.arduino.cc/en/Main/Software previous IDE Versions section. You many also need to install JDK to run this.

    ReplyDelete
  9. Hi everyone,
    For some reason I get this error when compiling.
    Sprinter.cpp:63:21: error: Arduino.h: No such file or directory
    Do you know what I did wrong?

    Thanks.
    Pierre

    ReplyDelete
  10. Same as above, make sure you are using version 0022 of Arduino, not version 1, Something has changed and it wont compile on that version, yet.

    ReplyDelete
  11. Hello!
    I find this blog in:
    http://reprap.org/wiki/LongboatPrusa#X_axis_assembly

    there are here very useful information to upload sprinter firmware on the sanguinololu.

    After i extracted the files edit the boards.txt file and change the line
    sanguino.upload.protocol=stk500 to sanguino.upload.protocol=arduino

    When I try to upload I get the error that avrdude can´t find "arduino".
    This happens because ...\arduino-0022\hardware\tools\avr\etc\avrdude.conf don´t have "arduino" as a programmer type.
    I already try a lot of possible solutions to solve it but without success... :(

    i need a good sugestion to solve it, thanks!

    Andrei Sousa

    ReplyDelete
    Replies
    1. You don't need to edit boards.txt unless you have a older Sanguinololu (ie version 1.0 or 1.1)

      Arduino 0023 also works fine.

      So delete that version and start again with 0023

      Make sure you have the auto reset jumper in place on a 1.3a
      The jumper labelled AUTO RST on the silkscreen. This is located between the Z stepper motor socket and pins 8-10 of the ATMEGA644P socket. (ive heard of some boards being shipped without pins here, in which case you will need to solder some pins in and then jumper them, or you could just wire it closed, You just wont be able to unplug and plug the board back into a pc without it resetting)

      You do need to download and put in the correct place the sanguino software (in post above), and select sanguino as your board type.

      Then select the correct serial port and it should just upload.

      (check that when you plug in the Sanguinololu to your operating system it sees a new serial port, in device manager for windows, or check your syslog or messages log for Linux, this will also tell you what serial port to use)

      The auto reset pin allows the software to reset your board. When the board is reset it runs the boot loader for a few seconds. The software uses this to upload the rest of the firmware.

      You do have a boot loader installed?

      Delete
    2. Thanks a lot for all the information!

      I´m doing this with Windows7.

      .The board Sanguinololu Rev.1.3a, that i have, have the jumper labelled AUTO RST on the silkscreen;

      .I already have installed Arduino 023 and Sanguino 0018r2, it DONE UPLOADING with no errors;

      .I´m not sure that i havn´t run the boot loader, but if the boot loader is working bad i never have done the uploading of sprinter?
      I can run the boot loader several times?
      I think that all the times i try it give me errors!! but i gave up trying for fear of damage the ATMEGA644P.
      I think it already have been done before i buy it?!

      At this moment i´m trying use RepRap Console in menu XYZ:
      . It already move the motores but allways in same directions
      .i´m sure that the Switch to heat on the extruder is working, but i´m not sure about off.
      .In the bed i do what i saw in the http://reprap.org/wiki/LongboatPrusa#X_axis_assembly, the conections are working perfectly but the sanguinololu is always with 12v and the bed is always getting hot.

      This is the point of situation, i need to try other things but i need some help too.

      Thanks!

      Delete
    3. If you got done uploading, the hard part is done. And the boot loader did its job.

      You can upload the firmware as many times as you need, (limit is about 10,000 times)

      If the axis only moves in one direction you have an issue with your end stops. If the end stops think they have been triggered they will not let the axis move in the homeward direction. Mechanical type end stops are normally configured to be closed and active when open (or disconnected or broken)

      For the hot end set the temperature to something low
      like 40 degrees. And turn it on, Tick the monitor tick box in Pronterface and it will show you the tempuratures as it heating. (and even graph it) it may over shoot 40 but it should then switch off and cool down etc and stabilize at 40. If it doesn't, you have a hardware issue somewhere. Do the same thing for the hot build platform.

      NB check you set the board configuration to type 62 in configuration.h, or the board will not know what pins you have connected where.

      Delete
    4. Your informations were very important, i already start printing!

      Ponterface is very useful to calibrate.

      Calibrate the temperatures is not easy, i have the EPCOS 100K Thermistor, like in the foto: http://reprap.org/wiki/Thermistor, with a termometer i see the real temperatures.

      I start with low temperatures and increase the temperatures, at this point the acuracy is not the best...

      thanks a lot!
      AS

      Delete