Merge pull request #6889 from thinkyhead/bf_at90usb_mapping

Unify all AVR90USB pin mappings
master
Scott Lahteine 8 years ago committed by GitHub
commit f17a3c2474

@ -732,9 +732,7 @@ void report_current_position_detail();
SERIAL_ECHOPAIR(", ", y); SERIAL_ECHOPAIR(", ", y);
SERIAL_ECHOPAIR(", ", z); SERIAL_ECHOPAIR(", ", z);
SERIAL_CHAR(')'); SERIAL_CHAR(')');
if (suffix) serialprintPGM(suffix); else SERIAL_EOL();
if (suffix) {serialprintPGM(suffix);} //won't compile for Teensy with the previous construction
else SERIAL_EOL();
} }
void print_xyz(const char* prefix, const char* suffix, const float xyz[]) { void print_xyz(const char* prefix, const char* suffix, const float xyz[]) {
@ -6366,23 +6364,44 @@ inline void gcode_M42() {
wait = parser.seen('W') ? parser.value_int() : 500; wait = parser.seen('W') ? parser.value_int() : 500;
for (uint8_t pin = start; pin <= end; pin++) { for (uint8_t pin = start; pin <= end; pin++) {
//report_pin_state_extended(pin, I_flag, false);
if (!I_flag && pin_is_protected(pin)) { if (!I_flag && pin_is_protected(pin)) {
SERIAL_ECHOPAIR("Sensitive Pin: ", pin); report_pin_state_extended(pin, I_flag, true, "Untouched ");
SERIAL_ECHOLNPGM(" untouched."); SERIAL_EOL();
} }
else { else {
SERIAL_ECHOPAIR("Pulsing Pin: ", pin); report_pin_state_extended(pin, I_flag, true, "Pulsing ");
#ifdef AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO
if (pin == 46) {
SET_OUTPUT(46);
for (int16_t j = 0; j < repeat; j++) {
WRITE(46, 0); safe_delay(wait);
WRITE(46, 1); safe_delay(wait);
WRITE(46, 0); safe_delay(wait);
}
}
else if (pin == 47) {
SET_OUTPUT(47);
for (int16_t j = 0; j < repeat; j++) {
WRITE(47, 0); safe_delay(wait);
WRITE(47, 1); safe_delay(wait);
WRITE(47, 0); safe_delay(wait);
}
}
else
#endif
{
pinMode(pin, OUTPUT); pinMode(pin, OUTPUT);
for (int16_t j = 0; j < repeat; j++) { for (int16_t j = 0; j < repeat; j++) {
digitalWrite(pin, 0); digitalWrite(pin, 0); safe_delay(wait);
safe_delay(wait); digitalWrite(pin, 1); safe_delay(wait);
digitalWrite(pin, 1); digitalWrite(pin, 0); safe_delay(wait);
safe_delay(wait);
digitalWrite(pin, 0);
safe_delay(wait);
} }
} }
SERIAL_CHAR('\n');
}
SERIAL_EOL();
} }
SERIAL_ECHOLNPGM("Done."); SERIAL_ECHOLNPGM("Done.");
@ -6527,13 +6546,13 @@ inline void gcode_M42() {
* M43 E<bool> - Enable / disable background endstop monitoring * M43 E<bool> - Enable / disable background endstop monitoring
* - Machine continues to operate * - Machine continues to operate
* - Reports changes to endstops * - Reports changes to endstops
* - Toggles LED when an endstop changes * - Toggles LED_PIN when an endstop changes
* - Can not reliably catch the 5mS pulse from BLTouch type probes * - Can not reliably catch the 5mS pulse from BLTouch type probes
* *
* M43 T - Toggle pin(s) and report which pin is being toggled * M43 T - Toggle pin(s) and report which pin is being toggled
* S<pin> - Start Pin number. If not given, will default to 0 * S<pin> - Start Pin number. If not given, will default to 0
* L<pin> - End Pin number. If not given, will default to last pin defined for this board * L<pin> - End Pin number. If not given, will default to last pin defined for this board
* I - Flag to ignore Marlin's pin protection. Use with caution!!!! * I<bool> - Flag to ignore Marlin's pin protection. Use with caution!!!!
* R - Repeat pulses on each pin this number of times before continueing to next pin * R - Repeat pulses on each pin this number of times before continueing to next pin
* W - Wait time (in miliseconds) between pulses. If not given will default to 500 * W - Wait time (in miliseconds) between pulses. If not given will default to 500
* *
@ -6542,7 +6561,7 @@ inline void gcode_M42() {
*/ */
inline void gcode_M43() { inline void gcode_M43() {
if (parser.seen('T')) { // must be first ot else it's "S" and "E" parameters will execute endstop or servo test if (parser.seen('T')) { // must be first or else it's "S" and "E" parameters will execute endstop or servo test
toggle_pins(); toggle_pins();
return; return;
} }
@ -6576,6 +6595,7 @@ inline void gcode_M42() {
for (int8_t pin = first_pin; pin <= last_pin; pin++) { for (int8_t pin = first_pin; pin <= last_pin; pin++) {
if (pin_is_protected(pin) && !ignore_protection) continue; if (pin_is_protected(pin) && !ignore_protection) continue;
pinMode(pin, INPUT_PULLUP); pinMode(pin, INPUT_PULLUP);
delay(1);
/* /*
if (IS_ANALOG(pin)) if (IS_ANALOG(pin))
pin_state[pin - first_pin] = analogRead(pin - analogInputToDigitalPin(0)); // int16_t pin_state[...] pin_state[pin - first_pin] = analogRead(pin - analogInputToDigitalPin(0)); // int16_t pin_state[...]
@ -6591,7 +6611,7 @@ inline void gcode_M42() {
for (;;) { for (;;) {
for (int8_t pin = first_pin; pin <= last_pin; pin++) { for (int8_t pin = first_pin; pin <= last_pin; pin++) {
if (pin_is_protected(pin)) continue; if (pin_is_protected(pin) && !ignore_protection) continue;
const byte val = const byte val =
/* /*
IS_ANALOG(pin) IS_ANALOG(pin)
@ -6600,7 +6620,7 @@ inline void gcode_M42() {
//*/ //*/
digitalRead(pin); digitalRead(pin);
if (val != pin_state[pin - first_pin]) { if (val != pin_state[pin - first_pin]) {
report_pin_state(pin); report_pin_state_extended(pin, ignore_protection, false);
pin_state[pin - first_pin] = val; pin_state[pin - first_pin] = val;
} }
} }
@ -6612,14 +6632,14 @@ inline void gcode_M42() {
} }
#endif #endif
safe_delay(500); safe_delay(200);
} }
return; return;
} }
// Report current state of selected pin(s) // Report current state of selected pin(s)
for (uint8_t pin = first_pin; pin <= last_pin; pin++) for (uint8_t pin = first_pin; pin <= last_pin; pin++)
report_pin_state_extended(pin, ignore_protection); report_pin_state_extended(pin, ignore_protection, true);
} }
#endif // PINS_DEBUGGING #endif // PINS_DEBUGGING
@ -12164,7 +12184,9 @@ void prepare_move_to_destination() {
val &= 0x07; val &= 0x07;
switch (digitalPinToTimer(pin)) { switch (digitalPinToTimer(pin)) {
#ifdef TCCR0A #ifdef TCCR0A
#if !AVR_AT90USB1286_FAMILY
case TIMER0A: case TIMER0A:
#endif
case TIMER0B: case TIMER0B:
//_SET_CS(0, val); //_SET_CS(0, val);
break; break;

@ -71,7 +71,7 @@
#define BOARD_PRINTRBOARD_REVF 811 // Printrboard Revision F (AT90USB1286) #define BOARD_PRINTRBOARD_REVF 811 // Printrboard Revision F (AT90USB1286)
#define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646) #define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646)
#define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286) #define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286)
#define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84 make #define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: HARDWARE_MOTHERBOARD=84 make
#define BOARD_BRAINWAVE_PRO 85 // Brainwave Pro (AT90USB1286) #define BOARD_BRAINWAVE_PRO 85 // Brainwave Pro (AT90USB1286)
#define BOARD_GEN3_PLUS 9 // Gen3+ #define BOARD_GEN3_PLUS 9 // Gen3+
#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics #define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics

@ -32,27 +32,25 @@
#include <avr/io.h> #include <avr/io.h>
#include "macros.h" #include "macros.h"
/** #define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__))
* Enable this option to use Teensy++ 2.0 assignments for AT90USB processors. #define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__))
*/ #define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__))
//#define AT90USBxx_TEENSYPP_ASSIGNMENTS #define AVR_ATmega2561_FAMILY (defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__))
#define AVR_ATmega328_FAMILY (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328p__))
/** /**
* Include Ports and Functions * Include Ports and Functions
*/ */
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) #if AVR_ATmega328_FAMILY
#include "fastio_168.h" #include "fastio_168.h"
#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__) #elif AVR_ATmega1284_FAMILY
#include "fastio_644.h" #include "fastio_644.h"
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) #elif AVR_ATmega2560_FAMILY
#include "fastio_1280.h" #include "fastio_1280.h"
#elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) #elif AVR_AT90USB1286_FAMILY
#ifdef AT90USBxx_TEENSYPP_ASSIGNMENTS #include "fastio_AT90USB.h"
#include "fastio_AT90USB-Teensy.h" #elif AVR_ATmega2561_FAMILY
#else
#include "fastio_AT90USB-Marlin.h"
#endif
#elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
#include "fastio_1281.h" #include "fastio_1281.h"
#else #else
#error "Pins for this chip not defined in Arduino.h! If you have a working pins definition, please contribute!" #error "Pins for this chip not defined in Arduino.h! If you have a working pins definition, please contribute!"
@ -243,11 +241,6 @@ typedef enum {
/** /**
* PWM availability macros * PWM availability macros
*/ */
#define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__))
#define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__))
#define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__))
#define AVR_ATmega2561_FAMILY (defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__))
#define AVR_ATmega328_FAMILY (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328p__))
//find out which harware PWMs are already in use //find out which harware PWMs are already in use
#if PIN_EXISTS(CONTROLLER_FAN) #if PIN_EXISTS(CONTROLLER_FAN)

@ -1,681 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Pin mapping (Marlin) for AT90USB646, 647, 1286, and 1287
*
* AT90USB 51 50 49 48 47 46 45 44 10 11 12 13 14 15 16 17 35 36 37 38 39 40 41 42 25 26 27 28 29 30 31 32 33 34 43 09 18 19 01 02 61 60 59 58 57 56 55 54
* Teensy 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45
* 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 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7
* > 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
* The pins 46 and 47 are not supported by Teensyduino, but are supported below.
*/
#ifndef _FASTIO_AT90USB
#define _FASTIO_AT90USB
#include "fastio.h"
// change for your board
#define DEBUG_LED DIO31 /* led D5 red */
// SPI
#define SCK DIO9 // 21
#define MISO DIO11 // 23
#define MOSI DIO10 // 22
#define SS DIO8 // 20
// Digital I/O
#define DIO0_PIN PINA0
#define DIO0_RPORT PINA
#define DIO0_WPORT PORTA
#define DIO0_PWM NULL
#define DIO0_DDR DDRA
#define DIO1_PIN PINA1
#define DIO1_RPORT PINA
#define DIO1_WPORT PORTA
#define DIO1_PWM NULL
#define DIO1_DDR DDRA
#define DIO2_PIN PINA2
#define DIO2_RPORT PINA
#define DIO2_WPORT PORTA
#define DIO2_PWM NULL
#define DIO2_DDR DDRA
#define DIO3_PIN PINA3
#define DIO3_RPORT PINA
#define DIO3_WPORT PORTA
#define DIO3_PWM NULL
#define DIO3_DDR DDRA
#define DIO4_PIN PINA4
#define DIO4_RPORT PINA
#define DIO4_WPORT PORTA
#define DIO4_PWM NULL
#define DIO4_DDR DDRA
#define DIO5_PIN PINA5
#define DIO5_RPORT PINA
#define DIO5_WPORT PORTA
#define DIO5_PWM NULL
#define DIO5_DDR DDRA
#define DIO6_PIN PINA6
#define DIO6_RPORT PINA
#define DIO6_WPORT PORTA
#define DIO6_PWM NULL
#define DIO6_DDR DDRA
#define DIO7_PIN PINA7
#define DIO7_RPORT PINA
#define DIO7_WPORT PORTA
#define DIO7_PWM NULL
#define DIO7_DDR DDRA
#define DIO8_PIN PINB0
#define DIO8_RPORT PINB
#define DIO8_WPORT PORTB
#define DIO8_PWM NULL
#define DIO8_DDR DDRB
#define DIO9_PIN PINB1
#define DIO9_RPORT PINB
#define DIO9_WPORT PORTB
#define DIO9_PWM NULL
#define DIO9_DDR DDRB
#define DIO10_PIN PINB2
#define DIO10_RPORT PINB
#define DIO10_WPORT PORTB
#define DIO10_PWM NULL
#define DIO10_DDR DDRB
#define DIO11_PIN PINB3
#define DIO11_RPORT PINB
#define DIO11_WPORT PORTB
#define DIO11_PWM NULL
#define DIO11_DDR DDRB
#define DIO12_PIN PINB4
#define DIO12_RPORT PINB
#define DIO12_WPORT PORTB
#define DIO12_PWM NULL
#define DIO12_DDR DDRB
#define DIO13_PIN PINB5
#define DIO13_RPORT PINB
#define DIO13_WPORT PORTB
#define DIO13_PWM NULL
#define DIO13_DDR DDRB
#define DIO14_PIN PINB6
#define DIO14_RPORT PINB
#define DIO14_WPORT PORTB
#define DIO14_PWM NULL
#define DIO14_DDR DDRB
#define DIO15_PIN PINB7
#define DIO15_RPORT PINB
#define DIO15_WPORT PORTB
#define DIO15_PWM NULL
#define DIO15_DDR DDRB
#define DIO16_PIN PINC0
#define DIO16_RPORT PINC
#define DIO16_WPORT PORTC
#define DIO16_PWM NULL
#define DIO16_DDR DDRC
#define DIO17_PIN PINC1
#define DIO17_RPORT PINC
#define DIO17_WPORT PORTC
#define DIO17_PWM NULL
#define DIO17_DDR DDRC
#define DIO18_PIN PINC2
#define DIO18_RPORT PINC
#define DIO18_WPORT PORTC
#define DIO18_PWM NULL
#define DIO18_DDR DDRC
#define DIO19_PIN PINC3
#define DIO19_RPORT PINC
#define DIO19_WPORT PORTC
#define DIO19_PWM NULL
#define DIO19_DDR DDRC
#define DIO20_PIN PINC4
#define DIO20_RPORT PINC
#define DIO20_WPORT PORTC
#define DIO20_PWM NULL
#define DIO20_DDR DDRC
#define DIO21_PIN PINC5
#define DIO21_RPORT PINC
#define DIO21_WPORT PORTC
#define DIO21_PWM NULL
#define DIO21_DDR DDRC
#define DIO22_PIN PINC6
#define DIO22_RPORT PINC
#define DIO22_WPORT PORTC
#define DIO22_PWM NULL
#define DIO22_DDR DDRC
#define DIO23_PIN PINC7
#define DIO23_RPORT PINC
#define DIO23_WPORT PORTC
#define DIO23_PWM NULL
#define DIO23_DDR DDRC
#define DIO24_PIN PIND0
#define DIO24_RPORT PIND
#define DIO24_WPORT PORTD
#define DIO24_PWM NULL
#define DIO24_DDR DDRD
#define DIO25_PIN PIND1
#define DIO25_RPORT PIND
#define DIO25_WPORT PORTD
#define DIO25_PWM NULL
#define DIO25_DDR DDRD
#define DIO26_PIN PIND2
#define DIO26_RPORT PIND
#define DIO26_WPORT PORTD
#define DIO26_PWM NULL
#define DIO26_DDR DDRD
#define DIO27_PIN PIND3
#define DIO27_RPORT PIND
#define DIO27_WPORT PORTD
#define DIO27_PWM NULL
#define DIO27_DDR DDRD
#define DIO28_PIN PIND4
#define DIO28_RPORT PIND
#define DIO28_WPORT PORTD
#define DIO28_PWM NULL
#define DIO28_DDR DDRD
#define DIO29_PIN PIND5
#define DIO29_RPORT PIND
#define DIO29_WPORT PORTD
#define DIO29_PWM NULL
#define DIO29_DDR DDRD
#define DIO30_PIN PIND6
#define DIO30_RPORT PIND
#define DIO30_WPORT PORTD
#define DIO30_PWM NULL
#define DIO30_DDR DDRD
#define DIO31_PIN PIND7
#define DIO31_RPORT PIND
#define DIO31_WPORT PORTD
#define DIO31_PWM NULL
#define DIO31_DDR DDRD
#define DIO32_PIN PINE0
#define DIO32_RPORT PINE
#define DIO32_WPORT PORTE
#define DIO32_PWM NULL
#define DIO32_DDR DDRE
#define DIO33_PIN PINE1
#define DIO33_RPORT PINE
#define DIO33_WPORT PORTE
#define DIO33_PWM NULL
#define DIO33_DDR DDRE
#define DIO34_PIN PINE2
#define DIO34_RPORT PINE
#define DIO34_WPORT PORTE
#define DIO34_PWM NULL
#define DIO34_DDR DDRE
#define DIO35_PIN PINE3
#define DIO35_RPORT PINE
#define DIO35_WPORT PORTE
#define DIO35_PWM NULL
#define DIO35_DDR DDRE
#define DIO36_PIN PINE4
#define DIO36_RPORT PINE
#define DIO36_WPORT PORTE
#define DIO36_PWM NULL
#define DIO36_DDR DDRE
#define DIO37_PIN PINE5
#define DIO37_RPORT PINE
#define DIO37_WPORT PORTE
#define DIO37_PWM NULL
#define DIO37_DDR DDRE
#define DIO38_PIN PINE6
#define DIO38_RPORT PINE
#define DIO38_WPORT PORTE
#define DIO38_PWM NULL
#define DIO38_DDR DDRE
#define DIO39_PIN PINE7
#define DIO39_RPORT PINE
#define DIO39_WPORT PORTE
#define DIO39_PWM NULL
#define DIO39_DDR DDRE
#define AIO0_PIN PINF0
#define AIO0_RPORT PINF
#define AIO0_WPORT PORTF
#define AIO0_PWM NULL
#define AIO0_DDR DDRF
#define AIO1_PIN PINF1
#define AIO1_RPORT PINF
#define AIO1_WPORT PORTF
#define AIO1_PWM NULL
#define AIO1_DDR DDRF
#define AIO2_PIN PINF2
#define AIO2_RPORT PINF
#define AIO2_WPORT PORTF
#define AIO2_PWM NULL
#define AIO2_DDR DDRF
#define AIO3_PIN PINF3
#define AIO3_RPORT PINF
#define AIO3_WPORT PORTF
#define AIO3_PWM NULL
#define AIO3_DDR DDRF
#define AIO4_PIN PINF4
#define AIO4_RPORT PINF
#define AIO4_WPORT PORTF
#define AIO4_PWM NULL
#define AIO4_DDR DDRF
#define AIO5_PIN PINF5
#define AIO5_RPORT PINF
#define AIO5_WPORT PORTF
#define AIO5_PWM NULL
#define AIO5_DDR DDRF
#define AIO6_PIN PINF6
#define AIO6_RPORT PINF
#define AIO6_WPORT PORTF
#define AIO6_PWM NULL
#define AIO6_DDR DDRF
#define AIO7_PIN PINF7
#define AIO7_RPORT PINF
#define AIO7_WPORT PORTF
#define AIO7_PWM NULL
#define AIO7_DDR DDRF
#define DIO40_PIN PINF0
#define DIO40_RPORT PINF
#define DIO40_WPORT PORTF
#define DIO40_PWM NULL
#define DIO40_DDR DDRF
#define DIO41_PIN PINF1
#define DIO41_RPORT PINF
#define DIO41_WPORT PORTF
#define DIO41_PWM NULL
#define DIO41_DDR DDRF
#define DIO42_PIN PINF2
#define DIO42_RPORT PINF
#define DIO42_WPORT PORTF
#define DIO42_PWM NULL
#define DIO42_DDR DDRF
#define DIO43_PIN PINF3
#define DIO43_RPORT PINF
#define DIO43_WPORT PORTF
#define DIO43_PWM NULL
#define DIO43_DDR DDRF
#define DIO44_PIN PINF4
#define DIO44_RPORT PINF
#define DIO44_WPORT PORTF
#define DIO44_PWM NULL
#define DIO44_DDR DDRF
#define DIO45_PIN PINF5
#define DIO45_RPORT PINF
#define DIO45_WPORT PORTF
#define DIO45_PWM NULL
#define DIO45_DDR DDRF
#define DIO46_PIN PINF6
#define DIO46_RPORT PINF
#define DIO46_WPORT PORTF
#define DIO46_PWM NULL
#define DIO46_DDR DDRF
#define DIO47_PIN PINF7
#define DIO47_RPORT PINF
#define DIO47_WPORT PORTF
#define DIO47_PWM NULL
#define DIO47_DDR DDRF
// Analog Outputs
#undef PA0
#define PA0_PIN PINA0
#define PA0_RPORT PINA
#define PA0_WPORT PORTA
#define PA0_PWM NULL
#define PA0_DDR DDRA
#undef PA1
#define PA1_PIN PINA1
#define PA1_RPORT PINA
#define PA1_WPORT PORTA
#define PA1_PWM NULL
#define PA1_DDR DDRA
#undef PA2
#define PA2_PIN PINA2
#define PA2_RPORT PINA
#define PA2_WPORT PORTA
#define PA2_PWM NULL
#define PA2_DDR DDRA
#undef PA3
#define PA3_PIN PINA3
#define PA3_RPORT PINA
#define PA3_WPORT PORTA
#define PA3_PWM NULL
#define PA3_DDR DDRA
#undef PA4
#define PA4_PIN PINA4
#define PA4_RPORT PINA
#define PA4_WPORT PORTA
#define PA4_PWM NULL
#define PA4_DDR DDRA
#undef PA5
#define PA5_PIN PINA5
#define PA5_RPORT PINA
#define PA5_WPORT PORTA
#define PA5_PWM NULL
#define PA5_DDR DDRA
#undef PA6
#define PA6_PIN PINA6
#define PA6_RPORT PINA
#define PA6_WPORT PORTA
#define PA6_PWM NULL
#define PA6_DDR DDRA
#undef PA7
#define PA7_PIN PINA7
#define PA7_RPORT PINA
#define PA7_WPORT PORTA
#define PA7_PWM NULL
#define PA7_DDR DDRA
#undef PB0
#define PB0_PIN PINB0
#define PB0_RPORT PINB
#define PB0_WPORT PORTB
#define PB0_PWM NULL
#define PB0_DDR DDRB
#undef PB1
#define PB1_PIN PINB1
#define PB1_RPORT PINB
#define PB1_WPORT PORTB
#define PB1_PWM NULL
#define PB1_DDR DDRB
#undef PB2
#define PB2_PIN PINB2
#define PB2_RPORT PINB
#define PB2_WPORT PORTB
#define PB2_PWM NULL
#define PB2_DDR DDRB
#undef PB3
#define PB3_PIN PINB3
#define PB3_RPORT PINB
#define PB3_WPORT PORTB
#define PB3_PWM NULL
#define PB3_DDR DDRB
#undef PB4
#define PB4_PIN PINB4
#define PB4_RPORT PINB
#define PB4_WPORT PORTB
#define PB4_PWM NULL
#define PB4_DDR DDRB
#undef PB5
#define PB5_PIN PINB5
#define PB5_RPORT PINB
#define PB5_WPORT PORTB
#define PB5_PWM NULL
#define PB5_DDR DDRB
#undef PB6
#define PB6_PIN PINB6
#define PB6_RPORT PINB
#define PB6_WPORT PORTB
#define PB6_PWM NULL
#define PB6_DDR DDRB
#undef PB7
#define PB7_PIN PINB7
#define PB7_RPORT PINB
#define PB7_WPORT PORTB
#define PB7_PWM NULL
#define PB7_DDR DDRB
#undef PC0
#define PC0_PIN PINC0
#define PC0_RPORT PINC
#define PC0_WPORT PORTC
#define PC0_PWM NULL
#define PC0_DDR DDRC
#undef PC1
#define PC1_PIN PINC1
#define PC1_RPORT PINC
#define PC1_WPORT PORTC
#define PC1_PWM NULL
#define PC1_DDR DDRC
#undef PC2
#define PC2_PIN PINC2
#define PC2_RPORT PINC
#define PC2_WPORT PORTC
#define PC2_PWM NULL
#define PC2_DDR DDRC
#undef PC3
#define PC3_PIN PINC3
#define PC3_RPORT PINC
#define PC3_WPORT PORTC
#define PC3_PWM NULL
#define PC3_DDR DDRC
#undef PC4
#define PC4_PIN PINC4
#define PC4_RPORT PINC
#define PC4_WPORT PORTC
#define PC4_PWM NULL
#define PC4_DDR DDRC
#undef PC5
#define PC5_PIN PINC5
#define PC5_RPORT PINC
#define PC5_WPORT PORTC
#define PC5_PWM NULL
#define PC5_DDR DDRC
#undef PC6
#define PC6_PIN PINC6
#define PC6_RPORT PINC
#define PC6_WPORT PORTC
#define PC6_PWM NULL
#define PC6_DDR DDRC
#undef PC7
#define PC7_PIN PINC7
#define PC7_RPORT PINC
#define PC7_WPORT PORTC
#define PC7_PWM NULL
#define PC7_DDR DDRC
#undef PD0
#define PD0_PIN PIND0
#define PD0_RPORT PIND
#define PD0_WPORT PORTD
#define PD0_PWM NULL
#define PD0_DDR DDRD
#undef PD1
#define PD1_PIN PIND1
#define PD1_RPORT PIND
#define PD1_WPORT PORTD
#define PD1_PWM NULL
#define PD1_DDR DDRD
#undef PD2
#define PD2_PIN PIND2
#define PD2_RPORT PIND
#define PD2_WPORT PORTD
#define PD2_PWM NULL
#define PD2_DDR DDRD
#undef PD3
#define PD3_PIN PIND3
#define PD3_RPORT PIND
#define PD3_WPORT PORTD
#define PD3_PWM NULL
#define PD3_DDR DDRD
#undef PD4
#define PD4_PIN PIND4
#define PD4_RPORT PIND
#define PD4_WPORT PORTD
#define PD4_PWM NULL
#define PD4_DDR DDRD
#undef PD5
#define PD5_PIN PIND5
#define PD5_RPORT PIND
#define PD5_WPORT PORTD
#define PD5_PWM NULL
#define PD5_DDR DDRD
#undef PD6
#define PD6_PIN PIND6
#define PD6_RPORT PIND
#define PD6_WPORT PORTD
#define PD6_PWM NULL
#define PD6_DDR DDRD
#undef PD7
#define PD7_PIN PIND7
#define PD7_RPORT PIND
#define PD7_WPORT PORTD
#define PD7_PWM NULL
#define PD7_DDR DDRD
#undef PE0
#define PE0_PIN PINE0
#define PE0_RPORT PINE
#define PE0_WPORT PORTE
#define PE0_PWM NULL
#define PE0_DDR DDRE
#undef PE1
#define PE1_PIN PINE1
#define PE1_RPORT PINE
#define PE1_WPORT PORTE
#define PE1_PWM NULL
#define PE1_DDR DDRE
#undef PE2
#define PE2_PIN PINE2
#define PE2_RPORT PINE
#define PE2_WPORT PORTE
#define PE2_PWM NULL
#define PE2_DDR DDRE
#undef PE3
#define PE3_PIN PINE3
#define PE3_RPORT PINE
#define PE3_WPORT PORTE
#define PE3_PWM NULL
#define PE3_DDR DDRE
#undef PE4
#define PE4_PIN PINE4
#define PE4_RPORT PINE
#define PE4_WPORT PORTE
#define PE4_PWM NULL
#define PE4_DDR DDRE
#undef PE5
#define PE5_PIN PINE5
#define PE5_RPORT PINE
#define PE5_WPORT PORTE
#define PE5_PWM NULL
#define PE5_DDR DDRE
#undef PE6
#define PE6_PIN PINE6
#define PE6_RPORT PINE
#define PE6_WPORT PORTE
#define PE6_PWM NULL
#define PE6_DDR DDRE
#undef PE7
#define PE7_PIN PINE7
#define PE7_RPORT PINE
#define PE7_WPORT PORTE
#define PE7_PWM NULL
#define PE7_DDR DDRE
#undef PF0
#define PF0_PIN PINF0
#define PF0_RPORT PINF
#define PF0_WPORT PORTF
#define PF0_PWM NULL
#define PF0_DDR DDRF
#undef PF1
#define PF1_PIN PINF1
#define PF1_RPORT PINF
#define PF1_WPORT PORTF
#define PF1_PWM NULL
#define PF1_DDR DDRF
#undef PF2
#define PF2_PIN PINF2
#define PF2_RPORT PINF
#define PF2_WPORT PORTF
#define PF2_PWM NULL
#define PF2_DDR DDRF
#undef PF3
#define PF3_PIN PINF3
#define PF3_RPORT PINF
#define PF3_WPORT PORTF
#define PF3_PWM NULL
#define PF3_DDR DDRF
#undef PF4
#define PF4_PIN PINF4
#define PF4_RPORT PINF
#define PF4_WPORT PORTF
#define PF4_PWM NULL
#define PF4_DDR DDRF
#undef PF5
#define PF5_PIN PINF5
#define PF5_RPORT PINF
#define PF5_WPORT PORTF
#define PF5_PWM NULL
#define PF5_DDR DDRF
#undef PF6
#define PF6_PIN PINF6
#define PF6_RPORT PINF
#define PF6_WPORT PORTF
#define PF6_PWM NULL
#define PF6_DDR DDRF
#undef PF7
#define PF7_PIN PINF7
#define PF7_RPORT PINF
#define PF7_WPORT PORTF
#define PF7_PWM NULL
#define PF7_DDR DDRF
#endif // _FASTIO_AT90USB

@ -26,8 +26,7 @@
* AT90USB 51 50 49 48 47 46 45 44 10 11 12 13 14 15 16 17 35 36 37 38 39 40 41 42 25 26 27 28 29 30 31 32 33 34 43 09 18 19 01 02 61 60 59 58 57 56 55 54 * AT90USB 51 50 49 48 47 46 45 44 10 11 12 13 14 15 16 17 35 36 37 38 39 40 41 42 25 26 27 28 29 30 31 32 33 34 43 09 18 19 01 02 61 60 59 58 57 56 55 54
* > Teensy 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45 * > Teensy 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45
* 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 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 * 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 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7
* 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 * The pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
* The pins 46 and 47 are not supported by Teensyduino, but are supported below.
*/ */
#ifndef _FASTIO_AT90USB #ifndef _FASTIO_AT90USB
@ -679,4 +678,21 @@
#define PF7_PWM NULL #define PF7_PWM NULL
#define PF7_DDR DDRF #define PF7_DDR DDRF
/**
* some of the pin mapping functions of the Teensduino extension to the Arduino IDE
* do not function the same as the other Arduino extensions
*/
//digitalPinToTimer(pin) function works like Arduino but Timers are not defined
#define TIMER0B 1
#define TIMER1A 7
#define TIMER1B 8
#define TIMER1C 9
#define TIMER2A 6
#define TIMER2B 2
#define TIMER3A 5
#define TIMER3B 4
#define TIMER3C 3
#endif // _FASTIO_AT90USB #endif // _FASTIO_AT90USB

@ -20,6 +20,18 @@
* *
*/ */
/**
* Include pins definitions
*
* Pins numbering schemes:
*
* - Digital I/O pin number if used by READ/WRITE macros. (e.g., X_STEP_DIR)
* The FastIO headers map digital pins to their ports and functions.
*
* - Analog Input number if used by analogRead or DAC. (e.g., TEMP_n_PIN)
* These numbers are the same in any pin mapping.
*/
#ifndef __PINS_H__ #ifndef __PINS_H__
#define __PINS_H__ #define __PINS_H__
@ -537,19 +549,10 @@
#define AVR_MOSI_PIN 51 #define AVR_MOSI_PIN 51
#define AVR_SS_PIN 53 #define AVR_SS_PIN 53
#elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) #elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
#if ENABLED(AT90USBxx_TEENSYPP_ASSIGNMENTS)
// Teensy pin assignments
#define AVR_SCK_PIN 21 #define AVR_SCK_PIN 21
#define AVR_MISO_PIN 23 #define AVR_MISO_PIN 23
#define AVR_MOSI_PIN 22 #define AVR_MOSI_PIN 22
#define AVR_SS_PIN 20 #define AVR_SS_PIN 20
#else
// Traditional pin assignments
#define AVR_SCK_PIN 9
#define AVR_MISO_PIN 11
#define AVR_MOSI_PIN 10
#define AVR_SS_PIN 8
#endif
#elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) #elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
#define AVR_SCK_PIN 10 #define AVR_SCK_PIN 10
#define AVR_MISO_PIN 12 #define AVR_MISO_PIN 12

@ -20,18 +20,13 @@
* *
*/ */
bool endstop_monitor_flag = false; bool endstop_monitor_flag = false;
#define NAME_FORMAT "%-28s" // one place to specify the format of all the sources of names #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 // "-" left justify, "28" minimum width of name, pad with blanks
#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7))) #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7)))
#define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__))
#define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__))
#define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__))
/** /**
* This routine minimizes RAM usage by creating a FLASH resident array to * This routine minimizes RAM usage by creating a FLASH resident array to
* store the pin names, pin numbers and analog/digital flag. * store the pin names, pin numbers and analog/digital flag.
@ -52,7 +47,7 @@ bool endstop_monitor_flag = false;
#define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER) #define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER)
#include "pinsDebug_list.h" #include "pinsDebug_list.h"
#line 56 #line 51
// manually add pins that have names that are macros which don't play well with these macros // manually add pins that have names that are macros which don't play well with these macros
#if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY) #if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY)
@ -88,27 +83,34 @@ const char* const pin_array[][3] PROGMEM = {
// manually add pins ... // manually add pins ...
#if SERIAL_PORT == 0 #if SERIAL_PORT == 0
#if AVR_ATmega2560_FAMILY #if AVR_ATmega2560_FAMILY
{ RXD_NAME, "0", "1" }, { RXD_NAME, 0, 1 },
{ TXD_NAME, "1", "1" }, { TXD_NAME, 1, 1 },
#elif AVR_ATmega1284_FAMILY #elif AVR_ATmega1284_FAMILY
{ RXD_NAME, "8", "1" }, { RXD_NAME, 8, 1 },
{ TXD_NAME, "9", "1" }, { TXD_NAME, 9, 1 },
#endif #endif
#endif #endif
#include "pinsDebug_list.h" #include "pinsDebug_list.h"
#line 101 #line 96
}; };
#define n_array (sizeof(pin_array) / sizeof(char*)) / 3 #define n_array (sizeof(pin_array) / sizeof(char*)) / 3
#ifndef TIMER1B #if AVR_AT90USB1286_FAMILY
// working with Teensyduino extension so need to re-define some things // Working with Teensyduino extension so need to re-define some things
#include "pinsDebug_Teensyduino.h" #include "pinsDebug_Teensyduino.h"
// Can't use the "digitalPinToPort" function from the Teensyduino type IDEs
// portModeRegister takes a different argument
#define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p)
#define get_pinMode(pin) (*portModeRegister(pin) & digitalPinToBitMask(pin))
#else
#define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
bool get_pinMode(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask(pin); }
#endif #endif
#define PWM_PRINT(V) do{ sprintf(buffer, "PWM: %4d", V); SERIAL_ECHO(buffer); }while(0) #define PWM_PRINT(V) do{ sprintf_P(buffer, PSTR("PWM: %4d"), V); SERIAL_ECHO(buffer); }while(0)
#define PWM_CASE(N,Z) \ #define PWM_CASE(N,Z) \
case TIMER##N##Z: \ case TIMER##N##Z: \
if (TCCR##N##A & (_BV(COM##N##Z##1) | _BV(COM##N##Z##0))) { \ if (TCCR##N##A & (_BV(COM##N##Z##1) | _BV(COM##N##Z##0))) { \
@ -127,8 +129,10 @@ static bool pwm_status(uint8_t pin) {
#if defined(TCCR0A) && defined(COM0A1) #if defined(TCCR0A) && defined(COM0A1)
#ifdef TIMER0A #ifdef TIMER0A
#if !AVR_AT90USB1286_FAMILY // not available in Teensyduino type IDEs
PWM_CASE(0, A); PWM_CASE(0, A);
#endif #endif
#endif
PWM_CASE(0, B); PWM_CASE(0, B);
#endif #endif
@ -244,9 +248,10 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
static void err_is_counter() { SERIAL_PROTOCOLPGM(" non-standard PWM mode"); } static void err_is_counter() { SERIAL_PROTOCOLPGM(" non-standard PWM mode"); }
static void err_is_interrupt() { SERIAL_PROTOCOLPGM(" compare interrupt enabled"); } static void err_is_interrupt() { SERIAL_PROTOCOLPGM(" compare interrupt enabled"); }
static void err_prob_interrupt() { SERIAL_PROTOCOLPGM(" overflow interrupt enabled"); } static void err_prob_interrupt() { SERIAL_PROTOCOLPGM(" overflow interrupt enabled"); }
static void print_is_also_tied() { SERIAL_PROTOCOLPGM(" is also tied to this pin"); SERIAL_PROTOCOL_SP(14); }
void com_print(uint8_t N, uint8_t Z) { void com_print(uint8_t N, uint8_t Z) {
uint8_t *TCCRA = (uint8_t*)TCCR_A(N); const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
SERIAL_PROTOCOLPGM(" COM"); SERIAL_PROTOCOLPGM(" COM");
SERIAL_PROTOCOLCHAR(N + '0'); SERIAL_PROTOCOLCHAR(N + '0');
switch (Z) { switch (Z) {
@ -264,8 +269,8 @@ void com_print(uint8_t N, uint8_t Z) {
void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout
char buffer[20]; // for the sprintf statements char buffer[20]; // for the sprintf statements
uint8_t *TCCRB = (uint8_t*)TCCR_B(T); const uint8_t *TCCRB = (uint8_t*)TCCR_B(T),
uint8_t *TCCRA = (uint8_t*)TCCR_A(T); *TCCRA = (uint8_t*)TCCR_A(T);
uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1)))); uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1))));
if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1); if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1);
@ -275,11 +280,11 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
SERIAL_PROTOCOL_SP(3); SERIAL_PROTOCOL_SP(3);
if (N == 3) { if (N == 3) {
uint8_t *OCRVAL8 = (uint8_t*)OCR_VAL(T, L - 'A'); const uint8_t *OCRVAL8 = (uint8_t*)OCR_VAL(T, L - 'A');
PWM_PRINT(*OCRVAL8); PWM_PRINT(*OCRVAL8);
} }
else { else {
uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A'); const uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A');
PWM_PRINT(*OCRVAL16); PWM_PRINT(*OCRVAL16);
} }
SERIAL_PROTOCOLPAIR(" WGM: ", WGM); SERIAL_PROTOCOLPAIR(" WGM: ", WGM);
@ -294,12 +299,12 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
SERIAL_PROTOCOLCHAR(T + '0'); SERIAL_PROTOCOLCHAR(T + '0');
SERIAL_PROTOCOLPAIR("B: ", *TCCRB); SERIAL_PROTOCOLPAIR("B: ", *TCCRB);
uint8_t *TMSK = (uint8_t*)TIMSK(T); const uint8_t *TMSK = (uint8_t*)TIMSK(T);
SERIAL_PROTOCOLPGM(" TIMSK"); SERIAL_PROTOCOLPGM(" TIMSK");
SERIAL_PROTOCOLCHAR(T + '0'); SERIAL_PROTOCOLCHAR(T + '0');
SERIAL_PROTOCOLPAIR(": ", *TMSK); SERIAL_PROTOCOLPAIR(": ", *TMSK);
uint8_t OCIE = L - 'A' + 1; const uint8_t OCIE = L - 'A' + 1;
if (N == 3) { if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter(); } if (N == 3) { if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter(); }
else { if (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13) err_is_counter(); } else { if (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13) err_is_counter(); }
if (TEST(*TMSK, OCIE)) err_is_interrupt(); if (TEST(*TMSK, OCIE)) err_is_interrupt();
@ -311,8 +316,10 @@ static void pwm_details(uint8_t pin) {
#if defined(TCCR0A) && defined(COM0A1) #if defined(TCCR0A) && defined(COM0A1)
#ifdef TIMER0A #ifdef TIMER0A
#if !AVR_AT90USB1286_FAMILY // not available in Teensyduino type IDEs
case TIMER0A: timer_prefix(0, 'A', 3); break; case TIMER0A: timer_prefix(0, 'A', 3); break;
#endif #endif
#endif
case TIMER0B: timer_prefix(0, 'B', 3); break; case TIMER0B: timer_prefix(0, 'B', 3); break;
#endif #endif
@ -357,136 +364,192 @@ static void pwm_details(uint8_t pin) {
// on pins that have two PWMs, print info on second PWM // on pins that have two PWMs, print info on second PWM
#if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY #if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY
// looking for port B7 - PWMs 0A and 1C // looking for port B7 - PWMs 0A and 1C
if (digitalPinToPort(pin) == 2 && digitalPinToBitMask(pin) == 0x80) { if (digitalPinToPort_DEBUG(pin) == 'B' - 64 && 0x80 == digitalPinToBitMask(pin)) {
#ifndef TEENSYDUINO_IDE #if !AVR_AT90USB1286_FAMILY
SERIAL_PROTOCOLPGM("\n ."); SERIAL_PROTOCOLPGM("\n .");
SERIAL_PROTOCOL_SP(18); SERIAL_PROTOCOL_SP(18);
SERIAL_PROTOCOLPGM("TIMER1C is also tied to this pin"); SERIAL_PROTOCOLPGM("TIMER1C");
SERIAL_PROTOCOL_SP(13); print_is_also_tied();
timer_prefix(1, 'C', 4); timer_prefix(1, 'C', 4);
#else #else
SERIAL_PROTOCOLPGM("\n ."); SERIAL_PROTOCOLPGM("\n .");
SERIAL_PROTOCOL_SP(18); SERIAL_PROTOCOL_SP(18);
SERIAL_PROTOCOLPGM("TIMER0A is also tied to this pin"); SERIAL_PROTOCOLPGM("TIMER0A");
SERIAL_PROTOCOL_SP(13); print_is_also_tied();
timer_prefix(0, 'A', 3); timer_prefix(0, 'A', 3);
#endif #endif
} }
#endif #endif
} // pwm_details } // pwm_details
bool get_pinMode(int8_t pin) { return *portModeRegister(digitalPinToPort(pin)) & digitalPinToBitMask(pin); } #ifndef digitalRead_mod // Use Teensyduino's version of digitalRead - it doesn't disable the PWMs
int digitalRead_mod(const int8_t pin) { // same as digitalRead except the PWM stop section has been removed
#ifndef digitalRead_mod // use Teensyduino's version of digitalRead - it doesn't disable the PWMs const uint8_t port = digitalPinToPort_DEBUG(pin);
int digitalRead_mod(int8_t pin) { // same as digitalRead except the PWM stop section has been removed
uint8_t port = digitalPinToPort(pin);
return (port != NOT_A_PIN) && (*portInputRegister(port) & digitalPinToBitMask(pin)) ? HIGH : LOW; return (port != NOT_A_PIN) && (*portInputRegister(port) & digitalPinToBitMask(pin)) ? HIGH : LOW;
} }
#endif #endif
void print_port(int8_t pin) { // print port number void print_port(int8_t pin) { // print port number
#ifdef digitalPinToPort #ifdef digitalPinToPort_DEBUG
uint8_t x;
SERIAL_PROTOCOLPGM(" Port: "); SERIAL_PROTOCOLPGM(" Port: ");
uint8_t x = digitalPinToPort(pin) + 64; #if AVR_AT90USB1286_FAMILY
x = (pin == 46 || pin == 47) ? 'E' : digitalPinToPort_DEBUG(pin) + 64;
#else
x = digitalPinToPort_DEBUG(pin) + 64;
#endif
SERIAL_CHAR(x); SERIAL_CHAR(x);
#if AVR_AT90USB1286_FAMILY
if (pin == 46)
x = '2';
else if (pin == 47)
x = '3';
else {
uint8_t temp = digitalPinToBitMask(pin);
for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1;
}
#else
uint8_t temp = digitalPinToBitMask(pin); uint8_t temp = digitalPinToBitMask(pin);
for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1; for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1;
#endif
SERIAL_CHAR(x); SERIAL_CHAR(x);
#else #else
SERIAL_PROTOCOL_SP(10); SERIAL_PROTOCOL_SP(10);
#endif #endif
} }
static void print_input_or_output(const bool isout) {
serialprintPGM(isout ? PSTR("Output = ") : PSTR("Input = "));
}
// pretty report with PWM info // pretty report with PWM info
inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = true) { inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = false,const char *start_string = "") {
uint8_t temp_char; uint8_t temp_char;
char *name_mem_pointer; char *name_mem_pointer, buffer[30]; // for the sprintf statements
char buffer[30]; // for the sprintf statements bool found = false, multi_name_pin = false;
bool found = false,
multi_name_pin = false;
for (uint8_t x = 0; x < n_array; x++) { // scan entire array and report all instances of this pin for (uint8_t x = 0; x < n_array; x++) { // scan entire array and report all instances of this pin
if (pgm_read_byte(&pin_array[x][1]) == pin) { if (pgm_read_byte(&pin_array[x][1]) == pin) {
if (found) multi_name_pin = true; if (found) multi_name_pin = true;
found = true; found = true;
if (!multi_name_pin) { // report digitial and analog pin number only on the first time through if (!multi_name_pin) { // report digitial and analog pin number only on the first time through
sprintf(buffer, "PIN: %3d ", pin); // digital pin number sprintf_P(buffer, PSTR("%sPIN: %3d "), start_string, pin); // digital pin number
SERIAL_ECHO(buffer); SERIAL_ECHO(buffer);
print_port(pin); print_port(pin);
if (IS_ANALOG(pin)) { if (IS_ANALOG(pin)) {
sprintf(buffer, " (A%2d) ", int(pin - analogInputToDigitalPin(0))); // analog pin number sprintf_P(buffer, PSTR(" (A%2d) "), int(pin - analogInputToDigitalPin(0))); // analog pin number
SERIAL_ECHO(buffer); SERIAL_ECHO(buffer);
} }
else SERIAL_ECHO_SP(8); // add padding if not an analog pin else SERIAL_ECHO_SP(8); // add padding if not an analog pin
} }
else { else {
SERIAL_CHAR('.'); SERIAL_CHAR('.');
SERIAL_ECHO_SP(25); // add padding if not the first instance found SERIAL_ECHO_SP(26 + strlen(start_string)); // add padding if not the first instance found
} }
name_mem_pointer = (char*)pgm_read_word(&pin_array[x][0]); name_mem_pointer = (char*)pgm_read_word(&pin_array[x][0]);
for (uint8_t y = 0; y < 28; y++) { // always print pin name for (uint8_t y = 0; y < 28; y++) { // always print pin name
temp_char = pgm_read_byte(name_mem_pointer + y); temp_char = pgm_read_byte(name_mem_pointer + y);
if (temp_char != 0) MYSERIAL.write(temp_char); if (temp_char != 0)
MYSERIAL.write(temp_char);
else { else {
for (uint8_t i = 0; i < 28 - y; i++) MYSERIAL.write(' '); for (uint8_t i = 0; i < 28 - y; i++) MYSERIAL.write(' ');
break; break;
} }
} }
if (extended) {
if (pin_is_protected(pin) && !ignore) if (pin_is_protected(pin) && !ignore)
SERIAL_ECHOPGM("protected "); SERIAL_ECHOPGM("protected ");
else { else {
#ifdef AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO
if (pin == 46) {
print_input_or_output(GET_OUTPUT(46));
SERIAL_PROTOCOL(READ(46));
}
else if (pin == 47)
print_input_or_output(GET_OUTPUT(47));
SERIAL_PROTOCOL(READ(47));
}
else
#endif
{
if (!(pgm_read_byte(&pin_array[x][2]))) { if (!(pgm_read_byte(&pin_array[x][2]))) {
sprintf(buffer, "Analog in = %5d", analogRead(pin - analogInputToDigitalPin(0))); sprintf_P(buffer, PSTR("Analog in = %5d"), analogRead(pin - analogInputToDigitalPin(0)));
SERIAL_ECHO(buffer); SERIAL_ECHO(buffer);
} }
else { else {
if (!get_pinMode(pin)) { if (!get_pinMode(pin)) {
//pinMode(pin, INPUT_PULLUP); // make sure input isn't floating - stopped doing this //pinMode(pin, INPUT_PULLUP); // make sure input isn't floating - stopped doing this
// because this could interfere with inductive/capacitive // because this could interfere with inductive/capacitive
// sensors (high impedance voltage divider) and with PT100 amplifier // sensors (high impedance voltage divider) and with PT100 amplifier
SERIAL_PROTOCOLPAIR("Input = ", digitalRead_mod(pin)); print_input_or_output(false);
SERIAL_PROTOCOL(digitalRead_mod(pin));
} }
else if (pwm_status(pin)) { else if (pwm_status(pin)) {
// do nothing // do nothing
} }
else SERIAL_PROTOCOLPAIR("Output = ", digitalRead_mod(pin)); else {
print_input_or_output(true);
SERIAL_PROTOCOL(digitalRead_mod(pin));
}
} }
if (!multi_name_pin && extended) pwm_details(pin); // report PWM capabilities only on the first pass & only if doing an extended report if (!multi_name_pin && extended) pwm_details(pin); // report PWM capabilities only on the first pass & only if doing an extended report
} }
}
}
SERIAL_EOL(); SERIAL_EOL();
} // end of IF } // end of IF
} // end of for loop } // end of for loop
if (!found) { if (!found) {
sprintf(buffer, "PIN: %3d ", pin); sprintf_P(buffer, PSTR("%sPIN: %3d "), start_string, pin);
SERIAL_ECHO(buffer); SERIAL_ECHO(buffer);
print_port(pin); print_port(pin);
if (IS_ANALOG(pin)) { if (IS_ANALOG(pin)) {
sprintf(buffer, " (A%2d) ", int(pin - analogInputToDigitalPin(0))); // analog pin number sprintf_P(buffer, PSTR(" (A%2d) "), int(pin - analogInputToDigitalPin(0))); // analog pin number
SERIAL_ECHO(buffer); SERIAL_ECHO(buffer);
} }
else else {
SERIAL_ECHO_SP(8); // add padding if not an analog pin SERIAL_ECHO_SP(8); // add padding if not an analog pin
SERIAL_ECHOPGM("<unused/unknown>"); SERIAL_ECHOPGM("<unused/unknown>");
if (extended) {
#ifdef AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO
if (pin == 46 || pin == 47) {
SERIAL_PROTOCOL_SP(12);
if (pin == 46) {
print_input_or_output(GET_OUTPUT(46));
SERIAL_PROTOCOL(READ(46));
}
else {
print_input_or_output(GET_OUTPUT(47));
SERIAL_PROTOCOL(READ(47));
}
}
else
#endif
{
if (get_pinMode(pin)) { if (get_pinMode(pin)) {
SERIAL_PROTOCOL_SP(12); SERIAL_PROTOCOL_SP(12);
SERIAL_PROTOCOLPAIR("Output = ", digitalRead_mod(pin)); print_input_or_output(true);
SERIAL_PROTOCOL(digitalRead_mod(pin));
} }
else { else {
if (IS_ANALOG(pin)) { if (IS_ANALOG(pin)) {
sprintf(buffer, " Analog in = %5d", analogRead(pin - analogInputToDigitalPin(0))); sprintf_P(buffer, PSTR(" Analog in = %5d"), analogRead(pin - analogInputToDigitalPin(0)));
SERIAL_ECHO(buffer); SERIAL_ECHO(buffer);
SERIAL_ECHOPGM(" ");
} }
else else
SERIAL_ECHO_SP(9); // add padding if not an analog pin SERIAL_ECHO_SP(12); // add padding if not an analog pin
SERIAL_PROTOCOLPAIR(" Input = ", digitalRead_mod(pin)); print_input_or_output(false);
SERIAL_PROTOCOL(digitalRead_mod(pin));
} }
//if (!pwm_status(pin)) SERIAL_CHAR(' '); // add padding if it's not a PWM pin //if (!pwm_status(pin)) SERIAL_CHAR(' '); // add padding if it's not a PWM pin
if (extended) pwm_details(pin); // report PWM capabilities only if doing an extended report if (extended) pwm_details(pin); // report PWM capabilities only if doing an extended report
}
}
SERIAL_EOL(); SERIAL_EOL();
} }
} }
inline void report_pin_state(int8_t pin) {
report_pin_state_extended(pin, false, false);
} }

@ -25,21 +25,16 @@
// do not function the same as the other Arduino extensions // do not function the same as the other Arduino extensions
// //
#ifndef __PINSDEBUG_TEENSYDUINO_H__
#define __PINSDEBUG_TEENSYDUINO_H__
#define TEENSYDUINO_IDE #undef NUM_DIGITAL_PINS
#define NUM_DIGITAL_PINS 48 // Teensy says 46 but FASTIO is 48
//digitalPinToTimer(pin) function works like Arduino but Timers are not defined // "digitalPinToPort" function just returns the pin number so need to create our own.
#define TIMER0B 1 // Can't use the name "digitalPinToPort" for our own because it interferes with the
#define TIMER1A 7 // FAST_PWM_FAN function if we do
#define TIMER1B 8
#define TIMER1C 9
#define TIMER2A 6
#define TIMER2B 2
#define TIMER3A 5
#define TIMER3B 4
#define TIMER3C 3
// digitalPinToPort function just returns the pin number so need to create our own
#define PA 1 #define PA 1
#define PB 2 #define PB 2
#define PC 3 #define PC 3
@ -47,9 +42,8 @@
#define PE 5 #define PE 5
#define PF 6 #define PF 6
#undef digitalPinToPort
const uint8_t PROGMEM digital_pin_to_port_PGM[] = { const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = {
PD, // 0 - PD0 - INT0 - PWM PD, // 0 - PD0 - INT0 - PWM
PD, // 1 - PD1 - INT1 - PWM PD, // 1 - PD1 - INT1 - PWM
PD, // 2 - PD2 - INT2 - RX PD, // 2 - PD2 - INT2 - RX
@ -100,7 +94,7 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PE, // 47 - PE3 (not defined in teensyduino) PE, // 47 - PE3 (not defined in teensyduino)
}; };
#define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) ) #define digitalPinToPort_Teensy(P) ( pgm_read_byte( digital_pin_to_port_PGM_Teensy + (P) ) )
// digitalPinToBitMask(pin) is OK // digitalPinToBitMask(pin) is OK
@ -108,3 +102,5 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
// disable the PWMs so we can use it as is // disable the PWMs so we can use it as is
// portModeRegister(pin) is OK // portModeRegister(pin) is OK
#endif // __PINSDEBUG_TEENSYDUINO_H__

@ -353,22 +353,22 @@
#if defined(LCD_CONTRAST) && LCD_CONTRAST >= 0 #if defined(LCD_CONTRAST) && LCD_CONTRAST >= 0
REPORT_NAME_DIGITAL(LCD_CONTRAST, __LINE__ ) REPORT_NAME_DIGITAL(LCD_CONTRAST, __LINE__ )
#endif #endif
#if PIN_EXISTS(LCD) #if defined(LCD_PINS_D4) && LCD_PINS_D4 >= 0
REPORT_NAME_DIGITAL(LCD_PINS_D4, __LINE__ ) REPORT_NAME_DIGITAL(LCD_PINS_D4, __LINE__ )
#endif #endif
#if PIN_EXISTS(LCD) #if defined(LCD_PINS_D5) && LCD_PINS_D5 >= 0
REPORT_NAME_DIGITAL(LCD_PINS_D5, __LINE__ ) REPORT_NAME_DIGITAL(LCD_PINS_D5, __LINE__ )
#endif #endif
#if PIN_EXISTS(LCD) #if defined(LCD_PINS_D6) && LCD_PINS_D6 >= 0
REPORT_NAME_DIGITAL(LCD_PINS_D6, __LINE__ ) REPORT_NAME_DIGITAL(LCD_PINS_D6, __LINE__ )
#endif #endif
#if PIN_EXISTS(LCD) #if defined(LCD_PINS_D7) && LCD_PINS_D7 >= 0
REPORT_NAME_DIGITAL(LCD_PINS_D7, __LINE__ ) REPORT_NAME_DIGITAL(LCD_PINS_D7, __LINE__ )
#endif #endif
#if PIN_EXISTS(LCD) #if defined(LCD_PINS_ENABLE) && LCD_PINS_ENABLE >= 0
REPORT_NAME_DIGITAL(LCD_PINS_ENABLE, __LINE__ ) REPORT_NAME_DIGITAL(LCD_PINS_ENABLE, __LINE__ )
#endif #endif
#if PIN_EXISTS(LCD) #if defined(LCD_PINS_RS) && LCD_PINS_RS >= 0
REPORT_NAME_DIGITAL(LCD_PINS_RS, __LINE__ ) REPORT_NAME_DIGITAL(LCD_PINS_RS, __LINE__ )
#endif #endif
#if defined(LCD_SDSS) && LCD_SDSS >= 0 #if defined(LCD_SDSS) && LCD_SDSS >= 0
@ -446,6 +446,18 @@
#if PIN_EXISTS(RAMPS_D9) #if PIN_EXISTS(RAMPS_D9)
REPORT_NAME_DIGITAL(RAMPS_D9_PIN, __LINE__ ) REPORT_NAME_DIGITAL(RAMPS_D9_PIN, __LINE__ )
#endif #endif
#if PIN_EXISTS(RGB_LED_R)
REPORT_NAME_DIGITAL(RGB_LED_R_PIN, __LINE__ )
#endif
#if PIN_EXISTS(RGB_LED_G)
REPORT_NAME_DIGITAL(RGB_LED_G_PIN, __LINE__ )
#endif
#if PIN_EXISTS(RGB_LED_B)
REPORT_NAME_DIGITAL(RGB_LED_B_PIN, __LINE__ )
#endif
#if PIN_EXISTS(RGB_LED_W)
REPORT_NAME_DIGITAL(RGB_LED_W_PIN, __LINE__ )
#endif
#if PIN_EXISTS(RX_ENABLE) #if PIN_EXISTS(RX_ENABLE)
REPORT_NAME_DIGITAL(RX_ENABLE_PIN, __LINE__ ) REPORT_NAME_DIGITAL(RX_ENABLE_PIN, __LINE__ )
#endif #endif
@ -500,12 +512,21 @@
#if PIN_EXISTS(SLEEP_WAKE) #if PIN_EXISTS(SLEEP_WAKE)
REPORT_NAME_DIGITAL(SLEEP_WAKE_PIN, __LINE__ ) REPORT_NAME_DIGITAL(SLEEP_WAKE_PIN, __LINE__ )
#endif #endif
#if PIN_EXISTS(SOL0)
REPORT_NAME_DIGITAL(SOL0_PIN, __LINE__ )
#endif
#if PIN_EXISTS(SOL1) #if PIN_EXISTS(SOL1)
REPORT_NAME_DIGITAL(SOL1_PIN, __LINE__ ) REPORT_NAME_DIGITAL(SOL1_PIN, __LINE__ )
#endif #endif
#if PIN_EXISTS(SOL2) #if PIN_EXISTS(SOL2)
REPORT_NAME_DIGITAL(SOL2_PIN, __LINE__ ) REPORT_NAME_DIGITAL(SOL2_PIN, __LINE__ )
#endif #endif
#if PIN_EXISTS(SOL3)
REPORT_NAME_DIGITAL(SOL3_PIN, __LINE__ )
#endif
#if PIN_EXISTS(SOL4)
REPORT_NAME_DIGITAL(SOL4_PIN, __LINE__ )
#endif
#if defined(SPARE_IO) && SPARE_IO >= 0 #if defined(SPARE_IO) && SPARE_IO >= 0
REPORT_NAME_DIGITAL(SPARE_IO, __LINE__ ) REPORT_NAME_DIGITAL(SPARE_IO, __LINE__ )
#endif #endif
@ -749,3 +770,4 @@
#if PIN_EXISTS(Z2_STEP) #if PIN_EXISTS(Z2_STEP)
REPORT_NAME_DIGITAL(Z2_STEP_PIN, __LINE__ ) REPORT_NAME_DIGITAL(Z2_STEP_PIN, __LINE__ )
#endif #endif

@ -1,6 +1,6 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
@ -20,6 +20,47 @@
* *
*/ */
/**
* Rev B 2 JUN 2017
*
* Converted to Arduino pin numbering
*/
/**
* There are two Arduino IDE extensions that are compatible with this board
* and with the mainstream Marlin software.
*
* Teensyduino - http://www.pjrc.com/teensy/teensyduino.html
* Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu
*
* Installation instructions are at the above URL. Don't bother loading the
* libraries - they are not used with the Marlin software.
*
* Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support
*
* Installation:
*
* 1. Go to the above URL, click on the "Clone or Download" button and then
* click on "Download ZIP" button.
* 2. Unzip the file, find the "printrboard" directory and then copy it to the
* hardware directory in Arduino. The Arduino hardware directory will probably
* be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware.
* 3. Restart Arduino.
* 4. Select "Printrboard" from the 'Tools -> Boards' menu.
*
* Teensyduino is the most popular option. Printrboard is used if your board doesn't have
* the Teensyduino bootloader on it.
*/
/**
* To burn the bootloader that comes with Printrboard:
*
* 1. Connect your programmer to the board.
* 2. In the Arduino IDE select "Printrboard" and then select the programmer.
* 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message.
* 4. The programmer is no longer needed. Remove it.
*/
/** /**
* 5DPrint D8 Driver board pin assignments * 5DPrint D8 Driver board pin assignments
* *
@ -27,7 +68,7 @@
*/ */
#ifndef __AVR_AT90USB1286__ #ifndef __AVR_AT90USB1286__
#error "Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu." #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu."
#endif #endif
#define DEFAULT_MACHINE_NAME "Makibox" #define DEFAULT_MACHINE_NAME "Makibox"
@ -39,56 +80,54 @@
// //
// Limit Switches // Limit Switches
// //
#define X_STOP_PIN 37 #define X_STOP_PIN 37 // E5
#define Y_STOP_PIN 36 #define Y_STOP_PIN 36 // E4
#define Z_STOP_PIN 39 #define Z_STOP_PIN 19 // E7
// //
// Steppers // Steppers
// //
#define X_STEP_PIN 0 #define X_STEP_PIN 28 // A0
#define X_DIR_PIN 1 #define X_DIR_PIN 29 // A1
#define X_ENABLE_PIN 23 #define X_ENABLE_PIN 17 // C7
#define Y_STEP_PIN 2 #define Y_STEP_PIN 30 // A2
#define Y_DIR_PIN 3 #define Y_DIR_PIN 31 // A3
#define Y_ENABLE_PIN 19 #define Y_ENABLE_PIN 13 // C3
#define Z_STEP_PIN 4 #define Z_STEP_PIN 32 // A4
#define Z_DIR_PIN 5 #define Z_DIR_PIN 33 // A5
#define Z_ENABLE_PIN 18 #define Z_ENABLE_PIN 12 // C2
#define E0_STEP_PIN 6 #define E0_STEP_PIN 34 // A6
#define E0_DIR_PIN 7 #define E0_DIR_PIN 35 // A7
#define E0_ENABLE_PIN 17 #define E0_ENABLE_PIN 11 // C1
// Microstepping pins - Mapping not from fastio.h (?)
#define X_MS1_PIN 25 #define X_MS1_PIN 25 // B5
#define X_MS2_PIN 26 #define X_MS2_PIN 26 // B6
#define Y_MS1_PIN 9 #define Y_MS1_PIN 9 // E1
#define Y_MS2_PIN 8 #define Y_MS2_PIN 8 // E0
#define Z_MS1_PIN 7 #define Z_MS1_PIN 7 // D7
#define Z_MS2_PIN 6 #define Z_MS2_PIN 6 // D6
#define E0_MS1_PIN 5 #define E0_MS1_PIN 5 // D5
#define E0_MS2_PIN 4 #define E0_MS2_PIN 4 // D4
// //
// Temperature Sensors // Temperature Sensors
// //
#define TEMP_0_PIN 1 // Analog Input #define TEMP_0_PIN 1 // F1 Analog Input
#define TEMP_BED_PIN 0 // Analog Input #define TEMP_BED_PIN 0 // F0 Analog Input
// //
// Heaters / Fans // Heaters / Fans
// //
#define HEATER_0_PIN 21 #define HEATER_0_PIN 15 // C5
#define HEATER_BED_PIN 20 #define HEATER_BED_PIN 14 // C4
// You may need to change FAN_PIN to 16 because Marlin isn't using fastio.h #define FAN_PIN 16 // C6 PWM3A
// for the fan and Teensyduino uses a different pin mapping.
#define FAN_PIN 16
// //
// Misc. Functions // Misc. Functions
// //
#define SDSS 20 #define SDSS 20 // B0

@ -146,7 +146,7 @@
// Misc. Functions // Misc. Functions
// //
#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN #if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN
#undef DOGLCD_A0 // steal pin 44 for the case light; if you have a Viki2 and have connected it #undef DOGLCD_A0 // Steal pin 44 for the case light; if you have a Viki2 and have connected it
#define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments #define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments
// as the wiring diagram uses pin 44 for DOGLCD_A0 // as the wiring diagram uses pin 44 for DOGLCD_A0
#endif #endif

@ -1,6 +1,6 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
@ -34,6 +34,12 @@
* allow this board to use the latest Marlin software * allow this board to use the latest Marlin software
*/ */
/**
* Rev C 2 JUN 2017
*
* Converted to Arduino pin numbering
*/
/** /**
* Marlin_AT90USB - https://github.com/Bob-the-Kuhn/Marlin_AT90USB * Marlin_AT90USB - https://github.com/Bob-the-Kuhn/Marlin_AT90USB
* This is the only known IDE extension that is compatible with the pin definitions * This is the only known IDE extension that is compatible with the pin definitions
@ -49,20 +55,20 @@
* https://rawgit.com/Bob-the-Kuhn/Marlin_AT90USB/master/package_MARLIN_AT90USB_index.json * https://rawgit.com/Bob-the-Kuhn/Marlin_AT90USB/master/package_MARLIN_AT90USB_index.json
* 2. Under Tools -> Board -> Boards manager, scroll to the bottom, click on MARLIN_AT90USB * 2. Under Tools -> Board -> Boards manager, scroll to the bottom, click on MARLIN_AT90USB
* and then click on "Install" * and then click on "Install"
* 3. Select "AT90USB646_STANDARD" from the 'Tools -> Boards' menu. * 3. Select "AT90USB646_TEENSYPP" from the 'Tools -> Boards' menu.
*/ */
/** /**
* To burn the bootloader that comes with Marlin_AT90USB: * To burn the bootloader that comes with Marlin_AT90USB:
* *
* 1. Connect your programmer to the board. * 1. Connect your programmer to the board.
* 2. In Arduino IDE select "AT90USB646_STANDARD" and then select the programmer. * 2. In Arduino IDE select "AT90USB646_TEENSYPP" and then select the programmer.
* 3. In Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. * 3. In Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message.
* 4. The programmer is no longer needed. Remove it. * 4. The programmer is no longer needed. Remove it.
*/ */
#ifndef __AVR_AT90USB646__ #ifndef __AVR_AT90USB646__
#error "Oops! Make sure you have 'Brainwave' selected from the 'Tools -> Boards' menu." #error "Oops! Make sure you have 'AT90USB646_TEENSYPP' selected from the 'Tools -> Boards' menu."
#endif #endif
#define BOARD_NAME "Brainwave" #define BOARD_NAME "Brainwave"
@ -72,48 +78,48 @@
// //
// Limit Switches // Limit Switches
// //
#define X_STOP_PIN 7 #define X_STOP_PIN 35 // A7
#define Y_STOP_PIN 6 #define Y_STOP_PIN 34 // A6
#define Z_STOP_PIN 5 #define Z_STOP_PIN 33 // A5
// //
// Steppers // Steppers
// //
#define X_STEP_PIN 27 #define X_STEP_PIN 3 // D3
#define X_DIR_PIN 29 #define X_DIR_PIN 5 // D5
#define X_ENABLE_PIN 28 #define X_ENABLE_PIN 4 // D4
#define X_ATT_PIN 26 #define X_ATT_PIN 2 // D2
#define Y_STEP_PIN 31 #define Y_STEP_PIN 7 // D7
#define Y_DIR_PIN 33 #define Y_DIR_PIN 9 // E1
#define Y_ENABLE_PIN 32 #define Y_ENABLE_PIN 8 // E0
#define Y_ATT_PIN 30 #define Y_ATT_PIN 6 // D6
#define Z_STEP_PIN 17 #define Z_STEP_PIN 11 // C1
#define Z_DIR_PIN 19 #define Z_DIR_PIN 13 // C3
#define Z_ENABLE_PIN 18 #define Z_ENABLE_PIN 12 // C2
#define Z_ATT_PIN 16 #define Z_ATT_PIN 10 // C0
#define E0_STEP_PIN 21 #define E0_STEP_PIN 15 // C5
#define E0_DIR_PIN 23 #define E0_DIR_PIN 17 // C7
#define E0_ENABLE_PIN 22 #define E0_ENABLE_PIN 16 // C6
#define E0_ATT_PIN 20 #define E0_ATT_PIN 14 // C4
// //
// Temperature Sensors // Temperature Sensors
// //
#define TEMP_0_PIN 7 // Analog Input #define TEMP_0_PIN 7 // F7 Analog Input
#define TEMP_BED_PIN 6 // Analog Input #define TEMP_BED_PIN 6 // F6 Analog Input
// //
// Heaters / Fans // Heaters / Fans
// //
#define HEATER_0_PIN 4 // Extruder #define HEATER_0_PIN 32 // A4 Extruder
#define HEATER_BED_PIN 38 // Bed #define HEATER_BED_PIN 18 // E6 Bed
#define FAN_PIN 3 // Fan #define FAN_PIN 31 // A3 Fan
// //
// Misc. Functions // Misc. Functions
// //
#define LED_PIN 39 #define LED_PIN 19 // E7

@ -1,6 +1,6 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
@ -32,11 +32,16 @@
* *
* Added pointers to currently available Arduino IDE extensions that will * Added pointers to currently available Arduino IDE extensions that will
* allow this board to use the latest Marlin software * allow this board to use the latest Marlin software
*
*
* Rev C 2 JUN 2017
*
* Converted to Arduino pin numbering
*/ */
/** /**
* There are three Arduino IDE extensions that are compatible with this board * There are two Arduino IDE extensions that are compatible with this board
* and with the mainstream Marlin software. All have been used with Arduino 1.6.12 * and with the mainstream Marlin software.
* *
* Teensyduino - http://www.pjrc.com/teensy/teensyduino.html * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html
* Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu * Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu
@ -45,8 +50,6 @@
* libraries - they are not used with the Marlin software. * libraries - they are not used with the Marlin software.
* *
* Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support
* This is basically Teensyduino but with a bootloader that can handle image sizes
* larger than 64K.
* *
* Installation: * Installation:
* *
@ -58,39 +61,21 @@
* 3. Restart Arduino. * 3. Restart Arduino.
* 4. Select "Printrboard" from the 'Tools -> Boards' menu. * 4. Select "Printrboard" from the 'Tools -> Boards' menu.
* *
* Marlin_AT90USB - https://github.com/Bob-the-Kuhn/Marlin_AT90USB * Teensyduino is the most popular option. Printrboard is used if your board doesn't have
* Uses the bootloader from Printerboard above. * the Teensyduino bootloader on it.
*
* "Marlin_AT90USB" makes PWM0A available rather than the usual PWM1C. These PWMs share
* the same physical pin. Marlin uses TIMER1 to generate interrupts and sets it up such
* that PWM1A, PWM1B & PWM1C can't be used.
*
* Installation:
*
* 1. In the Arduino IDE, under Files -> Preferences paste the following URL
* https://rawgit.com/Bob-the-Kuhn/Marlin_AT90USB/master/package_MARLIN_AT90USB_index.json
* 2. Under Tools -> Board -> Boards manager, scroll to the bottom, click on MARLIN_AT90USB
* and then click on "Install"
* 3. Select "AT90USB1286_TEENSYPP" from the 'Tools -> Boards' menu.
*/ */
/** /**
* To burn the bootloader that comes with Printrboard and Marlin_AT90USB: * To burn the bootloader that comes with Printrboard:
* *
* 1. Connect your programmer to the board. * 1. Connect your programmer to the board.
* 2. In the Arduino IDE select "Printrboard" or "AT90USB1286_TEENSYPP" and then select the programmer. * 2. In the Arduino IDE select "Printrboard" and then select the programmer.
* 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message. * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message.
* 4. The programmer is no longer needed. Remove it. * 4. The programmer is no longer needed. Remove it.
*/ */
#ifndef __AVR_AT90USB1286__ #ifndef __AVR_AT90USB1286__
#error "Oops! Make sure you have 'Teensy++ 2.0', 'AT90USB1286_TEENSYPP', or 'Printrboard' selected from the 'Tools -> Boards' menu." #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu."
#endif
#include "fastio.h"
#if DISABLED(AT90USBxx_TEENSYPP_ASSIGNMENTS) // use Teensyduino Teensy++2.0 pin assignments instead of Marlin alphabetical.
#error "Uncomment '#define AT90USBxx_TEENSYPP_ASSIGNMENTS' in fastio.h for this config"
#endif #endif
#define BOARD_NAME "Brainwave Pro" #define BOARD_NAME "Brainwave Pro"
@ -101,53 +86,53 @@
// //
// Limit Switches // Limit Switches
// //
#define X_STOP_PIN 47 #define X_STOP_PIN 45 // F7
#define Y_STOP_PIN 18 #define Y_STOP_PIN 12 // C2
#define Z_MAX_PIN 36 #define Z_STOP_PIN 36 // E4
// //
// Z Probe (when not Z_MIN_PIN) // Z Probe (when not Z_MIN_PIN)
// //
#ifndef Z_MIN_PROBE_PIN #ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 17 #define Z_MIN_PROBE_PIN 11 // C1
#endif #endif
// //
// Steppers // Steppers
// //
#define X_STEP_PIN 33 #define X_STEP_PIN 9 // E1
#define X_DIR_PIN 32 #define X_DIR_PIN 8 // E0
#define X_ENABLE_PIN 11 #define X_ENABLE_PIN 23 // B3
#define Y_STEP_PIN 31 #define Y_STEP_PIN 7 // D7
#define Y_DIR_PIN 30 #define Y_DIR_PIN 6 // D6
#define Y_ENABLE_PIN 8 #define Y_ENABLE_PIN 20 // B0
#define Z_STEP_PIN 29 #define Z_STEP_PIN 5 // D5
#define Z_DIR_PIN 28 #define Z_DIR_PIN 4 // D4
#define Z_ENABLE_PIN 37 #define Z_ENABLE_PIN 37 // E5
#define E0_STEP_PIN 35 #define E0_STEP_PIN 47 // E3
#define E0_DIR_PIN 34 #define E0_DIR_PIN 46 // E2
#define E0_ENABLE_PIN 13 #define E0_ENABLE_PIN 25 // B5
// //
// Temperature Sensors // Temperature Sensors
// //
#define TEMP_0_PIN 2 // Analog Input #define TEMP_0_PIN 2 // F2 Analog Input
#define TEMP_1_PIN 1 // Analog Input #define TEMP_1_PIN 1 // F1 Analog Input
#define TEMP_BED_PIN 0 // Analog Input #define TEMP_BED_PIN 0 // F0 Analog Input
// //
// Heaters / Fans // Heaters / Fans
// //
#define HEATER_0_PIN 15 #define HEATER_0_PIN 27 // B7
#define HEATER_BED_PIN 14 // Bed #define HEATER_BED_PIN 26 // B6 Bed
#define FAN_PIN 16 // Fan, PWM #define FAN_PIN 16 // C6 Fan, PWM3A
// //
// Misc. Functions // Misc. Functions
// //
#define SDSS 20 #define SDSS 20 // B0
#define SD_DETECT_PIN 12 #define SD_DETECT_PIN 24 // B4
#define LED_PIN 19 #define LED_PIN 13 // C3

@ -131,7 +131,7 @@
#define SDSS 53 #define SDSS 53
#define LED_PIN 13 #define LED_PIN 13
#define PS_ON_PIN 12 #define PS_ON_PIN 12
#define CASE_LIGHT_PIN 45 // try the keypad connector #define CASE_LIGHT_PIN 45 // Try the keypad connector
// //
// LCD / Controller // LCD / Controller

@ -211,12 +211,12 @@
// //
#ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER #ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
#define LCD_PINS_RS 33 // C4, LCD-STROBE #define LCD_PINS_RS 33 // C4: LCD-STROBE
#define LCD_PINS_ENABLE 72 // J2, LEFT #define LCD_PINS_ENABLE 72 // J2: LEFT
#define LCD_PINS_D4 35 // C2, LCD-CLK #define LCD_PINS_D4 35 // C2: LCD-CLK
#define LCD_PINS_D5 32 // C5, RLED #define LCD_PINS_D5 32 // C5: RLED
#define LCD_PINS_D6 34 // C3, LCD-DATA #define LCD_PINS_D6 34 // C3: LCD-DATA
#define LCD_PINS_D7 31 // C6, GLED #define LCD_PINS_D7 31 // C6: GLED
#define BTN_EN2 75 // J4, UP #define BTN_EN2 75 // J4, UP
#define BTN_EN1 73 // J3, DOWN #define BTN_EN1 73 // J3, DOWN
@ -275,9 +275,6 @@
// Check if all pins are defined in mega/pins_arduino.h // Check if all pins are defined in mega/pins_arduino.h
#include <Arduino.h> #include <Arduino.h>
static_assert(NUM_DIGITAL_PINS > MAX_PIN, "add missing pins to [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h based on fastio.h" static_assert(NUM_DIGITAL_PINS > MAX_PIN, "add missing pins to [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h based on fastio.h"

@ -1,6 +1,6 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
@ -21,18 +21,48 @@
*/ */
/** /**
* Printrboard pin assignments (AT90USB1286) * Rev B 2 JUN 2017
* Requires the Teensyduino software with Teensy++ 2.0 selected in Arduino IDE! *
* http://www.pjrc.com/teensy/teensyduino.html * Converted to Arduino pin numbering
* See http://reprap.org/wiki/Printrboard for more info
*/ */
#ifndef __AVR_AT90USB1286__ /**
#error "Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu." * There are two Arduino IDE extensions that are compatible with this board
#endif * and with the mainstream Marlin software.
*
* Teensyduino - http://www.pjrc.com/teensy/teensyduino.html
* Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu
*
* Installation instructions are at the above URL. Don't bother loading the
* libraries - they are not used with the Marlin software.
*
* Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support
*
* Installation:
*
* 1. Go to the above URL, click on the "Clone or Download" button and then
* click on "Download ZIP" button.
* 2. Unzip the file, find the "printrboard" directory and then copy it to the
* hardware directory in Arduino. The Arduino hardware directory will probably
* be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware.
* 3. Restart Arduino.
* 4. Select "Printrboard" from the 'Tools -> Boards' menu.
*
* Teensyduino is the most popular option. Printrboard is used if your board doesn't have
* the Teensyduino bootloader on it.
*/
#if ENABLED(AT90USBxx_TEENSYPP_ASSIGNMENTS) // use Teensyduino Teensy++2.0 pin assignments instead of Marlin traditional. /**
#error "These Printrboard assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h" * To burn the bootloader that comes with Printrboard:
*
* 1. Connect your programmer to the board.
* 2. In the Arduino IDE select "Printrboard" and then select the programmer.
* 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message.
* 4. The programmer is no longer needed. Remove it.
*/
#ifndef __AVR_AT90USB1286__
#error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu."
#endif #endif
#define BOARD_NAME "Printrboard" #define BOARD_NAME "Printrboard"
@ -46,32 +76,32 @@
// //
// Limit Switches // Limit Switches
// //
#define X_STOP_PIN 35 #define X_STOP_PIN 47 // E3
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#define Y_STOP_PIN 37 // Move Ystop to Estop socket #define Y_STOP_PIN 37 // E5 - Move Ystop to Estop socket
#else #else
#define Y_STOP_PIN 8 // Ystop in Ystop socket #define Y_STOP_PIN 20 // B0 SS - Ystop in Ystop socket
#endif #endif
#define Z_STOP_PIN 36 #define Z_STOP_PIN 36 // E4
// //
// Steppers // Steppers
// //
#define X_STEP_PIN 0 #define X_STEP_PIN 28 // A0
#define X_DIR_PIN 1 #define X_DIR_PIN 29 // A1
#define X_ENABLE_PIN 39 #define X_ENABLE_PIN 19 // E7
#define Y_STEP_PIN 2 #define Y_STEP_PIN 30 // A2
#define Y_DIR_PIN 3 #define Y_DIR_PIN 31 // A3
#define Y_ENABLE_PIN 38 #define Y_ENABLE_PIN 18 // E6
#define Z_STEP_PIN 4 #define Z_STEP_PIN 32 // A4
#define Z_DIR_PIN 5 #define Z_DIR_PIN 33 // A5
#define Z_ENABLE_PIN 23 #define Z_ENABLE_PIN 17 // C7
#define E0_STEP_PIN 6 #define E0_STEP_PIN 34 // A6
#define E0_DIR_PIN 7 #define E0_DIR_PIN 35 // A7
#define E0_ENABLE_PIN 19 #define E0_ENABLE_PIN 13 // C3
// //
// Temperature Sensors // Temperature Sensors
@ -82,27 +112,19 @@
// //
// Heaters / Fans // Heaters / Fans
// //
#define HEATER_0_PIN 21 // Extruder #define HEATER_0_PIN 15 // C5 PWM3B - Extruder
#define HEATER_1_PIN 46 #define HEATER_1_PIN 44 // F6
#define HEATER_2_PIN 47 #define HEATER_2_PIN 45 // F7
#define HEATER_BED_PIN 20 #define HEATER_BED_PIN 14 // C4 PWM3C
// If soft or fast PWM is off then use Teensyduino pin numbering, Marlin
// fastio pin numbering otherwise #define FAN_PIN 16 // C6 PWM3A
#if ENABLED(FAN_SOFT_PWM) || ENABLED(FAST_PWM_FAN)
#define FAN_PIN 22
#else
#define FAN_PIN 16
#endif
// //
// Misc. Functions // Misc. Functions
// //
#define SDSS 26 #define SDSS 20 // B0 SS
#define FILWIDTH_PIN 2 // Analog Input
#ifndef FILWIDTH_PIN
#define FILWIDTH_PIN 2 // Analog Input
#endif
// //
// LCD / Controller // LCD / Controller
@ -113,45 +135,44 @@
// LCD Pins // LCD Pins
#if ENABLED(LCD_I2C_PANELOLU2) #if ENABLED(LCD_I2C_PANELOLU2)
#define BTN_EN1 27 // RX1 - fastio.h pin mapping 27 #define BTN_EN1 3 // D3 RX1 JP2-7
#define BTN_EN2 26 // TX1 - fastio.h pin mapping 26 #define BTN_EN2 2 // D2 TX1 JP2-5
#define BTN_ENC 43 // A3 - fastio.h pin mapping 43 #define BTN_ENC 41 // F3 JP2-4
#define SDSS 40 // use SD card on Panelolu2 (Teensyduino pin mapping) #define SDSS 38 // F0 B-THERM connector - use SD card on Panelolu2
#else #else
#define BTN_EN1 16 #define BTN_EN1 10 // C0 JP11-12
#define BTN_EN2 17 #define BTN_EN2 11 // C1 JP11-13
#define BTN_ENC 18 // the click #define BTN_ENC 12 // C2 JP11-14
#endif // LCD_I2C_PANELOLU2 #endif
// not connected to a pin // not connected
#define SD_DETECT_PIN -1 #define SD_DETECT_PIN -1
#define LCD_PINS_RS 9 #define LCD_PINS_RS 9 // E1 JP11-11
#define LCD_PINS_ENABLE 8 #define LCD_PINS_ENABLE 8 // E0 JP11-10
#define LCD_PINS_D4 7 #define LCD_PINS_D4 7 // D7 JP11-8
#define LCD_PINS_D5 6 #define LCD_PINS_D5 6 // D6 JP11-7
#define LCD_PINS_D6 5 #define LCD_PINS_D6 5 // D5 JP11-6
#define LCD_PINS_D7 4 #define LCD_PINS_D7 4 // D4 JP11-5
#endif // ULTRA_LCD && NEWPANEL #endif // ULTRA_LCD && NEWPANEL
#if ENABLED(VIKI2) || ENABLED(miniVIKI) #if ENABLED(VIKI2) || ENABLED(miniVIKI)
// FastIO #define BEEPER_PIN 8 // E0 JP11-10
#define BEEPER_PIN 32
// Pins for DOGM SPI LCD Support // Pins for DOGM SPI LCD Support
#define DOGLCD_A0 42 // Non-FastIO #define DOGLCD_A0 40 // F2 JP2-2
#define DOGLCD_CS 43 // Non-FastIO #define DOGLCD_CS 41 // F3 JP2-4
#define LCD_SCREEN_ROT_180 #define LCD_SCREEN_ROT_180
// The encoder and click button (FastIO Pins) // The encoder and click button
#define BTN_EN1 26 #define BTN_EN1 2 // D2 TX1 JP2-5
#define BTN_EN2 27 #define BTN_EN2 3 // D3 RX1 JP2-7
#define BTN_ENC 47 #define BTN_ENC 45 // F7 TDI JP2-12
#define SDSS 45 #define SDSS 43 // F5 TMS JP2-8
#define SD_DETECT_PIN -1 // FastIO (Manual says 72 I'm not certain cause I can't test) #define SD_DETECT_PIN -1
#define STAT_LED_RED_PIN 12 // Non-FastIO #define STAT_LED_RED_PIN 12 // C2 JP11-14
#define STAT_LED_BLUE_PIN 10 // Non-FastIO #define STAT_LED_BLUE_PIN 10 // C0 JP11-12
#endif #endif

@ -1,6 +1,6 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
@ -21,18 +21,48 @@
*/ */
/** /**
* Printrboard pin assignments (AT90USB1286) * Rev B 2 JUN 2017
* Requires the Teensyduino software with Teensy++ 2.0 selected in Arduino IDE! *
* http://www.pjrc.com/teensy/teensyduino.html * Converted to Arduino pin numbering
* See http://reprap.org/wiki/Printrboard for more info
*/ */
#ifndef __AVR_AT90USB1286__ /**
#error "Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu." * There are two Arduino IDE extensions that are compatible with this board
#endif * and with the mainstream Marlin software.
*
* Teensyduino - http://www.pjrc.com/teensy/teensyduino.html
* Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu
*
* Installation instructions are at the above URL. Don't bother loading the
* libraries - they are not used with the Marlin software.
*
* Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support
*
* Installation:
*
* 1. Go to the above URL, click on the "Clone or Download" button and then
* click on "Download ZIP" button.
* 2. Unzip the file, find the "printrboard" directory and then copy it to the
* hardware directory in Arduino. The Arduino hardware directory will probably
* be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware.
* 3. Restart Arduino.
* 4. Select "Printrboard" from the 'Tools -> Boards' menu.
*
* Teensyduino is the most popular option. Printrboard is used if your board doesn't have
* the Teensyduino bootloader on it.
*/
#if ENABLED(AT90USBxx_TEENSYPP_ASSIGNMENTS) // use Teensyduino Teensy++2.0 pin assignments instead of Marlin traditional. /**
#error "These Printrboard assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h" * To burn the bootloader that comes with Printrboard:
*
* 1. Connect your programmer to the board.
* 2. In the Arduino IDE select "Printrboard" and then select the programmer.
* 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message.
* 4. The programmer is no longer needed. Remove it.
*/
#ifndef __AVR_AT90USB1286__
#error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu."
#endif #endif
#define BOARD_NAME "Printrboard Rev F" #define BOARD_NAME "Printrboard Rev F"
@ -41,28 +71,28 @@
// //
// Limit Switches // Limit Switches
// //
#define X_STOP_PIN 35 #define X_STOP_PIN 47 // E3
#define Y_STOP_PIN 12 #define Y_STOP_PIN 24 // B4 PWM2A
#define Z_STOP_PIN 36 #define Z_STOP_PIN 36 // E4
// //
// Steppers // Steppers
// //
#define X_STEP_PIN 0 #define X_STEP_PIN 28 // A0
#define X_DIR_PIN 1 #define X_DIR_PIN 29 // A1
#define X_ENABLE_PIN 39 #define X_ENABLE_PIN 19 // E7
#define Y_STEP_PIN 2 #define Y_STEP_PIN 30 // A2
#define Y_DIR_PIN 3 #define Y_DIR_PIN 31 // A3
#define Y_ENABLE_PIN 38 #define Y_ENABLE_PIN 18 // E6
#define Z_STEP_PIN 4 #define Z_STEP_PIN 32 // A4
#define Z_DIR_PIN 5 #define Z_DIR_PIN 33 // A5
#define Z_ENABLE_PIN 23 #define Z_ENABLE_PIN 17 // C7
#define E0_STEP_PIN 6 #define E0_STEP_PIN 34 // A6
#define E0_DIR_PIN 7 #define E0_DIR_PIN 35 // A7
#define E0_ENABLE_PIN 19 #define E0_ENABLE_PIN 13 // C3
// uncomment to enable an I2C based DAC like on the Printrboard REVF // uncomment to enable an I2C based DAC like on the Printrboard REVF
#define DAC_STEPPER_CURRENT #define DAC_STEPPER_CURRENT
@ -85,27 +115,18 @@
// //
// Heaters / Fans // Heaters / Fans
// //
#define HEATER_0_PIN 21 // Extruder #define HEATER_0_PIN 15 // C5 PWM3B - Extruder
#define HEATER_1_PIN 46 #define HEATER_1_PIN 44 // F6
#define HEATER_2_PIN 47 #define HEATER_2_PIN 45 // F7
#define HEATER_BED_PIN 20 #define HEATER_BED_PIN 14 // C4 PWM3C
// If soft or fast PWM is off then use Teensyduino pin numbering, Marlin #define FAN_PIN 16 // C6 PWM3A
// fastio pin numbering otherwise
#if ENABLED(FAN_SOFT_PWM) || ENABLED(FAST_PWM_FAN)
#define FAN_PIN 22
#else
#define FAN_PIN 16
#endif
// //
// Misc. Functions // Misc. Functions
// //
#define SDSS 20 // Teensylu pin mapping #define SDSS 20 // B0 SS
#define FILWIDTH_PIN 2 // Analog Input
#ifndef FILWIDTH_PIN
#define FILWIDTH_PIN 2 // Analog Input
#endif
// //
// LCD / Controller // LCD / Controller
@ -113,40 +134,33 @@
#if ENABLED(ULTRA_LCD) #if ENABLED(ULTRA_LCD)
#define BEEPER_PIN -1 #define BEEPER_PIN -1
#define LCD_PINS_RS 9 #define LCD_PINS_RS 9 // E1 JP11-11
#define LCD_PINS_ENABLE 8 #define LCD_PINS_ENABLE 8 // E0 JP11-10
#define LCD_PINS_D4 7 #define LCD_PINS_D4 7 // D7 JP11-8
#define LCD_PINS_D5 6 #define LCD_PINS_D5 6 // D6 JP11-7
#define LCD_PINS_D6 5 #define LCD_PINS_D6 5 // D5 JP11-6
#define LCD_PINS_D7 4 #define LCD_PINS_D7 4 // D4 JP11-5
#define BTN_EN1 16 #define BTN_EN1 10 // C0 JP11-12
#define BTN_EN2 17 #define BTN_EN2 11 // C1 JP11-13
#define BTN_ENC 18 // the click #define BTN_ENC 12 // C2 JP11-14
#define SD_DETECT_PIN -1 #define SD_DETECT_PIN -1
// encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif #endif
#if ENABLED(VIKI2) || ENABLED(miniVIKI) #if ENABLED(VIKI2) || ENABLED(miniVIKI)
#define BEEPER_PIN 32 // FastIO #define BEEPER_PIN 8 // E0 JP11-10
#define DOGLCD_A0 42 // Non-FastIO #define DOGLCD_A0 40 // F2 JP2-2
#define DOGLCD_CS 43 // Non-FastIO #define DOGLCD_CS 41 // F3 JP2-4
#define LCD_SCREEN_ROT_180 #define LCD_SCREEN_ROT_180
// (FastIO Pins) #define BTN_EN1 2 // D2 TX1 JP2-5
#define BTN_EN1 26 #define BTN_EN2 3 // D3 RX1 JP2-7
#define BTN_EN2 27 #define BTN_ENC 45 // F7 TDI JP2-12
#define BTN_ENC 47
#define SDSS 45 #define SDSS 43 // F5 TMS JP2-8
#define SD_DETECT_PIN -1 // FastIO (Manual says 72) #define SD_DETECT_PIN -1
#define STAT_LED_RED_PIN 12 // Non-FastIO #define STAT_LED_RED_PIN 12 // C2 JP11-14
#define STAT_LED_BLUE_PIN 10 // Non-FastIO #define STAT_LED_BLUE_PIN 10 // C0 JP11-12
#endif #endif

@ -251,6 +251,7 @@
#if ENABLED(NEWPANEL) #if ENABLED(NEWPANEL)
#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
#define BEEPER_PIN 37 #define BEEPER_PIN 37
#define BTN_EN1 31 #define BTN_EN1 31
@ -265,26 +266,32 @@
#endif #endif
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#define BTN_EN1 64 #define BTN_EN1 64
#define BTN_EN2 59 #define BTN_EN2 59
#define BTN_ENC 63 #define BTN_ENC 63
#define SD_DETECT_PIN 42 #define SD_DETECT_PIN 42
#elif ENABLED(LCD_I2C_PANELOLU2) #elif ENABLED(LCD_I2C_PANELOLU2)
#define BTN_EN1 47 // reverse if the encoder turns the wrong way.
#define BTN_EN1 47
#define BTN_EN2 43 #define BTN_EN2 43
#define BTN_ENC 32 #define BTN_ENC 32
#define LCD_SDSS 53 #define LCD_SDSS 53
#define SD_DETECT_PIN -1 #define SD_DETECT_PIN -1
#define KILL_PIN 41 #define KILL_PIN 41
#elif ENABLED(LCD_I2C_VIKI) #elif ENABLED(LCD_I2C_VIKI)
#define BTN_EN1 22 // reverse if the encoder turns the wrong way.
#define BTN_EN2 7 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42.
// tells about 40/42. #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13.
// 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13.
#define BTN_ENC -1 #define BTN_ENC -1
#define LCD_SDSS 53 #define LCD_SDSS 53
#define SD_DETECT_PIN 49 #define SD_DETECT_PIN 49
#elif ENABLED(VIKI2) || ENABLED(miniVIKI) #elif ENABLED(VIKI2) || ENABLED(miniVIKI)
#define BEEPER_PIN 33 #define BEEPER_PIN 33
// Pins for DOGM SPI LCD Support // Pins for DOGM SPI LCD Support
@ -305,7 +312,7 @@
#define STAT_LED_BLUE_PIN 35 #define STAT_LED_BLUE_PIN 35
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
#define BTN_EN1 35 // reverse if the encoder turns the wrong way. #define BTN_EN1 35
#define BTN_EN2 37 #define BTN_EN2 37
#define BTN_ENC 31 #define BTN_ENC 31
#define SD_DETECT_PIN 49 #define SD_DETECT_PIN 49
@ -344,12 +351,12 @@
// buttons are directly attached using AUX-2 // buttons are directly attached using AUX-2
#if ENABLED(REPRAPWORLD_KEYPAD) #if ENABLED(REPRAPWORLD_KEYPAD)
#define BTN_EN1 64 // encoder #define BTN_EN1 64
#define BTN_EN2 59 // encoder #define BTN_EN2 59
#define BTN_ENC 63 // enter button #define BTN_ENC 63
#define SHIFT_OUT 40 // shift register #define SHIFT_OUT 40
#define SHIFT_CLK 44 // shift register #define SHIFT_CLK 44
#define SHIFT_LD 42 // shift register #define SHIFT_LD 42
#elif ENABLED(PANEL_ONE) #elif ENABLED(PANEL_ONE)
#define BTN_EN1 59 // AUX2 PIN 3 #define BTN_EN1 59 // AUX2 PIN 3
#define BTN_EN2 63 // AUX2 PIN 4 #define BTN_EN2 63 // AUX2 PIN 4
@ -357,7 +364,7 @@
#else #else
#define BTN_EN1 37 #define BTN_EN1 37
#define BTN_EN2 35 #define BTN_EN2 35
#define BTN_ENC 31 // the click #define BTN_ENC 31
#endif #endif
#if ENABLED(G3D_PANEL) #if ENABLED(G3D_PANEL)

@ -1,6 +1,6 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
@ -21,14 +21,48 @@
*/ */
/** /**
* SAV MkI pin assignments (AT90USB1286) * Rev B 2 JUN 2017
* Requires the Teensyduino software with Teensy++ 2.0 selected in Arduino IDE! *
* http://www.pjrc.com/teensy/teensyduino.html * Converted to Arduino pin numbering
* RepRap Clone Wars project board. */
/**
* There are two Arduino IDE extensions that are compatible with this board
* and with the mainstream Marlin software.
*
* Teensyduino - http://www.pjrc.com/teensy/teensyduino.html
* Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu
*
* Installation instructions are at the above URL. Don't bother loading the
* libraries - they are not used with the Marlin software.
*
* Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support
*
* Installation:
*
* 1. Go to the above URL, click on the "Clone or Download" button and then
* click on "Download ZIP" button.
* 2. Unzip the file, find the "printrboard" directory and then copy it to the
* hardware directory in Arduino. The Arduino hardware directory will probably
* be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware.
* 3. Restart Arduino.
* 4. Select "Printrboard" from the 'Tools -> Boards' menu.
*
* Teensyduino is the most popular option. Printrboard is used if your board doesn't have
* the Teensyduino bootloader on it.
*/
/**
* To burn the bootloader that comes with Printrboard:
*
* 1. Connect your programmer to the board.
* 2. In the Arduino IDE select "Printrboard" and then select the programmer.
* 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message.
* 4. The programmer is no longer needed. Remove it.
*/ */
#ifndef __AVR_AT90USB1286__ #ifndef __AVR_AT90USB1286__
#error "Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu." #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu."
#endif #endif
#define DEFAULT_MACHINE_NAME "SAV MkI" #define DEFAULT_MACHINE_NAME "SAV MkI"
@ -41,54 +75,54 @@
// //
// Servos // Servos
// //
#define SERVO0_PIN 41 // In teensy's pin definition for pinMode (in servo.cpp) #define SERVO0_PIN 39 // F1 In teensy's pin definition for pinMode (in servo.cpp)
// //
// Limit Switches // Limit Switches
// //
#define X_STOP_PIN 13 #define X_STOP_PIN 25 // B5
#define Y_STOP_PIN 14 #define Y_STOP_PIN 26 // B6
//#define Z_STOP_PIN 15 //#define Z_STOP_PIN 27 // B7
#define Z_STOP_PIN 36 // For inductive sensor. #define Z_STOP_PIN 36 // E4 For inductive sensor.
//#define E_STOP_PIN 36 // E4
// //
// Steppers // Steppers
// //
#define X_STEP_PIN 0 #define X_STEP_PIN 28 // A0
#define X_DIR_PIN 1 #define X_DIR_PIN 29 // A1
#define X_ENABLE_PIN 39 #define X_ENABLE_PIN 19 // E7
#define Y_STEP_PIN 2 #define Y_STEP_PIN 30 // A2
#define Y_DIR_PIN 3 #define Y_DIR_PIN 31 // A3
#define Y_ENABLE_PIN 38 #define Y_ENABLE_PIN 18 // E6
#define Z_STEP_PIN 4 #define Z_STEP_PIN 32 // A4
#define Z_DIR_PIN 5 #define Z_DIR_PIN 33 // A5
#define Z_ENABLE_PIN 23 #define Z_ENABLE_PIN 17 // C7
#define E0_STEP_PIN 6 #define E0_STEP_PIN 34 // A6
#define E0_DIR_PIN 7 #define E0_DIR_PIN 35 // A7
#define E0_ENABLE_PIN 19 #define E0_ENABLE_PIN 13 // C3
// //
// Temperature Sensors // Temperature Sensors
// //
#define TEMP_0_PIN 7 // Analog Input (Extruder) #define TEMP_0_PIN 7 // F7 Analog Input (Extruder)
#define TEMP_BED_PIN 6 // Analog Input (Bed) #define TEMP_BED_PIN 6 // F6 Analog Input (Bed)
// //
// Heaters / Fans // Heaters / Fans
// //
#define HEATER_0_PIN 21 // Extruder #define HEATER_0_PIN 15 // C5 PWM3B - Extruder
#define HEATER_BED_PIN 20 // Bed #define HEATER_BED_PIN 14 // C4 PWM3C - Bed
#define FAN_PIN 16 // Fan -- from Teensyduino environment. #define FAN_PIN 16 // C6 PWM3A
// For the fan and Teensyduino uses a different pin mapping.
// //
// Misc. Functions // Misc. Functions
// //
#define SDSS 20 // PB0 - 8 in marlin env. #define SDSS 20 // B0
// Extension header pin mapping // Extension header pin mapping
// ---------------------------- // ----------------------------
@ -99,21 +133,21 @@
// PWM-D24 A4 (An), IO // PWM-D24 A4 (An), IO
// 5V GND // 5V GND
// 12V GND // 12V GND
#define EXT_AUX_SCL_D0 0 // 0 (teensy), 24 (marlin) #define EXT_AUX_SCL_D0 0 // D0 PWM0B
#define EXT_AUX_SDA_D1 1 // 1 (teensy), 25 (marlin) #define EXT_AUX_SDA_D1 1 // D1
#define EXT_AUX_RX1_D2 26 // 2 (teensy), 26 (marlin) #define EXT_AUX_RX1_D2 2 // D2
#define EXT_AUX_TX1_D3 27 // 3 (teensy), 27 (marlin) #define EXT_AUX_TX1_D3 3 // D3
#define EXT_AUX_PWM_D24 12 // 24 (teensy), 12 (marlin) #define EXT_AUX_PWM_D24 24 // B4 PWM2A
#define EXT_AUX_A0 0 // Analog #define EXT_AUX_A0 0 // F0 Analog Input
#define EXT_AUX_A0_IO 40 // Digital IO, 38 (teensy), 40 (marlin) #define EXT_AUX_A0_IO 38 // F0 Digital IO
#define EXT_AUX_A1 1 // Analog #define EXT_AUX_A1 1 // F1 Analog Input
#define EXT_AUX_A1_IO 41 // Digital IO, 39 (teensy), 41 (marlin) #define EXT_AUX_A1_IO 39 // F1 Digital IO
#define EXT_AUX_A2 2 // Analog #define EXT_AUX_A2 2 // F2 Analog Input
#define EXT_AUX_A2_IO 42 // Digital IO, 40 (teensy), 42 (marlin) #define EXT_AUX_A2_IO 40 // F2 Digital IO
#define EXT_AUX_A3 3 // Analog #define EXT_AUX_A3 3 // F3 Analog Input
#define EXT_AUX_A3_IO 43 // Digital IO, 41 (teensy), 43 (marlin) #define EXT_AUX_A3_IO 41 // F3 Digital IO
#define EXT_AUX_A4 4 // Analog #define EXT_AUX_A4 4 // F4 Analog Input
#define EXT_AUX_A4_IO 44 // Digital IO, 42 (teensy), 44 (marlin) #define EXT_AUX_A4_IO 42 // F4 Digital IO
// //
// LCD / Controller // LCD / Controller
@ -130,7 +164,7 @@
// For LCD SHIFT register LCD // For LCD SHIFT register LCD
#define SR_DATA_PIN EXT_AUX_SDA_D1 #define SR_DATA_PIN EXT_AUX_SDA_D1
#define SR_CLK_PIN EXT_AUX_SCL_D0 #define SR_CLK_PIN EXT_AUX_SCL_D0
#endif // SAV_3DLCD #endif
#if ENABLED(SAV_3DLCD) || ENABLED(SAV_3DGLCD) #if ENABLED(SAV_3DLCD) || ENABLED(SAV_3DGLCD)
@ -141,15 +175,15 @@
#define KILL_PIN EXT_AUX_A2_IO #define KILL_PIN EXT_AUX_A2_IO
#define HOME_PIN EXT_AUX_A4_IO #define HOME_PIN EXT_AUX_A4_IO
#else // Try to use the expansion header for spindle control #else // Use the expansion header for spindle control
// //
// M3/M4/M5 - Spindle/Laser Control // M3/M4/M5 - Spindle/Laser Control
// //
#define SPINDLE_LASER_PWM_PIN 24 // 12 AT90USB… pin # #define SPINDLE_LASER_PWM_PIN 24 // B4 PWM2A
#define SPINDLE_LASER_ENABLE_PIN 39 // Pin should have a pullup! 41 AT90USB… pin # #define SPINDLE_LASER_ENABLE_PIN 39 // F1 Pin should have a pullup!
#define SPINDLE_DIR_PIN 40 // 42 AT90USB… pin # #define SPINDLE_DIR_PIN 40 // F2
#define CASE_LIGHT_PIN 0 // 24 AT90USB… pin # #define CASE_LIGHT_PIN 0 // D0 PWM0B
#endif #endif

@ -1,6 +1,6 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
@ -20,13 +20,54 @@
* *
*/ */
/**
* Rev B 2 JUN 2017
*
* Converted to Arduino pin numbering
*/
/**
* There are two Arduino IDE extensions that are compatible with this board
* and with the mainstream Marlin software.
*
* Teensyduino - http://www.pjrc.com/teensy/teensyduino.html
* Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu
*
* Installation instructions are at the above URL. Don't bother loading the
* libraries - they are not used with the Marlin software.
*
* Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support
*
* Installation:
*
* 1. Go to the above URL, click on the "Clone or Download" button and then
* click on "Download ZIP" button.
* 2. Unzip the file, find the "printrboard" directory and then copy it to the
* hardware directory in Arduino. The Arduino hardware directory will probably
* be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware.
* 3. Restart Arduino.
* 4. Select "Printrboard" from the 'Tools -> Boards' menu.
*
* Teensyduino is the most popular option. Printrboard is used if your board doesn't have
* the Teensyduino bootloader on it.
*/
/**
* To burn the bootloader that comes with Printrboard:
*
* 1. Connect your programmer to the board.
* 2. In the Arduino IDE select "Printrboard" and then select the programmer.
* 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message.
* 4. The programmer is no longer needed. Remove it.
*/
/** /**
* Teensy++ 2.0 Breadboard pin assignments (AT90USB1286) * Teensy++ 2.0 Breadboard pin assignments (AT90USB1286)
* Requires the Teensyduino software with Teensy++ 2.0 selected in Arduino IDE! * Requires the Teensyduino software with Teensy++ 2.0 selected in Arduino IDE!
* http://www.pjrc.com/teensy/teensyduino.html * http://www.pjrc.com/teensy/teensyduino.html
* See http://reprap.org/wiki/Printrboard for more info * See http://reprap.org/wiki/Printrboard for more info
* *
* CLI build: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84 make * CLI build: HARDWARE_MOTHERBOARD=84 make
* *
* DaveX plan for Teensylu/printrboard-type pinouts for a TeensyBreadboard: * DaveX plan for Teensylu/printrboard-type pinouts for a TeensyBreadboard:
* (ref teensylu & sprinter) * (ref teensylu & sprinter)
@ -66,12 +107,7 @@
*/ */
#ifndef __AVR_AT90USB1286__ #ifndef __AVR_AT90USB1286__
#error "Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu." #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu."
#endif
#if DISABLED(AT90USBxx_TEENSYPP_ASSIGNMENTS) // use Teensyduino Teensy++2.0 pin assignments instead of Marlin alphabetical.
#error "Uncomment #define AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h for this config"
// (or build from command line)
#endif #endif
#define BOARD_NAME "Teensy++2.0" #define BOARD_NAME "Teensy++2.0"
@ -82,68 +118,68 @@
// //
// Limit Switches // Limit Switches
// //
#define X_STOP_PIN 2 #define X_STOP_PIN 2 // D2
#define Y_STOP_PIN 3 #define Y_STOP_PIN 3 // D3
#define Z_STOP_PIN 4 #define Z_STOP_PIN 4 // D4
// //
// Steppers // Steppers
// //
#define X_STEP_PIN 28 // 0 Marlin #define X_STEP_PIN 28 // A0 Marlin
#define X_DIR_PIN 29 // 1 Marlin #define X_DIR_PIN 29 // A1 Marlin
#define X_ENABLE_PIN 26 #define X_ENABLE_PIN 26 // B6
#define Y_STEP_PIN 30 // 2 Marlin #define Y_STEP_PIN 30 // A2 Marlin
#define Y_DIR_PIN 31 // 3 #define Y_DIR_PIN 31 // A3
#define Y_ENABLE_PIN 26 // Shared w/x #define Y_ENABLE_PIN 26 // B6 Shared w/x
#define Z_STEP_PIN 32 // 4 #define Z_STEP_PIN 32 // A4
#define Z_DIR_PIN 33 // 5 #define Z_DIR_PIN 33 // A5
#define Z_ENABLE_PIN 26 // Shared w/x #define Z_ENABLE_PIN 26 // B6 Shared w/x
#define E0_STEP_PIN 34 // 6 #define E0_STEP_PIN 34 // A6
#define E0_DIR_PIN 35 // 7 #define E0_DIR_PIN 35 // A7
#define E0_ENABLE_PIN 26 // Shared w/x #define E0_ENABLE_PIN 26 // B6 Shared w/x
// //
// Temperature Sensors // Temperature Sensors
// //
#define TEMP_0_PIN 7 // Analog Input (Extruder) #define TEMP_0_PIN 7 // F7 Analog Input (Extruder)
#define TEMP_BED_PIN 6 // Analog Input (Bed) #define TEMP_BED_PIN 6 // F6 Analog Input (Bed)
// //
// Heaters / Fans // Heaters / Fans
// //
#define HEATER_0_PIN 15 // 21 // Extruder #define HEATER_0_PIN 15 // C5 PWM3B Extruder
#define HEATER_BED_PIN 14 // 20 // Bed #define HEATER_BED_PIN 14 // C4 PWM3C
#define FAN_PIN 16 // 22 // Fan #define FAN_PIN 16 // C6 PWM3A Fan
// //
// Misc. Functions // Misc. Functions
// //
#define SDSS 20 // 8 #define SDSS 20 // B0
#define LED_PIN 6 #define LED_PIN 6 // D6
#define PS_ON_PIN 27 #define PS_ON_PIN 27 // B7
#define CASE_LIGHT_PIN 1 // MUST BE HARDWARE PWM #define CASE_LIGHT_PIN 1 // D1 PWM2B MUST BE HARDWARE PWM
// //
// LCD / Controller // LCD / Controller
// //
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
#define LCD_PINS_RS 8 #define LCD_PINS_RS 8 // E0
#define LCD_PINS_ENABLE 9 #define LCD_PINS_ENABLE 9 // E1
#define LCD_PINS_D4 10 #define LCD_PINS_D4 10 // C0
#define LCD_PINS_D5 11 #define LCD_PINS_D5 11 // C1
#define LCD_PINS_D6 12 #define LCD_PINS_D6 12 // C2
#define LCD_PINS_D7 13 #define LCD_PINS_D7 13 // C3
#define BTN_EN1 38 #define BTN_EN1 38 // F0
#define BTN_EN2 39 #define BTN_EN2 39 // F1
#define BTN_ENC 40 #define BTN_ENC 40 // F2
#endif #endif
// //
// M3/M4/M5 - Spindle/Laser Control // M3/M4/M5 - Spindle/Laser Control
// //
#define SPINDLE_LASER_ENABLE_PIN 5 // Pin should have a pullup! #define SPINDLE_LASER_ENABLE_PIN 5 // D5 Pin should have a pullup!
#define SPINDLE_LASER_PWM_PIN 0 // MUST BE HARDWARE PWM #define SPINDLE_LASER_PWM_PIN 0 // D0 PWM0B MUST BE HARDWARE PWM
#define SPINDLE_DIR_PIN 7 #define SPINDLE_DIR_PIN 7 // D7

@ -21,54 +21,46 @@
*/ */
/** /**
* rev B 30 DEC 2016 * Rev C 2 JUN 2017
* *
* The original version of this file did NOT result in a useful program because: * Converted to Arduino pin numbering
* 1. The pin numbers assumed that the "#define AT90USBxx_TEENSYPP_ASSIGNMENTS" line */
* in FASTIO.h was commented out. There wasn't an Arduino IDE 1.6.x extension/package
* that supported this pin map so the latest Marlin wouldn't compile. /**
* 2. The silkscreen for the four end stops don't agree with the schematic. Activating * There are two Arduino IDE extensions that are compatible with this board
* the X endstop would tell the software that the Y endstop just went active. * and with the mainstream Marlin software. All have been used with Arduino 1.6.12
* 3. The thermistor inputs also had heater names assigned to them. The result was *
* thermistor inputs that were set to digital outputs. * Teensyduino - http://www.pjrc.com/teensy/teensyduino.html
* Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu
* *
* Rev B corrects the above problems by: * Installation instructions are at the above URL. Don't bother loading the
* 1. The "Marlin_AT90USB" extension/package was developed. This extension enables the * libraries - they are not used with the Marlin software.
* latest Marlin software to compile using Arduino IDE 1.6.x and 1.80.
* 2. The endstop pin numbers in this file were changed to match the silkscreen. This
* makes it a little confusing when trying to correlate the schematic with the pin
* numbers used in this file.
* 3. The offending heater names were deleted.
* *
* To create a useable image for Teensylu do the following: * Printrboard - https://github.com/scwimbush/Printrboard-HID-Arduino-IDE-Support
* a) Install the Marlin_AT90USB extension with either of the following methods: * This is basically Teensyduino but with a bootloader that can handle image sizes
* Automatic - paste this URL into preferences and then use Boards manager * larger than 64K.
* https://rawgit.com/Bob-the-Kuhn/Marlin_AT90USB/master/package_MARLIN_AT90USB_index.json
* Manual:
* 1. Copy the following URL into Go to "https://github.com/Bob-the-Kuhn/Marlin_AT90USB",
* click on the "Clone or Download" button and then click on "Download ZIP" button.
* 2. Unzip the file, find the "Marlin_AT90USB" directory and then copy it to the
* hardware directory in Arduino. The Arduino hardware directory will probably be
* located in a path similar to this: C:\Program Files (x86)\Arduino\hardware
* b) Connect the USBtinyISP to the board.
* c) In the Arduino IDE select the "AT90USB1286_STANDARD" board in the of the "Marlin_AT90USB"
* section and select the "USBtinyISP" programmer.
* d) In the Arduino IDE click on "burn bootloader". Don't worry about the "verify
* failed at 1F000" error message.
* e) The USBtinyISP programmer is no longer needed. Remove it.
* f) In FASTIO.h comment out the "#define AT90USBxx_TEENSYPP_ASSIGNMENTS" line.
* g) To upload a sketch do the following:
* 1. remove the jumper
* 2. press reset
* 3. click on the "upload" button in the Arduino IDE
* 4. wait until the upload finishes (less than a minute)
* 5. put the jumper back on
* 6. press the reset button
* *
* Installation:
*
* 1. Go to the above URL, click on the "Clone or Download" button and then
* click on "Download ZIP" button.
* 2. Unzip the file, find the "printrboard" directory and then copy it to the
* hardware directory in Arduino. The Arduino hardware directory will probably
* be located in a path similar to this: C:\Program Files (x86)\Arduino\hardware.
* 3. Restart Arduino.
* 4. Select "Printrboard" from the 'Tools -> Boards' menu.
*
* Teensyduino is the most popular option. Printrboard is used if your board doesn't have
* the Teensyduino bootloader on it.
*/
/**
* To burn the bootloader that comes with Printrboard:
* *
* NOTE - the "Marlin_AT90USB" pin maps make PWM0A available rather than the usual PWM1C. * 1. Connect your programmer to the board.
* These PWMs share the same physical pin. Marlin uses TIMER1 to generate * 2. In the Arduino IDE select "Printrboard" and then select the programmer.
* interrupts and sets it up such that PWM1A, PWM1B & PWM1C can't be used. * 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message.
* 4. The programmer is no longer needed. Remove it.
*/ */
/** /**
@ -81,13 +73,8 @@
* The pin assignments in this file match the silkscreen. * The pin assignments in this file match the silkscreen.
*/ */
#if !defined(__AVR_AT90USB1286__) && !defined(__AVR_AT90USB1286P__) #if !defined(__AVR_AT90USB1286__) && !defined(__AVR_AT90USB1286P__)
#error "Oops! Make sure you have 'AT90USB1286_STANDARD' selected from the 'Tools -> Boards' menu." #error "Oops! Make sure you have 'Teensy++ 2.0' or 'Printrboard' selected from the 'Tools -> Boards' menu."
#endif
#if ENABLED(AT90USBxx_TEENSYPP_ASSIGNMENTS)
#error "please disable (comment out) the AT90USBxx_TEENSYPP_ASSIGNMENTS flag in FASTIO.h "
#endif #endif
#define BOARD_NAME "Teensylu" #define BOARD_NAME "Teensylu"
@ -97,60 +84,60 @@
// //
// Limit Switche definitions that match the SCHEMATIC // Limit Switch definitions that match the SCHEMATIC
// //
//#define X_STOP_PIN 13 //#define X_STOP_PIN 25 // B5
//#define Y_STOP_PIN 14 //#define Y_STOP_PIN 26 // B6
//#define Z_STOP_PIN 15 //#define Z_STOP_PIN 27 // B7
//#define E_STOP_PIN 36 //#define E_STOP_PIN 36 // E4
// //
// Limit Switch definitions that match the SILKSCREEN // Limit Switch definitions that match the SILKSCREEN
// //
#define X_STOP_PIN 14 #define X_STOP_PIN 26 // B6
#define Y_STOP_PIN 15 #define Y_STOP_PIN 27 // B7
#define Z_STOP_PIN 36 #define Z_STOP_PIN 36 // E4
//#define E_STOP_PIN 13 //#define E_STOP_PIN 25 // B5
// //
// Steppers // Steppers
// //
#define X_STEP_PIN 0 #define X_STEP_PIN 28 // A0
#define X_DIR_PIN 1 #define X_DIR_PIN 29 // A1
#define X_ENABLE_PIN 39 #define X_ENABLE_PIN 19 // E7
#define Y_STEP_PIN 2 #define Y_STEP_PIN 30 // A2
#define Y_DIR_PIN 3 #define Y_DIR_PIN 31 // A3
#define Y_ENABLE_PIN 38 #define Y_ENABLE_PIN 18 // E6
#define Z_STEP_PIN 4 #define Z_STEP_PIN 32 // A4
#define Z_DIR_PIN 5 #define Z_DIR_PIN 33 // A5
#define Z_ENABLE_PIN 23 #define Z_ENABLE_PIN 17 // C7
#define E0_STEP_PIN 6
#define E0_DIR_PIN 7
#define E0_ENABLE_PIN 19
#define E0_STEP_PIN 34 // A6
#define E0_DIR_PIN 35 // A7
#define E0_ENABLE_PIN 13 // C3
//
// Temperature Sensors // Temperature Sensors
//
#define TEMP_0_PIN 7 // Analog Input (Extruder) #define TEMP_0_PIN 7 // Analog Input (Extruder)
#define TEMP_BED_PIN 6 // Analog Input (Bed) #define TEMP_BED_PIN 6 // Analog Input (Bed)
// //
// Heaters / Fans // Heaters / Fans
// //
#define HEATER_0_PIN 21 // Extruder #define HEATER_0_PIN 15 // C5 PWM3B - Extruder
#define HEATER_BED_PIN 20 #define HEATER_BED_PIN 14 // C4 PWM3C
#define FAN_PIN 22 #define FAN_PIN 16 // C6 PWM3A
// //
// Misc. Functions // Misc. Functions
// //
#define SDSS 8 #define SDSS 20 // B0 JP31-6
#define CASE_LIGHT_PIN 24 #define CASE_LIGHT_PIN 0 // D0 IO-14 PWM0B
// //
// LCD / Controller // LCD / Controller
@ -160,11 +147,11 @@
#define BEEPER_PIN -1 #define BEEPER_PIN -1
#if ENABLED(LCD_I2C_PANELOLU2) #if ENABLED(LCD_I2C_PANELOLU2)
#define BTN_EN1 27 #define BTN_EN1 3 // D3 IO-8
#define BTN_EN2 26 #define BTN_EN2 2 // D2 IO-10
#define BTN_ENC 43 #define BTN_ENC 41 // F3 IO-7
#define SDSS 40 // use SD card on Panelolu2 #define SDSS 38 // F0 IO-13 use SD card on Panelolu2
#endif // LCD_I2C_PANELOLU2 #endif
#define SD_DETECT_PIN -1 #define SD_DETECT_PIN -1
@ -173,6 +160,6 @@
// //
// M3/M4/M5 - Spindle/Laser Control // M3/M4/M5 - Spindle/Laser Control
// //
#define SPINDLE_LASER_PWM_PIN 12 // MUST BE HARDWARE PWM #define SPINDLE_LASER_PWM_PIN 24 // B4 IO-3 PWM2A - MUST BE HARDWARE PWM
#define SPINDLE_LASER_ENABLE_PIN 41 // Pin should have a pullup! #define SPINDLE_LASER_ENABLE_PIN 39 // F1 IO-11 - Pin should have a pullup!
#define SPINDLE_DIR_PIN 42 #define SPINDLE_DIR_PIN 40 // F2 IO-9

@ -49,7 +49,7 @@
bool dac_present = false; bool dac_present = false;
const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER; const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER;
uint16_t dac_channel_pct[XYZE] = DAC_MOTOR_CURRENT_DEFAULT; uint8_t dac_channel_pct[XYZE] = DAC_MOTOR_CURRENT_DEFAULT;
int dac_init() { int dac_init() {
#if PIN_EXISTS(DAC_DISABLE) #if PIN_EXISTS(DAC_DISABLE)
@ -95,7 +95,7 @@
static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * (1.0 / (DAC_STEPPER_SENSE)); } static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * (1.0 / (DAC_STEPPER_SENSE)); }
int16_t dac_current_get_percent(AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } int16_t dac_current_get_percent(AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); }
void dac_current_set_percents(int16_t pct[XYZE]) { void dac_current_set_percents(const int8_t pct[XYZE]) {
LOOP_XYZE(i) dac_channel_pct[i] = pct[dac_order[i]]; LOOP_XYZE(i) dac_channel_pct[i] = pct[dac_order[i]];
mcp4728_setDrvPct(dac_channel_pct); mcp4728_setDrvPct(dac_channel_pct);
} }

@ -50,7 +50,7 @@ lib_deps = ${common.lib_deps}
platform = teensy platform = teensy
framework = arduino framework = arduino
board = teensy20pp board = teensy20pp
build_flags = -I $BUILDSRC_DIR -D MOTHERBOARD=BOARD_BRAINWAVE_PRO -D AT90USBxx_TEENSYPP_ASSIGNMENTS build_flags = -I $BUILDSRC_DIR -D MOTHERBOARD=BOARD_BRAINWAVE_PRO
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
[env:rambo] [env:rambo]

Loading…
Cancel
Save