Skip to content

Commit 54d8580

Browse files
committed
Update pinmap and documentation
1 parent 554e345 commit 54d8580

File tree

8 files changed

+125
-30
lines changed

8 files changed

+125
-30
lines changed

klipper_config/pinmap.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# ATmega644P Pinmap for Klipper Simulavr
2+
3+
This document provides a comprehensive pinmap for the ATmega644P microcontroller and how its pins are configured in the Klipper simulavr setup based on the actual configuration files.
4+
5+
## Pin Configuration Table
6+
7+
| Pin # | Pin Code | Pin Function | Klipper Usage |
8+
|-------|----------|--------------------------|--------------------------|
9+
| 1 | PB0 | T0/XCK0 | stepper_x_step_pin |
10+
| 2 | PB1 | T1 | stepper_x_dir_pin |
11+
| 3 | PB2 | AIN0/INT2 | stepper_x_endstop_pin |
12+
| 4 | PB3 | AIN1/OC0A | stepper_y_step_pin |
13+
| 5 | PB4 | SS/OC0B | - |
14+
| 6 | PB5 | MOSI | - |
15+
| 7 | PB6 | MISO | - |
16+
| 8 | PB7 | SCK | - |
17+
| 9 | RESET | Reset (Active Low) | - |
18+
| 10 | GND | Ground | - |
19+
| 11 | VCC | +5V Power | - |
20+
| 12 | XTAL2 | Crystal Oscillator Pin 2 | - |
21+
| 13 | XTAL1 | Crystal Oscillator Pin 1 | - |
22+
| 14 | PC0 | SCL | - |
23+
| 15 | PC1 | SDA | - |
24+
| 16 | PC2 | TCK | stepper_y_dir_pin |
25+
| 17 | PC3 | TMS | stepper_y_endstop_pin |
26+
| 18 | PC4 | TDO | stepper_z_step_pin |
27+
| 19 | PC5 | TDI | stepper_z_dir_pin |
28+
| 20 | PC6 | TOSC1 | stepper_z_endstop_pin |
29+
| 21 | PC7 | TOSC2 | extruder_step_pin |
30+
| 22 | PD0 | RXD0 | - |
31+
| 23 | PD1 | TXD0 | - |
32+
| 24 | PD2 | RXD1/INT0 | - |
33+
| 25 | PD3 | TXD1/INT1 | - |
34+
| 26 | PD4 | OC1B | extruder_dir_pin |
35+
| 27 | PD5 | OC1A | extruder1_step_pin |
36+
| 28 | PD6 | OC2B/ICP1 | extruder1_dir_pin |
37+
| 29 | PD7 | OC2A | - |
38+
| 30 | GND | Analog Ground | - |
39+
| 31 | AVCC | Analog VCC | - |
40+
| 32 | AREF | Analog Reference | - |
41+
| 33 | PA7 | ADC7 | heater_bed_sensor_pin |
42+
| 34 | PA6 | ADC6 | extruder1_sensor_pin |
43+
| 35 | PA5 | ADC5 | extruder_sensor_pin |
44+
| 36 | PA4 | ADC4 | - |
45+
| 37 | PA3 | ADC3 | - |
46+
| 38 | PA2 | ADC2 | - |
47+
| 39 | PA1 | ADC1 | - |
48+
| 40 | PA0 | ADC0 | - |
49+
50+
## Pin Usage Summary
51+
52+
### Stepper Motors
53+
54+
- **X-Axis Stepper**: PB0 (step), PB1 (direction), PB2 (endstop)
55+
- **Y-Axis Stepper**: PB3 (step), PC2 (direction), PC3 (endstop)
56+
- **Z-Axis Stepper**: PC4 (step), PC5 (direction), PC6 (endstop)
57+
58+
### Extruders
59+
60+
- **Primary Extruder**: PC7 (step), PD4 (direction), PA5 (sensor)
61+
- **Secondary Extruder**: PD5 (step), PD6 (direction), PA6 (sensor)
62+
63+
### Temperature Sensors
64+
65+
- **Heated Bed**: PA7 (sensor)
66+
- **Extruder**: PA5 (sensor)
67+
- **Extruder1**: PA6 (sensor)
68+
69+
### Available Pins
70+
71+
The following pins are currently unassigned and available for additional features:
72+
73+
- PA0, PA1, PA2, PA3, PA4 (ADC channels)
74+
- PB4, PB5, PB6, PB7 (SPI interface)
75+
- PC0, PC1 (I²C/TWI interface)
76+
- PD0, PD1 (UART0)
77+
- PD2, PD3 (UART1)
78+
- PD7 (Digital I/O with PWM capability)
79+
80+
### Communication Interfaces
81+
82+
- **SPI**: PB4 (SS), PB5 (MOSI), PB6 (MISO), PB7 (SCK) - Available
83+
- **I²C/TWI**: PC0 (SCL), PC1 (SDA) - Available
84+
- **UART0**: PD0 (RX), PD1 (TX) - Available
85+
- **UART1**: PD2 (RX), PD3 (TX) - Available
86+
87+
## Notes
88+
89+
- This pinmap is designed for **simulavr simulation** with the Klipper firmware
90+
- The pin assignments are defined in the Klipper configuration files for virtual hardware simulation
91+
- Many functions (heaters, fans, enable pins) use virtual pins rather than physical pins
92+
- ADC channels (Port A) are used for temperature sensing simulation
93+
- JTAG debugging pins (PC2-PC6) and timer-related pins (PB0-PB1, PC6-PC7, PD4-PD6) are repurposed for stepper motor control
94+
- All hardware communication interfaces (SPI, I²C, UART) remain available for expansion
95+
- Pin assignments match the simulavr virtual ATmega644P implementation

klipper_config/printer/extruder-dual-stepper.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ max_extrude_only_velocity: 100
1313

1414
[extruder_stepper stepper1]
1515
extruder: extruder
16-
step_pin: PC3
17-
dir_pin: !PC4
16+
step_pin: PD5
17+
dir_pin: !PD6
1818
enable_pin: virtual_pin:extruder_stepper__stepper1__enable_pin
1919
microsteps: 16
2020
rotation_distance: 33.683
2121

2222
[extruder_stepper stepper2]
2323
extruder: extruder
24-
step_pin: PC1
25-
dir_pin: !PC2
24+
step_pin: PC7
25+
dir_pin: !PD4
2626
enable_pin: virtual_pin:extruder_stepper__stepper2__enable_pin
2727
microsteps: 16
2828
rotation_distance: 33.683

klipper_config/printer/extruder-dual.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[extruder]
2-
step_pin: PC1
3-
dir_pin: !PC2
2+
step_pin: PC7
3+
dir_pin: !PD4
44
enable_pin: virtual_pin:extruder__enable_pin
55
microsteps: 16
66
rotation_distance: 33.683
@@ -17,8 +17,8 @@ max_extrude_only_distance: 100
1717
max_extrude_only_velocity: 100
1818

1919
[extruder1]
20-
step_pin: PC3
21-
dir_pin: !PC4
20+
step_pin: PD5
21+
dir_pin: !PD6
2222
enable_pin: virtual_pin:extruder1__enable_pin
2323
microsteps: 16
2424
rotation_distance: 33.683

klipper_config/printer/extruder-single.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[extruder]
2-
step_pin: PC1
3-
dir_pin: !PC2
2+
step_pin: PC7
3+
dir_pin: !PD4
44
enable_pin: virtual_pin:extruder__enable_pin
55
microsteps: 16
66
rotation_distance: 33.683

klipper_config/printer/kinematics-cartesian-bltouch.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ homing_retract_dist: 0
1919

2020
[stepper_y]
2121
step_pin: PB3
22-
dir_pin: !PB4
22+
dir_pin: !PC2
2323
enable_pin: virtual_pin:stepper_y__enable_pin
2424
microsteps: 16
2525
rotation_distance: 40
26-
endstop_pin: ^PB5
26+
endstop_pin: ^PC3
2727
position_endstop: 0
2828
position_max: 235
2929
homing_speed: 100
3030
homing_retract_dist: 0
3131

3232
[stepper_z]
33-
step_pin: PB6
34-
dir_pin: PB7
33+
step_pin: PC4
34+
dir_pin: PC5
3535
enable_pin: virtual_pin:stepper_z__enable_pin
3636
microsteps: 16
3737
rotation_distance: 40
@@ -40,6 +40,6 @@ position_max: 250
4040
homing_retract_dist: 0
4141

4242
[bltouch]
43-
sensor_pin: ^!PC0
43+
sensor_pin: ^!PC6
4444
control_pin: PA4
4545
z_offset: 0

klipper_config/printer/kinematics-cartesian-probe.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ homing_retract_dist: 0
1919

2020
[stepper_y]
2121
step_pin: PB3
22-
dir_pin: !PB4
22+
dir_pin: !PC2
2323
enable_pin: virtual_pin:stepper_y__enable_pin
2424
microsteps: 16
2525
rotation_distance: 40
26-
endstop_pin: ^PB5
26+
endstop_pin: ^PC3
2727
position_endstop: 0
2828
position_max: 235
2929
homing_speed: 100
3030
homing_retract_dist: 0
3131

3232
[stepper_z]
33-
step_pin: PB6
34-
dir_pin: PB7
33+
step_pin: PC4
34+
dir_pin: PC5
3535
enable_pin: virtual_pin:stepper_z__enable_pin
3636
microsteps: 16
3737
rotation_distance: 40
@@ -40,5 +40,5 @@ position_max: 250
4040
homing_retract_dist: 0
4141

4242
[probe]
43-
pin: PC0
43+
pin: PC6
4444
z_offset: 0

klipper_config/printer/kinematics-cartesian.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ homing_retract_dist: 0
1919

2020
[stepper_y]
2121
step_pin: PB3
22-
dir_pin: !PB4
22+
dir_pin: !PC2
2323
enable_pin: virtual_pin:stepper_y__enable_pin
2424
microsteps: 16
2525
rotation_distance: 40
26-
endstop_pin: ^PB5
26+
endstop_pin: ^PC3
2727
position_endstop: 0
2828
position_max: 235
2929
homing_speed: 100
3030
homing_retract_dist: 0
3131

3232
[stepper_z]
33-
step_pin: PB6
34-
dir_pin: PB7
33+
step_pin: PC4
34+
dir_pin: PC5
3535
enable_pin: virtual_pin:stepper_z__enable_pin
3636
microsteps: 16
3737
rotation_distance: 40
38-
endstop_pin: ^PC0
38+
endstop_pin: ^PC6
3939
position_endstop: 0
4040
position_max: 250
4141
homing_retract_dist: 0

klipper_config/printer/kinematics-delta.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ arm_length: 315
2020

2121
[stepper_b]
2222
step_pin: PB3
23-
dir_pin: !PB4
23+
dir_pin: !PC2
2424
enable_pin: virtual_pin:stepper_y__enable_pin
2525
microsteps: 16
2626
rotation_distance: 40
27-
endstop_pin: ^PB5
27+
endstop_pin: ^PC3
2828
position_endstop: 0
2929
homing_speed: 100
3030
homing_retract_dist: 0
3131
arm_length: 315
3232

3333
[stepper_c]
34-
step_pin: PB6
35-
dir_pin: PB7
34+
step_pin: PC4
35+
dir_pin: PC5
3636
enable_pin: virtual_pin:stepper_z__enable_pin
3737
microsteps: 16
3838
rotation_distance: 40
39-
endstop_pin: ^PC0
39+
endstop_pin: ^PC6
4040
position_endstop: 0
4141
homing_speed: 100
4242
homing_retract_dist: 0

0 commit comments

Comments
 (0)