|
| 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 |
0 commit comments