diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 4c4ae2447..3261d9a19 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -1050,7 +1050,9 @@ static_assert(1 >= 0 #error "HEATER_0_PIN not defined for this board." #elif !PIN_EXISTS(TEMP_0) && !(defined(MAX6675_SS) && MAX6675_SS >= 0) #error "TEMP_0_PIN not defined for this board." -#elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE) +#elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR))) + #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board." +#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE))) #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board." #elif TEMP_SENSOR_0 == 0 #error "TEMP_SENSOR_0 is required." diff --git a/Marlin/fastio_644.h b/Marlin/fastio_644.h index 6465738d0..0af33ebde 100644 --- a/Marlin/fastio_644.h +++ b/Marlin/fastio_644.h @@ -23,11 +23,37 @@ /** * Pin mapping for the 644, 644p, 644pa, and 1284p * - * 644p 31 30 29 28 27 26 25 24 00 01 02 03 04 05 06 07 16 17 18 19 20 21 22 23 08 09 10 11 12 13 14 15 - * Port A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 + * 644p 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + * Port B0 B1 B2 B3 B4 B5 B6 B7 D0 D1 D2 D3 D4 D5 D6 D7 C0 C1 C2 C3 C4 C5 C6 C7 A7 A6 A5 A4 A3 A2 A1 A0 * Marlin 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 */ +/** ATMega644 + * + * +---\/---+ + * (D 0) PB0 1| |40 PA0 (AI 0 / D31) + * (D 1) PB1 2| |39 PA1 (AI 1 / D30) + * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) + * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) + * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) + * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) + * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) + * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) + * RST 9| |32 AREF + * VCC 10| |31 GND + * GND 11| |30 AVCC + * XTAL2 12| |29 PC7 (D 23) + * XTAL1 13| |28 PC6 (D 22) + * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI + * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO + * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS + * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK + * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA + * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL + * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM + * +--------+ + */ + #ifndef _FASTIO_644 #define _FASTIO_644 diff --git a/Marlin/pinsDebug.h b/Marlin/pinsDebug.h index 03cee3d71..a3886122b 100644 --- a/Marlin/pinsDebug.h +++ b/Marlin/pinsDebug.h @@ -25,7 +25,12 @@ bool endstop_monitor_flag = false; #define NAME_FORMAT "%-35s" // one place to specify the format of all the sources of names // "-" left justify, "28" minimum width of name, pad with blanks -#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7))) +#if AVR_ATmega1284_FAMILY + #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(7) && (P) <= analogInputToDigitalPin(0)) +#else + #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7))) +#endif + /** * This routine minimizes RAM usage by creating a FLASH resident array to diff --git a/Marlin/pinsDebug_list.h b/Marlin/pinsDebug_list.h index 43eff4b21..875b3f04a 100644 --- a/Marlin/pinsDebug_list.h +++ b/Marlin/pinsDebug_list.h @@ -617,15 +617,15 @@ #if PIN_EXISTS(SCK) REPORT_NAME_DIGITAL(__LINE__, SCK_PIN) #endif -#if defined(SCL) && SCL >= 0 - REPORT_NAME_DIGITAL(__LINE__, SCL) -#endif +// #if defined(SCL) && SCL >= 0 +// REPORT_NAME_DIGITAL(__LINE__, SCL) +// #endif #if PIN_EXISTS(SD_DETECT) REPORT_NAME_DIGITAL(__LINE__, SD_DETECT_PIN) #endif -#if defined(SDA) && SDA >= 0 - REPORT_NAME_DIGITAL(__LINE__, SDA) -#endif +// #if defined(SDA) && SDA >= 0 +// REPORT_NAME_DIGITAL(__LINE__, SDA) +// #endif #if defined(SDPOWER) && SDPOWER >= 0 REPORT_NAME_DIGITAL(__LINE__, SDPOWER) #endif diff --git a/platformio.ini b/platformio.ini index b25feb4bc..0579b052d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -51,28 +51,6 @@ build_flags = ${common.build_flags} board_f_cpu = 16000000L lib_deps = ${common.lib_deps} -# -# Printrboard (Teensy 2.0) -# -[env:printrboard] -platform = teensy -framework = arduino -board = teensy20pp -build_flags = ${common.build_flags} -D MOTHERBOARD=BOARD_PRINTRBOARD -# Bug in arduino framework does not allow boards running at 20Mhz -#board_f_cpu = 20000000L -lib_deps = ${common.lib_deps} - -# -# Printrboard Rev.F (Teensy 2.0) -# -[env:printrboard_revf] -platform = teensy -framework = arduino -board = teensy20pp -build_flags = ${common.build_flags} -D MOTHERBOARD=BOARD_PRINTRBOARD_REVF -lib_deps = ${common.lib_deps} - # # Brainwave Pro (Teensy 2.0) # @@ -83,17 +61,6 @@ board = teensy20pp build_flags = ${common.build_flags} -D MOTHERBOARD=BOARD_BRAINWAVE_PRO lib_deps = ${common.lib_deps} -# -# RAMBo -# -[env:rambo] -platform = atmelavr -framework = arduino -board = reprap_rambo -build_flags = ${common.build_flags} -board_f_cpu = 16000000L -lib_deps = ${common.lib_deps} - # # Melzi and clones (ATmega1284p) # @@ -117,6 +84,39 @@ build_flags = ${common.build_flags} upload_speed = 115200 lib_deps = ${common.lib_deps} +# +# Printrboard (Teensy 2.0) +# +[env:printrboard] +platform = teensy +framework = arduino +board = teensy20pp +build_flags = ${common.build_flags} -D MOTHERBOARD=BOARD_PRINTRBOARD +# Bug in arduino framework does not allow boards running at 20Mhz +#board_f_cpu = 20000000L +lib_deps = ${common.lib_deps} + +# +# Printrboard Rev.F (Teensy 2.0) +# +[env:printrboard_revf] +platform = teensy +framework = arduino +board = teensy20pp +build_flags = ${common.build_flags} -D MOTHERBOARD=BOARD_PRINTRBOARD_REVF +lib_deps = ${common.lib_deps} + +# +# RAMBo +# +[env:rambo] +platform = atmelavr +framework = arduino +board = reprap_rambo +build_flags = ${common.build_flags} +board_f_cpu = 16000000L +lib_deps = ${common.lib_deps} + # # Sanguinololu (ATmega644p) # @@ -126,3 +126,14 @@ framework = arduino board = sanguino_atmega644p build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} + +# +# Sanguinololu (ATmega1284p) +# +[env:sanguino_atmega1284p] +platform = atmelavr +framework = arduino +board = sanguino_atmega1284p +build_flags = ${common.build_flags} +lib_deps = ${common.lib_deps} +