/*
cpu_map.h - CPU and pin mapping configuration file
Part of Grbl
Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
Grbl 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.
Grbl 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 Grbl. If not, see .
*/
/* The cpu_map.h files serve as a central pin mapping selection file for different
processor types or alternative pin layouts. This version of Grbl officially supports
only the Arduino Mega328p. */
#ifndef cpu_map_h
#define cpu_map_h
#ifdef CPU_MAP_ATMEGA328P // (Arduino Uno) Officially supported by Grbl.
// Define serial port pins and interrupt vectors.
#define SERIAL_RX USART_RX_vect
#define SERIAL_UDRE USART_UDRE_vect
// Define step pulse output pins. NOTE: All step bit pins must be on the same port.
#define STEP_DDR DDRD
#define STEP_PORT PORTD
#define X_STEP_BIT 2 // Uno Digital Pin 2
#define Y_STEP_BIT 3 // Uno Digital Pin 3
#define Z_STEP_BIT 4 // Uno Digital Pin 4
#define STEP_MASK ((1< 62.5kHz
// #define SPINDLE_TCCRB_INIT_MASK (1< 7.8kHz (Used in v0.9)
// #define SPINDLE_TCCRB_INIT_MASK ((1< 1.96kHz
#define SPINDLE_TCCRB_INIT_MASK (1< 0.98kHz (J-tech laser)
// NOTE: On the 328p, these must be the same as the SPINDLE_ENABLE settings.
#define SPINDLE_PWM_DDR DDRB
#define SPINDLE_PWM_PORT PORTB
#define SPINDLE_PWM_BIT 3 // Uno Digital Pin 11
#else
// Dual axis feature requires an independent step pulse pin to operate. The independent direction pin is not
// absolutely necessary but facilitates easy direction inverting with a Grbl $$ setting. These pins replace
// the spindle direction and optional coolant mist pins.
#ifdef DUAL_AXIS_CONFIG_PROTONEER_V3_51
// NOTE: Step pulse and direction pins may be on any port and output pin.
#define STEP_DDR_DUAL DDRC
#define STEP_PORT_DUAL PORTC
#define DUAL_STEP_BIT 4 // Uno Analog Pin 4
#define STEP_MASK_DUAL ((1< 62.5kHz
// #define SPINDLE_TCCRB_INIT_MASK (1< 7.8kHz (Used in v0.9)
// #define SPINDLE_TCCRB_INIT_MASK ((1< 1.96kHz
#define SPINDLE_TCCRB_INIT_MASK (1< 0.98kHz (J-tech laser)
// NOTE: On the 328p, these must be the same as the SPINDLE_ENABLE settings.
#define SPINDLE_PWM_DDR DDRB
#define SPINDLE_PWM_PORT PORTB
#define SPINDLE_PWM_BIT 3 // Uno Digital Pin 11
#endif
// NOTE: Variable spindle not supported with this shield.
#ifdef DUAL_AXIS_CONFIG_CNC_SHIELD_CLONE
// NOTE: Step pulse and direction pins may be on any port and output pin.
#define STEP_DDR_DUAL DDRB
#define STEP_PORT_DUAL PORTB
#define DUAL_STEP_BIT 4 // Uno Digital Pin 12
#define STEP_MASK_DUAL ((1<