Open MartinLedesma opened 5 years ago
@MartinLedesma there's a different grbl for the mega -> https://github.com/gnea/grbl-Mega
@adammhaile why does the mega have its own?
@wdunn001 Don't know for sure. Was just pointing it out.
@adammhaile why does the mega have its own?
Different pin assignments etc than the Uno so some things need to be changed.
Actually, the whole processor is different - more/different peripherals, etc. Uno uses an ATMega328, the Mega uses an ATMega2560.
@bdurbrow wouldnt the processor not matter though to the codebase it's just a different compile target.
Different pin assignments etc than the Uno so some things need to be changed.
any estimate on how hard it would to add checks for compile target to each pin assignment?
I'm thinking like a configuration file
if (compile target == '2560') { pinForX = 1}
else {
pinForX = 5
}
or use a switchcase for more targets.
then use pinForX variable throughout the application.
It may be way harder than I think lol this isn't my wheelhouse but I'd be willing to help.
There's more differences between the chips than just the pinouts. Timers are different, as are the serial ports. Could the codebases be unified via #ifdef
directive's? Yes... but... that doesn't really provide an advantage; considering that the ARM version is going to be a major re-write; and the AVR versions are considered mature products at this point (only major bugs will be fixed; and as far as we know, there aren't any major bugs). In other words, having them be the same body of code doesn't provide an advantage when they are stable and not being extended with new features.
Also, FWIW, unless you are careful, using regular control flow keywords (if, switch, etc) can end up generating tests that happen at run time instead of at compile time; using the pre-processor makes that impossible to happen. For a codebase that is dependent on real-time performance, as a matter of general programming style, it's a good idea to take approaches that avoid this potential pitfall.
Hi! I'm proving an arduino MEGA 2560 + RAMPS 1.4 + Grbl - mega but I can't get the steppers motors move! I used XLoader and Universal GCode Sender. I had proved with simple code uploaded with Arduino IDE, and the motors worked. Please, a I need some help!