gnea / grbl-Mega

An open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on an Arduino Mega2560
https://github.com/gnea/grbl/wiki
Other
495 stars 229 forks source link

Timeout while uploading for Ramps 1.4 #165

Open DomML opened 2 years ago

DomML commented 2 years ago

Hello, I'm trying to compile GRBL-MEGA for my CNC based on a RAMPS 1.4 board (arduino Mega 2560); When I try to compile the normal version (not for ramps), it compile and upload correctly, but when I modify the lines for ramps :

// NOTE: OEMs can avoid the need to maintain/update the defaults.h and cpu_map.h files and use only
// one configuration file by placing their specific defaults and pin map at the bottom of this file.
// If doing so, simply comment out these two defines and see instructions below.
// #define DEFAULTS_GENERIC
// #define CPU_MAP_2560_INITIAL

// To use with RAMPS 1.4 Board, comment out the above defines and uncomment the next two defines
#define DEFAULTS_RAMPS_BOARD
#define CPU_MAP_2560_RAMPS_BOARD

it compile, but it stop uploading at 50% with the message "avrdude: stk500v2_ReceiveMessage(): timeout"

I tried using arduino 2 and arduino_CLI with the same results, so the problem is with the code, but I don't know where to look... Can you help me ? Thanks, D.

sergalpe commented 1 year ago

Try this: Change in cpu_map.h

define X_STEP_BIT 54 // old value ->2 MEGA2560 Digital Pin 24

define Y_STEP_BIT 60// old value ->3 MEGA2560 Digital Pin 25

And in eeprom.c checksum = (checksum << 1) | (checksum >> 7);