GRBL 源文件编程求助
// NOTE: All step bit and direction pins must be on the same port.#define STEPPING_DDR DDRD
#define STEPPING_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 X_DIRECTION_BIT 5// Uno Digital Pin 5
#define Y_DIRECTION_BIT 6// Uno Digital Pin 6
#define Z_DIRECTION_BIT 7// Uno Digital Pin 7
#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)) // All step bits
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)) // All direction bits
#define STEPPING_MASK (STEP_MASK | DIRECTION_MASK) // All stepping-related bits (step/direction)
#define STEPPERS_DISABLE_DDR DDRB
#define STEPPERS_DISABLE_PORT PORTB
#define STEPPERS_DISABLE_BIT 0// Uno Digital Pin 8
#define STEPPERS_DISABLE_MASK (1<<STEPPERS_DISABLE_BIT)
// NOTE: All limit bit pins must be on the same port
#define LIMIT_DDR DDRB
#define LIMIT_PIN PINB
#define LIMIT_PORT PORTB
#define X_LIMIT_BIT 1// Uno Digital Pin 9
#define Y_LIMIT_BIT 2// Uno Digital Pin 10
#define Z_LIMIT_BIT 3// Uno Digital Pin 11
#define LIMIT_INT PCIE0// Pin change interrupt enable pin
#define LIMIT_INT_vectPCINT0_vect
#define LIMIT_PCMSK PCMSK0 // Pin change interrupt register
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)) // All limit bits
#define SPINDLE_ENABLE_DDR DDRB
#define SPINDLE_ENABLE_PORTPORTB
#define SPINDLE_ENABLE_BIT 4// Uno Digital Pin 12
#define SPINDLE_DIRECTION_DDR DDRB
#define SPINDLE_DIRECTION_PORTPORTB
#define SPINDLE_DIRECTION_BIT 5// Uno Digital Pin 13 (NOTE: D13 can't be pulled-high input due to LED.)
#define COOLANT_FLOOD_DDR DDRC
#define COOLANT_FLOOD_PORTPORTC
#define COOLANT_FLOOD_BIT 3// Uno Analog Pin 3
2号点和3号点 又输出也当输入?????重复利用??
要看//后的Uno Digital Pin
#define Y_LIMIT_BIT 2是指PB的2 即Uno Digital Pin 10
#define X_STEP_BIT 2是指PD的2 即 Uno Digital Pin 2
DDRD DDRB这些是什么意思啊?
#define X_LIMIT_BIT 1// Uno Digital Pin 9
#define Y_LIMIT_BIT 2// Uno Digital Pin 10
#define Z_LIMIT_BIT 3// Uno Digital Pin 11
为什么 X_LIMIT_BIT 1是Pin 9?
看了很久,看不懂啊!! 虽然注释部分不重要但是还是建议读一下cpu_map.h里有这样一段话
/* 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. */
页:
[1]