Welcome! Log In Create A New Profile

Advanced

Gen7 working with Marlin_v1

Posted by droftarts 
Re: Gen7 working with Marlin_v1
February 20, 2012 06:16AM
Hi scuba/phord
I'm not really sure about what fuses are, I'm still learning my way around firmware. I guess Marlin works for me without changing anything else because I removed the heated bed mosfet and don't have anything attached to the heated bed thermistor or heater header. Just dumb luck on my part!

If the fuses are changed, does this mean that the Gen7 won't be compatible with other firmware that does work, eg Teacup? Could you give some clear instructions about how to change the fuses if it's not just a firmware change? I'd like to solder a new mosfet back on my board and get the heated bed working again.
Re: Gen7 working with Marlin_v1
February 20, 2012 08:23AM
Fuses are used to configure special options on your chip. For example : define size / address for the bootloader; configure brown-out detection; keep eeprom memory stored during resets ;and so on ...
There are 3 fuses (which are in hexadecimal format) you have to deal with: low-fuse, high-fuse and extended-fuse. [www.engbedded.com] -> Fuse Calculator

You have to set your fuses right before you can upload your bootloader. You can do this with avrdude.exe which comes with arduino ide. Take a look at [reprap.org], there is a very detailed documentation on how to write fuses to the chip.

The fuses I've changed tells the chip to keep the eeprom storage during resets (I think you'll need this for every firmware which stores it's config to eeprom) and sets the brown-out detection to 2,7 V. So it shouldn't be a problem to use them with any other firmware.
Re: Gen7 working with Marlin_v1
February 23, 2012 03:43AM
ErikZalm has just merged the changes for GEN7 together with some other pull requests to the "Test" branch. Would be great if you cold try it and give some response.
Re: Gen7 working with Marlin_v1
February 23, 2012 12:09PM
scuba, that's great news. I'm a bit busy at the moment, and away this weekend, but will try and test it next week. Of course, I still have the issue that I don't have the heated bed running through my Gen7, and I don't see the brown-out issue because I disabled the heated bed in the firmware. However, I'm planning on fixing the mosfet, and running the heated bed from the Gen7, so I'll report back how I get on.
Re: Gen7 working with Marlin_v1
February 27, 2012 05:35PM
Cool. But the merge isn't clean yet. I'm working on it, and I got it to build now. But it won't drive my motors. I think there's an endstop config getting in the way. Haven't had time to dig that far yet.
Re: Gen7 working with Marlin_v1
February 28, 2012 03:05AM
That might be true.I haven't tried the latest build but I think they offered the generic Configuration.h in the merge. You may have to invert the endstops..
Re: Gen7 working with Marlin_v1
February 29, 2012 12:47AM
Sorry for bing such a noob, but does can anyone explain why I am getting these errors when I go to compile scuba's Marlin.pde?
In file included from cardreader.cpp:1:
/Marlin.h:47:21: error: WString.h: No such file or directory
In file included from /Marlin.h:38,
                 from cardreader.cpp:1:
MarlinSerial.h:115: error: expected ',' or '...' before '&' token
MarlinSerial.h:115: error: ISO C++ forbids declaration of 'String' with no type
MarlinSerial.h:134: error: expected ',' or '...' before '&' token
MarlinSerial.h:134: error: ISO C++ forbids declaration of 'String' with no type
/MarlinSerial.h: In member function 'void MarlinSerial::print(int)':
MarlinSerial.h:117: error: 's' was not declared in this scope
In file included from cardreader.cpp:3:
/ultralcd.h: At global scope:
ultralcd.h:30: error: expected unqualified-id before '{' token
cardreader.cpp: In member function 'void CardReader::checkautostart(bool)':
cardreader.cpp:353: error: 'tolower' was not declared in this scope
cardreader.cpp:362: error: 'tolower' was not declared in this scope
I got the Gen 7 SetupTest file working properly, but I have no clue what's going on here. Tried it on IDE's 0022 to 1.0.
Re: Gen7 working with Marlin_v1
February 29, 2012 04:45AM
error: WString.h: No such file or directory
This file should be located in the Arduino Support Directory for GEN7. I think you're not using the GEN7 Support Files attached to my repo?!

But .... my changes has been merged to the official Marlin RC2. So you should use this !

Edited 1 time(s). Last edit at 02/29/2012 04:49AM by scuba.
Re: Gen7 working with Marlin_v1
February 29, 2012 01:17PM
Haha, sorry smiling smiley It works now.
Re: Gen7 working with Marlin_v1
March 05, 2012 05:33PM
I set the fuses and have moved past the reseting problems.

Moved to power supply problems....

Power Support #1, claimed 500W, 34A 12Volt rating.
When I turn on my bed heater the software locks-up, and stops taking commands.
I found that if I unplug the headed bed the temps are getting reported correctly.

2nd power supply, claimed 430W, 28A 12Volts allowed the bed and extrude to come up to temp.
The system locked up when a stepper and the heater engaged at the same time.

Dwayne
Re: Gen7 working with Marlin_v1
March 05, 2012 06:55PM
Have you seen this thread: [forums.reprap.org]. There is a problem with the ground routing on GEN7 and the thermistor routing.


[www.hydraraptor.blogspot.com]
Re: Gen7 working with Marlin_v1
March 08, 2012 03:22AM
Today Marlin got a pull request which should resolve the fixed 16MHz issue. Actually you have to recalculate the speed_lookuptable manually via an included perl script. I haven't tried it yet but it would be great if a 20Mhz Gen7 would work without any speed issues afterwards. Thanks in advance to bgamari!
Re: Gen7 working with Marlin_v1
March 10, 2012 11:29AM
Hi scuba, all,

I'm having precisely the same error as Legot described - to do with WString.h, etc.

scuba Wrote:
-------------------------------------------------------
> error: WString.h: No such file or directory
> This file should be located in the Arduino Support
> Directory for GEN7. I think you're not using the
> GEN7 Support Files attached to my repo?!

Could you elaborate on what you mean by this by any chance? I.e. how exactly do we "use the GEN7 support files" attached to the repository?

> But .... my changes has been merged to the
> official Marlin RC2. So you should use this !

I'm using the official Marlin code from github.
$ git branch -a
* Marlin_v1
  remotes/origin/HEAD -> origin/Marlin_v1
  remotes/origin/Marlin_v1
  remotes/origin/Test
  remotes/origin/master

(My motors weren't working with Teacup firmware so I thought I'd try Marlin.)
Re: Gen7 working with Marlin_v1
March 10, 2012 11:36AM
Ok. I simply copied the contents of the Gen7 subdirectory that comes with the Marlin distribution to $ARDUINO_DIR/hardware/Gen7/ - and that seems to have solved the afore-mentioned problem. (I didn't think I would need to do that because I already have a Gen7 subdirectory in $ARDUINO_DIR/hardware/, but anyway ...).
Re: Gen7 working with Marlin_v1
March 10, 2012 05:37PM
Can anyone shed light on this error I'm receiving when trying to compile the Marlin firmware?
In file included from /usr/share/arduino/libraries/LiquidCrystal/LiquidCrystal.cpp:1:0:
/usr/share/arduino/libraries/LiquidCrystal/LiquidCrystal.h:82:11: error: ‘size_t’ does not name a type
/usr/share/arduino/libraries/LiquidCrystal/LiquidCrystal.cpp:261:15: error: prototype for ‘size_t LiquidCrystal::write(uint8_t)’ does not match any in class ‘LiquidCrystal’
/usr/share/arduino/hardware/Gen7/cores/arduino/Print.h:37:18: error: candidate is: virtual void Print::write(uint8_t)

Edited 1 time(s). Last edit at 03/10/2012 05:49PM by dslc.
Re: Gen7 working with Marlin_v1
March 11, 2012 01:02PM
Hi dslc! Glad you found the way how to implement the GEN7 Arduino Support Files. winking smiley The reason why I've added them was because the WString.h is missing in the original GEn7 support files from Traumflug.
Re: Gen7 working with Marlin_v1
March 11, 2012 01:14PM
hey does this work with a 20mhz crystal or just a 16? I'm curious
terramir
Re: Gen7 working with Marlin_v1
March 11, 2012 06:49PM
terramir Wrote:
-------------------------------------------------------
> hey does this work with a 20mhz crystal or just a
> 16? I'm curious
> terramir


It works with 20mhz, but because the math for 16mhz is hard coded into the Marlin firmware, Everything runs at about 25% faster than it should.

I.E. If you set something to take 1 second, it will take about .75 seconds
Re: Gen7 working with Marlin_v1
March 12, 2012 04:37AM
No! Thats not true anymore smiling bouncing smiley
Since yesterday Marlin got 20 MHz support! At the moment it can cope 16 or 20 MHz. For this the speedlookuptables are still hardcoded but uses the F_CPU variable from arduino ide to configure the correct one. So you only have to set the correct board in arduino ide. The first tests looked very promissing.Haven't tried to print yet.
Re: Gen7 working with Marlin_v1
March 12, 2012 03:23PM
grinning smiley so maybe in a little while we will have a fully functioning marlin firmware for this board grinning smiley
guys keep up the good work
grinning smiley
terramir
Re: Gen7 working with Marlin_v1
March 18, 2012 12:53AM
FWIW - I downloaded RC2 to use it with my 1.3 Gen7 board. Some notes on additional things I had to modify to get it to work:

  • Make custom thermistor lookup tables (I needed 2 since I'm using 2 different resistor values)
  • I still had to comment out additional kill() errors to keep it from killing at startup
  • Had to run the "create speed lookup table" python script - it wants "20" for Mhz and use the default 8 divider
  • I had to set it to use 115200 baud - I could not get 250000 to work
  • I set all endstop_inverting to "false" (opto endtops)
  • I set all INVERT_DIR axes to false
  • I set all HOME_DIR To -1 (minimums)
  • Set all the _ENABLE_ON axes to '0' (active low for Pololu boards)
  • Obviously I also had to set all the steps/mm, etc.

That's everything I can think of, but I may have tweaked a few other things. I think those are the biggies though. Oh - and I still had to hotwire the power supply to be on all the time - the P/S On control doesn't seem to work...maybe there's another setting that needs tweaking.

Edited 1 time(s). Last edit at 03/18/2012 12:56AM by JazzyMT.
Re: Gen7 working with Marlin_v1
March 18, 2012 01:14AM
Oh...now I feel like an idiot. There's a unique M command to turn on the P/S - M80.

Maybe I'll try that tomorrow. Time for bed.
Re: Gen7 working with Marlin_v1
March 18, 2012 06:21PM
[email protected]> Moved to power supply problems....

nophead>There is a problem with the ground routing on GEN7 and the thermistor routing.

My power power problems have been fixed via the board rework. I move the thermistor to the standby 5V, and cut and rerouted the ground lines.

I can engage the stepper motors with both extruder and bed heater on without anything locking-up.

Dwayne
Re: Gen7 working with Marlin_v1
March 19, 2012 04:28AM
JazzyMT Wrote:
> [*] Had to run the "create speed lookup table"
> python script - it wants "20" for Mhz and use the
> default 8 divider

Sure??? As far as I can see Erik has hardcoded the values for 20MHz into the speedlookuptable.h. If you've set the F_CPU value in your IDE correctly the right table should be chosen. I've done it this way and my moving speed seems to be correct!

To the other points... yes allways have to configure firmware parameters to the needs of your machine.
Re: Gen7 working with Marlin_v1
March 19, 2012 12:20PM
No, not sure. I was having problems with the 250000 baud to begin with so its possible it could have worked right off the bat if I had just switched to 115200 baud. Not sure what the 250000 prob is..

Also, M80/M81 work perfectly for turning on the power supply - no need to short circuit
Re: Gen7 working with Marlin_v1
March 19, 2012 07:41PM
I couldn't get my self-etched Gen7 v1.2 board to work at 250000 baud. I also can't get my power supply to switch off with M81, even though I disable motors, is it on a timer? However, I'm still using scuba's version of Marlin, so I should probably update to RC2, and use the correct timing too.
Re: Gen7 working with Marlin_v1
March 20, 2012 10:38AM
Hrm - M81 works instantly on my self-etched 1.3 board w/RC2. Do you need to use M80 to turn the P/S on initially or does it start on already? Might have the logic reversed..
Re: Gen7 working with Marlin_v1
April 25, 2012 03:27PM
Hi Jazzy, droftarts, scuba,

Please note that the asynchronous serial protocol standard is very tolerant to bit rate differences. For a usual 10 bit (8n1) word there can be a total of almost 5% timing error between the sender and receiver (a total of 50% of a bit over the 10 bits as the bits are sampled in mid period based on the leading edge of the start bit). That is you can be out by a whole integer in a counter loop if the divider has at least a value of 20. Not sure what the divider sits at on the ATmega at 16 and 20 MHz for 115200 bps but I would recommend sticking to popular bit rates if there is no good reason to deviate even if the dividers and bit rates don't come out as exact integers.

JazzyMT Wrote:
> No, not sure. I was having problems with the
> 250000 baud to begin with so its possible it could
> have worked right off the bat if I had just
> switched to 115200 baud. Not sure what the 250000
> prob is..

Kalle
--
Johannesburg, South Africa
Re: Gen7 working with Marlin_v1
April 26, 2012 04:45AM
Something the the temperature code is unhappy causing my resets.
Re: Gen7 working with Marlin_v1
April 26, 2012 02:30PM
KalleP Wrote:
-------------------------------------------------------
> Hi Jazzy, droftarts, scuba,
>
> Not sure what
> the divider sits at on the ATmega at 16 and 20 MHz
> for 115200 bps but I would recommend sticking to
> popular bit rates if there is no good reason to
> deviate even if the dividers and bit rates don't
> come out as exact integers.
>
> Kalle
> --
> Johannesburg, South Africa

I don't understand your point. 115200 bps is THE most common rate in modern devices. I didn't change to it for no good reason - 250k would not work. I tried to read it on my logic analyzer and the timing was all screwed up. I don't know what the cause was, but it works fine at 115k so that's what I'm using. If someone else has trouble communicating at 250k, I'd recommend they try 115k too.
Sorry, only registered users may post in this forum.

Click here to login