pins_Einsy_1_0.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*****************************************************************
  2. * EINSY Rambo 1.0a Pin Assignments
  3. ******************************************************************/
  4. #define ELECTRONICS "EINSy_10a"
  5. #define KNOWN_BOARD
  6. #ifndef __AVR_ATmega2560__
  7. #error Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu.
  8. #endif
  9. #define TMC2130
  10. #define UVLO_SUPPORT
  11. #define AMBIENT_THERMISTOR
  12. #define PINDA_THERMISTOR
  13. #define PRUSA_SN_SUPPORT //enables the "PRUSA SN" command and 32u2 enhanced firmware support
  14. #define XFLASH // external 256kB flash
  15. #define BOOTAPP // bootloader support
  16. #define WATCHDOG_SOFT_RESET_VALUE WDTO_15MS
  17. #define XFLASH_PIN_CS 32
  18. #define X_TMC2130_CS 41
  19. #define X_TMC2130_DIAG 64 // !!! changed from 40 (EINY03)
  20. #define X_STEP_PIN 37
  21. #define X_DIR_PIN 49
  22. #define X_MIN_PIN 12
  23. //#define X_MAX_PIN 30
  24. //#define X_MIN_PIN X_TMC2130_DIAG
  25. #define X_MAX_PIN X_TMC2130_DIAG
  26. #define X_ENABLE_PIN 29
  27. #define X_MS1_PIN -1
  28. #define X_MS2_PIN -1
  29. #define Y_TMC2130_CS 39
  30. #define Y_TMC2130_DIAG 69
  31. #define Y_STEP_PIN 36
  32. #define Y_DIR_PIN 48
  33. #define Y_MIN_PIN 11
  34. //#define Y_MAX_PIN 24
  35. //#define Y_MIN_PIN Y_TMC2130_DIAG
  36. #define Y_MAX_PIN Y_TMC2130_DIAG
  37. #define Y_ENABLE_PIN 28
  38. #define Y_MS1_PIN -1
  39. #define Y_MS2_PIN -1
  40. #define Z_TMC2130_CS 67
  41. #define Z_TMC2130_DIAG 68
  42. #define Z_STEP_PIN 35
  43. #define Z_DIR_PIN 47
  44. #define Z_MIN_PIN 10
  45. #define Z_MAX_PIN 23
  46. //#define Z_MAX_PIN Z_TMC2130_DIAG
  47. #define Z_ENABLE_PIN 27
  48. #define Z_MS1_PIN -1
  49. #define Z_MS2_PIN -1
  50. #define HEATER_BED_PIN 4 //PG5
  51. #define TEMP_BED_PIN 2 //A2
  52. #define HEATER_0_PIN 3 //PE5
  53. #define TEMP_0_PIN 0 //A0
  54. #define HEATER_1_PIN -1
  55. #define TEMP_1_PIN 1 //A1
  56. #define HEATER_2_PIN -1
  57. #define TEMP_2_PIN -1
  58. #define TEMP_AMBIENT_PIN 6 //A6
  59. #define TEMP_PINDA_PIN 3 //A3
  60. #define VOLT_PWR_PIN 4 //A4
  61. #define VOLT_BED_PIN 9 //A9
  62. #define VOLT_IR_PIN 8 //A8
  63. #define TEMP_TIM 5
  64. #define E0_TMC2130_CS 66
  65. #define E0_TMC2130_DIAG 65
  66. #define E0_STEP_PIN 34
  67. #define E0_DIR_PIN 43
  68. #define E0_ENABLE_PIN 26
  69. #define E0_MS1_PIN -1
  70. #define E0_MS2_PIN -1
  71. #define SDPOWER -1
  72. #define SDSS 77
  73. #define LED_PIN 13
  74. #define FAN_PIN 6
  75. #define FAN_1_PIN -1
  76. #define PS_ON_PIN -1
  77. #define KILL_PIN -1 // 80 with Smart Controller LCD
  78. #define SUICIDE_PIN -1 // PIN that has to be turned on right after start, to keep power flowing.
  79. //#define KILL_PIN 32
  80. #define LCD_BL_PIN 5 //backlight control pin
  81. #define BEEPER 84 // Beeper on AUX-4
  82. #define LCD_PINS_RS 82
  83. #define LCD_PINS_ENABLE 61 // !!! changed from 18 (EINY03)
  84. #define LCD_PINS_D4 59 // !!! changed from 19 (EINY03)
  85. #define LCD_PINS_D5 70
  86. #define LCD_PINS_D6 85
  87. #define LCD_PINS_D7 71
  88. //buttons are directly attached using AUX-2
  89. #define BTN_EN1 72
  90. #define BTN_EN2 14
  91. #define BTN_ENC 9 // the click
  92. #define SDCARDDETECT 15
  93. #define TACH_0 79 // !!! changed from 81 (EINY03)
  94. #define TACH_1 80
  95. #define IR_SENSOR_PIN 62 //idler sensor @PK0 (digital pin 62/A8)
  96. #define MMU_RST_PIN 76
  97. // Support for an 8 bit logic analyzer, for example the Saleae.
  98. // Channels 0-2 are fast, they could generate 2.667Mhz waveform with a software loop.
  99. #define LOGIC_ANALYZER_CH0 X_MIN_PIN // PB6
  100. #define LOGIC_ANALYZER_CH1 Y_MIN_PIN // PB5
  101. #define LOGIC_ANALYZER_CH2 53 // PB0 (PROC_nCS)
  102. // Channels 3-7 are slow, they could generate
  103. // 0.889Mhz waveform with a software loop and interrupt locking,
  104. // 1.333MHz waveform without interrupt locking.
  105. #define LOGIC_ANALYZER_CH3 73 // PJ3
  106. // PK0 has no Arduino digital pin assigned, so we set it directly.
  107. #define WRITE_LOGIC_ANALYZER_CH4(value) if (value) PORTK |= (1 << 0); else PORTK &= ~(1 << 0) // PK0
  108. #define LOGIC_ANALYZER_CH5 16 // PH0 (RXD2)
  109. #define LOGIC_ANALYZER_CH6 17 // PH1 (TXD2)
  110. #define LOGIC_ANALYZER_CH7 76 // PJ5
  111. #define LOGIC_ANALYZER_CH0_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH0); WRITE(LOGIC_ANALYZER_CH0, false); } while (0)
  112. #define LOGIC_ANALYZER_CH1_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH1); WRITE(LOGIC_ANALYZER_CH1, false); } while (0)
  113. #define LOGIC_ANALYZER_CH2_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH2); WRITE(LOGIC_ANALYZER_CH2, false); } while (0)
  114. #define LOGIC_ANALYZER_CH3_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH3); WRITE(LOGIC_ANALYZER_CH3, false); } while (0)
  115. #define LOGIC_ANALYZER_CH4_ENABLE do { DDRK |= 1 << 0; WRITE_LOGIC_ANALYZER_CH4(false); } while (0)
  116. #define LOGIC_ANALYZER_CH5_ENABLE do { cbi(UCSR2B, TXEN2); cbi(UCSR2B, RXEN2); cbi(UCSR2B, RXCIE2); SET_OUTPUT(LOGIC_ANALYZER_CH5); WRITE(LOGIC_ANALYZER_CH5, false); } while (0)
  117. #define LOGIC_ANALYZER_CH6_ENABLE do { cbi(UCSR2B, TXEN2); cbi(UCSR2B, RXEN2); cbi(UCSR2B, RXCIE2); SET_OUTPUT(LOGIC_ANALYZER_CH6); WRITE(LOGIC_ANALYZER_CH6, false); } while (0)
  118. #define LOGIC_ANALYZER_CH7_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH7); WRITE(LOGIC_ANALYZER_CH7, false); } while (0)
  119. // Async output on channel 5 of the logical analyzer.
  120. // Baud rate 2MBit, 9 bits, 1 stop bit.
  121. #define LOGIC_ANALYZER_SERIAL_TX_ENABLE do { UBRR2H = 0; UBRR2L = 0; UCSR2B = (1 << TXEN2) | (1 << UCSZ02); UCSR2C = 0x06; } while (0)
  122. // Non-checked (quicker) variant. Use it if you are sure that the transmit buffer is already empty.
  123. #define LOGIC_ANALYZER_SERIAL_TX_WRITE_NC(C) do { if (C & 0x100) UCSR2B |= 1; else UCSR2B &= ~1; UDR2 = C; } while (0)
  124. #define LOGIC_ANALYZER_SERIAL_TX_WRITE(C) do { \
  125. /* Wait for empty transmit buffer */ \
  126. while (!(UCSR2A & (1<<UDRE2))); \
  127. /* Put data into buffer, sends the data */ \
  128. LOGIC_ANALYZER_SERIAL_TX_WRITE_NC(C); \
  129. } while (0)