PolargraphSD: Updating Firmware

See also Uploading Precompiled Firmware on the Polargraph Wiki.

The firmware is the software that runs on the PolargraphSD itself.  It’s the program that accepts and interprets the commands coming in from the touch-screen and over the USB connection.  It’s pretty volatile, and it’s important that you are able to update it when I come up with new gizmos (or more likely fixing problems with the existing gizmos).

Method 1: Get a precompiled hex file

The Polargraph software bundle contains a precompiled hex file that can be uploaded onto the PolargraphSD.  Download the most recent PolargraphSD zip package, and unzip on your computer.  The file you want is called polargraph_server_polarshield.cpp.hex, and can be found in the arduino-source\polargraph_server_polarshield subdirectory.

The Arduino IDE internally uses AVRDUDE to upload the sketch once it is compiled. You can use it too.

<path to arduino>/hardware/tools/avr/bin/avrdude
-C<path to arduino>/hardware/tools/avr/etc/avrdude.conf
-v -patmega2560 -carduino -D -b 115200 -cstk500v2
-P<name of serial port>
-Uflash:w:<path to compiled hex file>polargraph_server_polarshield_v1.x_2.4.cpp.hex:i

XLoader:

On Windows, you can get this little tool here (XLoader) which is just a pretty shell around avrdude.

 Incidentally,

If you need to find out where your avrdude is or what some of the settings to use (com port, file locations etc), you can turn on verbose mode for uploading in the Arduino IDE (File -> Preferences), and then you will see the avrdude command scroll past in white after the first line in the console part of the IDE. The actual output of avrdude is in red after that.

Look at this post here to show you what you need to do.

Method 2: Check the source code out of the repository and compile it

  • The source code is hosted online in a github code repository.  Every time I make a change, I commit the change to the repo and then you can download it.
  • The files should go into a folder called polargraph_server_polarshield in your arduino sketch folder.
  • The program has a couple of dependencies that need the following libraries:

    For consistency, I recommend using the versions of the libraries that I have used during development, which are not necessarily the newest versions. Copies of the libraries are saved into the most recent PolargraphSD zip package, so download that, and install the libraries in it (ie copy the library folders into your sketchbook/libraries/ folder).

4 thoughts on “PolargraphSD: Updating Firmware

  1. I have been trying to upload the firmware to my arduino for an hour now and having the same problem. Attached are my error I receive

    I using a Arduino Uno
    Running Arduino 1.0.1
    Downloaded all the files you posted
    Any ideas?

    polargraph_server_a1:68: error: stray ‘#’ in program
    polargraph_server_a1.cpp:326:11: error: exponent has no digits

  2. Hello from France !
    Yesterday, in our fablab here (http://www.labfab.fr) came a man with a polarshield V1.3 who broke the 2.2” lcd screen of his polargraph. He came with a new 2.4” screen bought after august 2014 and didn’t know anything about arduino.
    I came to your great website, dowloaded the github package, installed the libraries, complied successfully with arduino IDE, uncommented the good lines in the .ino file and uploaded the code in the arduinomega. No problem.
    The screen lights up but stays white…
    Please can you help us ? Any advice ?

    P.S.Congrats for this great project. I made a DIY variation of a polar drawer with two steppers last year and i love polar bots (especially delta printers:).
    Pictures here https://plus.google.com/105941003678860500473/posts/BPEvU41yS8k

    Best regards !

    @hugobiwan

    • Hello! It took a while to dig out a v1.3 board to test on, but I ran it ok with the standard polargraph_server_polarshield firmware.

      There are a couple of different driver chips used in those screens though. The ones I have labelled “V2.1” are newer and need

      #define LCD_TYPE TFT01_24_8

      whereas the ones labelled “V1.2” are a bit older and need

      #define LCD_TYPE ITDB24E_8

      Only other thing that might need setting is the calibration string:

      // for the 2.4in screen that is current.
      #define CAL_X 0x03C34136UL
      #define CAL_Y 0x03C0018AUL
      #define CAL_S 0x000EF13FUL

      which should be a file called UTouchCD.h in libraries/UTouch.

      good luck!
      sn

Leave a Reply