userpins.h confusing

hello,
i am building custom 3d printer (arduino due) and since i am not using a shield for te arduino i would like to know ow to custon thhe userpin.h header file i ve tried to copy #define from motherboard 999 to a new header file userpin.h but that doesnt seem to work i get copiling error befor upload so i there a guide n how to make custom pins for a printer or any kind of help ,
NB: i have diabled EEPRom since due doesnt have one

thanks in advance 
regards @Repetier

Comments

  • userpins.h should only contain what a board definition otherwise would contain, like this:

    #define KNOWN_BOARD
    #define CPU_ARCH ARCH_ARM
    /*****************************************************************
    * Arduino Due Pin Assignments
    ******************************************************************/
    #define ORIG_X_STEP_PIN     24
    #define ORIG_X_DIR_PIN      23
    #define ORIG_X_MIN_PIN      28
    #define ORIG_X_MAX_PIN      34
    #define ORIG_X_ENABLE_PIN   26
    #define ORIG_Y_STEP_PIN     17 
    #define ORIG_Y_DIR_PIN      16
    #define ORIG_Y_MIN_PIN      30
    #define ORIG_Y_MAX_PIN      36
    #define ORIG_Y_ENABLE_PIN   22
    #define ORIG_Z_STEP_PIN     2
    #define ORIG_Z_DIR_PIN      3
    #define ORIG_Z_MIN_PIN      32
    #define ORIG_Z_MAX_PIN      38
    #define ORIG_Z_ENABLE_PIN   15
    // Note that on the Due pin A0 on the board is channel 2 on the ARM chip
    #define HEATER_0_PIN     13
    // Due analog pin #54
    #define TEMP_0_PIN       7 
    #define HEATER_1_PIN     7 
    #define TEMP_1_PIN       3 
    // Due analog pin #58
    #define HEATER_2_PIN     12
    // Due analog pin #55
    #define TEMP_2_PIN       6 
    #define HEATER_3_PIN     11
    // Due analog pin #56
    #define TEMP_3_PIN       5 
    // Due analog pin #57
    #define TEMP_4_PIN       4 
    // Due analog pin #59 = A5 -> AD 2
    #define THERMOCOUPLE_0_PIN  2   
    // There are no more analog pins freely available.
    // You can use direction and enable pin from extruder 0 socket as they are also 
    // analog pins. Then you need to move the stepper driver to a different socket.
    // Direction pin of extruder 0
    #define THERMOCOUPLE_1_PIN  1 
    // Step pin of extruder 0  
    #define THERMOCOUPLE_2_PIN  0   
    // Enable pin of extruder 0  
    #define THERMOCOUPLE_3_PIN  10   
    #define ORIG_E0_STEP_PIN    61
    #define ORIG_E0_DIR_PIN     60
    #define ORIG_E0_ENABLE_PIN  62
    #define ORIG_E1_STEP_PIN    64
    #define ORIG_E1_DIR_PIN     63
    #define ORIG_E1_ENABLE_PIN  65
    #define ORIG_E2_STEP_PIN    51
    #define ORIG_E2_DIR_PIN     53
    #define ORIG_E2_ENABLE_PIN  49
    // Extra driver on extension board
    // Might require pin 66 high for some drivers!
    #define ORIG_E3_STEP_PIN    35
    #define ORIG_E3_DIR_PIN     33
    #define ORIG_E3_ENABLE_PIN  37
    // Extra driver on extension port
    // Might require pin 25 high for some drivers!
    #define ORIG_E4_STEP_PIN    29
    #define ORIG_E4_DIR_PIN     27
    #define ORIG_E4_ENABLE_PIN  31
    #define ORIG_E5_STEP_PIN    67
    #define ORIG_E5_DIR_PIN     66
    #define ORIG_E5_ENABLE_PIN  68

    #define EXTENSION_BOARD_MS1 67
    #define EXTENSION_BOARD_MS2 68
    #define EXTENSION_BOARD_MS3 69
    // 66 -> not connected
    // 25 -> not connected
    // To set microstepping on startup set START_GCODE to e.g.
    // "M42 P67 S255\nM42 P68 S255\nM42 P69 S255"
    #define SDSUPPORT      1
    #define SDPOWER    -1
    // 4,10,52 if using HW SPI.
    #define SDSS     4
    #define ORIG_SDCARDDETECT       14
    #define SDCARDDETECTINVERTED 0
    #define LED_PIN    -1
    #define ORIG_FAN_PIN    9 
    #define ORIG_FAN2_PIN           8 
    #define ORIG_PS_ON_PIN          40
    #define KILL_PIN    -1
    #define SUICIDE_PIN    -1  //PIN that has to be turned on right after start, to keep power flowing.
    // 20 or 70
    #define SDA_PIN 20 
    // 21 or 71
    #define SCL_PIN 21 
    // Servo pins: 5,6 und 39
    #define E0_PINS ORIG_E0_STEP_PIN,ORIG_E0_DIR_PIN,ORIG_E0_ENABLE_PIN,
    #define E1_PINS ORIG_E1_STEP_PIN,ORIG_E1_DIR_PIN,ORIG_E1_ENABLE_PIN,
    #define E2_PINS ORIG_E2_STEP_PIN,ORIG_E2_DIR_PIN,ORIG_E2_ENABLE_PIN,
    #define E3_PINS ORIG_E3_STEP_PIN,ORIG_E3_DIR_PIN,ORIG_E3_ENABLE_PIN,
    #define E4_PINS ORIG_E4_STEP_PIN,ORIG_E4_DIR_PIN,ORIG_E4_ENABLE_PIN,
    #define E5_PINS ORIG_E5_STEP_PIN,ORIG_E5_DIR_PIN,ORIG_E5_ENABLE_PIN,
    #define TWI_CLOCK_FREQ          400000
    // see eeprom device data sheet for the following values these are for 24xx256
    #define EEPROM_SERIAL_ADDR      0x50   // 7 bit i2c address (without R/W bit)
    #define EEPROM_PAGE_SIZE        64     // page write buffer size
    #define EEPROM_PAGE_WRITE_TIME  7      // page write time in milliseconds (docs say 5ms but that is too short)
    // specify size of eeprom address register
    // TWI_MMR_IADRSZ_1_BYTE for 1 byte, or TWI_MMR_IADRSZ_2_BYTE for 2 byte
    #define EEPROM_ADDRSZ_BYTES     TWI_MMR_IADRSZ_2_BYTE
    #define EEPROM_AVAILABLE 1


  • Repetier said:
    userpins.h should only contain what a board definition otherwise would contain, like this:

    #define KNOWN_BOARD
    #define CPU_ARCH ARCH_ARM
    /*****************************************************************
    * Arduino Due Pin Assignments
    ******************************************************************/
    #define ORIG_X_STEP_PIN     24
    #define ORIG_X_DIR_PIN      23
    #define ORIG_X_MIN_PIN      28
    #define ORIG_X_MAX_PIN      34
    #define ORIG_X_ENABLE_PIN   26
    #define ORIG_Y_STEP_PIN     17 
    #define ORIG_Y_DIR_PIN      16
    #define ORIG_Y_MIN_PIN      30
    #define ORIG_Y_MAX_PIN      36
    #define ORIG_Y_ENABLE_PIN   22
    #define ORIG_Z_STEP_PIN     2
    #define ORIG_Z_DIR_PIN      3
    #define ORIG_Z_MIN_PIN      32
    #define ORIG_Z_MAX_PIN      38
    #define ORIG_Z_ENABLE_PIN   15
    // Note that on the Due pin A0 on the board is channel 2 on the ARM chip
    #define HEATER_0_PIN     13
    // Due analog pin #54
    #define TEMP_0_PIN       7 
    #define HEATER_1_PIN     7 
    #define TEMP_1_PIN       3 
    // Due analog pin #58
    #define HEATER_2_PIN     12
    // Due analog pin #55
    #define TEMP_2_PIN       6 
    #define HEATER_3_PIN     11
    // Due analog pin #56
    #define TEMP_3_PIN       5 
    // Due analog pin #57
    #define TEMP_4_PIN       4 
    // Due analog pin #59 = A5 -> AD 2
    #define THERMOCOUPLE_0_PIN  2   
    // There are no more analog pins freely available.
    // You can use direction and enable pin from extruder 0 socket as they are also 
    // analog pins. Then you need to move the stepper driver to a different socket.
    // Direction pin of extruder 0
    #define THERMOCOUPLE_1_PIN  1 
    // Step pin of extruder 0  
    #define THERMOCOUPLE_2_PIN  0   
    // Enable pin of extruder 0  
    #define THERMOCOUPLE_3_PIN  10   
    #define ORIG_E0_STEP_PIN    61
    #define ORIG_E0_DIR_PIN     60
    #define ORIG_E0_ENABLE_PIN  62
    #define ORIG_E1_STEP_PIN    64
    #define ORIG_E1_DIR_PIN     63
    #define ORIG_E1_ENABLE_PIN  65
    #define ORIG_E2_STEP_PIN    51
    #define ORIG_E2_DIR_PIN     53
    #define ORIG_E2_ENABLE_PIN  49
    // Extra driver on extension board
    // Might require pin 66 high for some drivers!
    #define ORIG_E3_STEP_PIN    35
    #define ORIG_E3_DIR_PIN     33
    #define ORIG_E3_ENABLE_PIN  37
    // Extra driver on extension port
    // Might require pin 25 high for some drivers!
    #define ORIG_E4_STEP_PIN    29
    #define ORIG_E4_DIR_PIN     27
    #define ORIG_E4_ENABLE_PIN  31
    #define ORIG_E5_STEP_PIN    67
    #define ORIG_E5_DIR_PIN     66
    #define ORIG_E5_ENABLE_PIN  68

    #define EXTENSION_BOARD_MS1 67
    #define EXTENSION_BOARD_MS2 68
    #define EXTENSION_BOARD_MS3 69
    // 66 -> not connected
    // 25 -> not connected
    // To set microstepping on startup set START_GCODE to e.g.
    // "M42 P67 S255\nM42 P68 S255\nM42 P69 S255"
    #define SDSUPPORT      1
    #define SDPOWER    -1
    // 4,10,52 if using HW SPI.
    #define SDSS     4
    #define ORIG_SDCARDDETECT       14
    #define SDCARDDETECTINVERTED 0
    #define LED_PIN    -1
    #define ORIG_FAN_PIN    9 
    #define ORIG_FAN2_PIN           8 
    #define ORIG_PS_ON_PIN          40
    #define KILL_PIN    -1
    #define SUICIDE_PIN    -1  //PIN that has to be turned on right after start, to keep power flowing.
    // 20 or 70
    #define SDA_PIN 20 
    // 21 or 71
    #define SCL_PIN 21 
    // Servo pins: 5,6 und 39
    #define E0_PINS ORIG_E0_STEP_PIN,ORIG_E0_DIR_PIN,ORIG_E0_ENABLE_PIN,
    #define E1_PINS ORIG_E1_STEP_PIN,ORIG_E1_DIR_PIN,ORIG_E1_ENABLE_PIN,
    #define E2_PINS ORIG_E2_STEP_PIN,ORIG_E2_DIR_PIN,ORIG_E2_ENABLE_PIN,
    #define E3_PINS ORIG_E3_STEP_PIN,ORIG_E3_DIR_PIN,ORIG_E3_ENABLE_PIN,
    #define E4_PINS ORIG_E4_STEP_PIN,ORIG_E4_DIR_PIN,ORIG_E4_ENABLE_PIN,
    #define E5_PINS ORIG_E5_STEP_PIN,ORIG_E5_DIR_PIN,ORIG_E5_ENABLE_PIN,
    #define TWI_CLOCK_FREQ          400000
    // see eeprom device data sheet for the following values these are for 24xx256
    #define EEPROM_SERIAL_ADDR      0x50   // 7 bit i2c address (without R/W bit)
    #define EEPROM_PAGE_SIZE        64     // page write buffer size
    #define EEPROM_PAGE_WRITE_TIME  7      // page write time in milliseconds (docs say 5ms but that is too short)
    // specify size of eeprom address register
    // TWI_MMR_IADRSZ_1_BYTE for 1 byte, or TWI_MMR_IADRSZ_2_BYTE for 2 byte
    #define EEPROM_ADDRSZ_BYTES     TWI_MMR_IADRSZ_2_BYTE
    #define EEPROM_AVAILABLE 1


    thank you very much but i still have something in mind about pn numbering
    can i use any pin in this configuration or there is a limited pins that i can use
    thaks again 
    regards @Repetier
  • There are not much limits. Analog inputs must be on a analog input and putting a function on special pins like SPI MOSI/MISO/CLK is a bad idea if you need it later. But any digital output can use any available pin number.
  • thank you very much @Repetier
Sign In or Register to comment.