Welcome! Log In Create A New Profile

Advanced

Current state of firmware for ATMega168

Posted by Traumflug 
Current state of firmware for ATMega168
June 27, 2010 06:43PM
After wrestling almost the whole weekend with finding a working firmware for the ATMega168 (generation 2 electronics) I think it's a good idea to drop a few lines about my findings.

The firmware expected to work should be GCode_Interpreter, AFAIK. There are at least 3 versions in the Sourceforge repository, use the one at trunk/reprap/firmware/ . Go to parameters.h and comment the #defines for SANGUINO and COMMS_TEST out, leave TEST_MACHINE in. Compile and upload with the Arduino (0018 here) IDE. This should give you sort of a workbench for exercising the steppers and extruders. Should.

For one, the USB connection obviously doesn't know anything about flow control and the help menu of the workbench is sent over and over again, leaving no room for commands. Fixing this was possible with a small while() loop.

Next issue was, serial communication is pretty unreliable, only about 2 of 3 characters reached back the host PC.

Ignoring this, exercising extruder functions works. But steppers won't move. When trying to move X, the Arduino will either hang or reset. Even after I commented all code doing some actual movement out. Just jumping to X_motor_test() caused the hang.

Next step was to remove all occurrences of extruder handling, including the whole extruder.h and extruder.c. THAT made a difference. After commenting out #define TEST_MACHINE as well, the firmware now even responds correctly to commands from the RepRap host software.

To get back what worked in the Darwin days I'll probably have to rewrite the extruder stuff. My guess is, this 1K of RAM is exhausted. For finding out there's even a RAM tester: [www.faludi.com]


Cheers.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Current state of firmware for ATMega168
June 28, 2010 02:03AM
I had v2 electronics and the ram limit went a while ago. I after a bit of fiddling (commenting out for extruder stepper motor control, removing drilling g-codes) I was able to get it working.
Here's my last working version [renoirsrants.blogspot.com]

It's slightly hacked, I added support for constant extruder speed using a sensor, but - if I remember correctly - it should be a simple constant change to turn this off. It's basically the last version that was small enough to fit into the Arduino.

If you're spending much time on this, it might be easier to get one of the Arduino Mega clones out there - I bought one for about £25 - and you can unplug the arduino and plug in the mega - instant upgrade!

Good luck


---
Reprapping blog and other rants: [renoirsrants.blogspot.com]
My Reprap: [sites.google.com]
Re: Current state of firmware for ATMega168
June 28, 2010 04:29AM
Quote

If you're spending much time on this, it might be easier to get one of the Arduino Mega clones out there - I bought one for about £25

Hah! I just waited for such a comment. smiling smiley smiling smiley Seeing how quickly Arduino firmware is a severe case of bit-rot it's even less likely I'll buy newer hardware of that type, as this likely will be outdated next year. Maybe because somebody decides to go from C++ to C#.

IMHO, a much better solution would be to review the RepRap repository to avoid such bit-rot for the future. The more I look through this repo, the more I find fragments of GCode_Interpreter firmware:

ht tps://reprap.svn.sourceforge.net/svnroot/reprap/trunk/darwin/firmware/Arduino/GCode_Interpreter/
ht tps://reprap.svn.sourceforge.net/svnroot/reprap/trunk/darwin/firmware/Arduino/GCode_Interpreter_Experimental/
ht tps://reprap.svn.sourceforge.net/svnroot/reprap/trunk/darwin/firmware/GCode_Interpreter/
ht tps://reprap.svn.sourceforge.net/svnroot/reprap/trunk/darwin/firmware/Sanguino/GCode_Interpreter.old-version/
ht tps://reprap.svn.sourceforge.net/svnroot/reprap/trunk/darwin/firmware/Sanguino/Sanguino3G/gcode/MasterGCodeInterpreter/
ht tps://reprap.svn.sourceforge.net/svnroot/reprap/trunk/reprap/firmware/Arduino/GCode_Interpreter/
ht tps://reprap.svn.sourceforge.net/svnroot/reprap/trunk/reprap/firmware/Arduino/GCode_Interpreter_Experimental/
ht tps://reprap.svn.sourceforge.net/svnroot/reprap/trunk/reprap/firmware/GCode_Interpreter/
ht tps://reprap.svn.sourceforge.net/svnroot/reprap/trunk/reprap/firmware/Sanguino/GCode_Interpreter.old-version/

All of these are GCode interpreters apparently coming from the same root targeting the same goal: Interpret GCode to poke a set of steppers to do a step at the right time. Perhaps some cleanup would help, Subversion has "branching" and "tagging": [svnbook.red-bean.com] It should be possible to just check out an older version or other branch to get e.g. Gen2 electronics working.

And then, there is this: [reprap.org] :-)


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Current state of firmware for ATMega168
July 08, 2010 05:46PM
Indeed as I am using this firmware from the SVN, reprap/mendel/firmware/FiveD_GCode. It would be good to actually know if I am using the correct firmware or not for my Gen3 electronics. (Being Sanguino)

David
Re: Current state of firmware for ATMega168
August 29, 2010 06:29PM
a Lower cost solution to upgrade the memory is £3.20 and swap the 168 for an AtMega 328p

As for the firmware the Joaz / reprap-firmware-fork found here.

http://github.com/Joaz/reprap-firmware-fork

This is a good place to start as it covers most combinations of CPU hardware available.

For Arduino there is triffid/FiveD_on_Arduino [forums.reprap.org]

http://github.com/triffid/FiveD_on_Arduino

Edited 1 time(s). Last edit at 08/29/2010 06:38PM by BodgeIt.


Bodge It [reprap.org]
=======================================

BIQ Sanguinololu SD LCD board BIQ Stepcon BIQ Opto Endstop
BIQ Heater Block PCB BIQ Extruder Peek clamp replacement BIQ Huxley Seedling
BIQ Sanguinololu mounting BIQ standalone Sanguinololu or Ramps mounting Print It Stick It Cut it


My rep strap: [repstrapbertha.blogspot.com]

Buy the bits from B&Q pipestrap [diyrepstrap.blogspot.com]
How to Build a Darwin without any Rep Rap Parts [repstrapdarwin.blogspot.com]
Web Site [www.takeaway3dtech.com]
Sorry, only registered users may post in this forum.

Click here to login