From 3e92fef3b434e72bf31f913d03f12dacfd2ddf17 Mon Sep 17 00:00:00 2001 From: Rob Brown Date: Thu, 17 Oct 2013 17:05:08 +0800 Subject: [PATCH] Update Pin Change Interrupts so it works PCIE1 - Interrupt 8 on the Mega is attached to USART0 RX so when any serial communication was transmitted it was triggering the Reset Interrupt --- pin_map.h | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/pin_map.h b/pin_map.h index 6efd286..2d9cd57 100644 --- a/pin_map.h +++ b/pin_map.h @@ -97,12 +97,18 @@ #endif -#ifdef PIN_MAP_ARDUINO_MEGA_2560 // Unsupported. Doesn't work. Supplied by @elmom. +#ifdef PIN_MAP_ARDUINO_MEGA_2560 // Working @EliteEng // Serial port pins #define SERIAL_RX USART0_RX_vect #define SERIAL_UDRE USART0_UDRE_vect + // Increase Buffers to make use of extra SRAM + #define RX_BUFFER_SIZE 256 + #define TX_BUFFER_SIZE 128 + #define BLOCK_BUFFER_SIZE 36 + #define LINE_BUFFER_SIZE 100 + // NOTE: All step bit and direction pins must be on the same port. #define STEPPING_DDR DDRA #define STEPPING_PORT PORTA @@ -110,11 +116,9 @@ #define X_STEP_BIT 0 // MEGA2560 Digital Pin 22 #define Y_STEP_BIT 1 // MEGA2560 Digital Pin 23 #define Z_STEP_BIT 2 // MEGA2560 Digital Pin 24 - // #define C_STEP_BIT 3 // MEGA2560 Digital Pin 25 #define X_DIRECTION_BIT 4 // MEGA2560 Digital Pin 26 #define Y_DIRECTION_BIT 5 // MEGA2560 Digital Pin 27 #define Z_DIRECTION_BIT 6 // MEGA2560 Digital Pin 28 - // #define C_DIRECTION_BIT 7 // MEGA2560 Digital Pin 29 #define STEP_MASK ((1<