Sdcard configuration place

I have a megatronics V3 with a RepRap Discount Smart LCD, I'm runing a repetier Firmware and the lcd's works and the encoder too, but
the sdcard reader sems not to work. In the sdcard menu, I haven't the options to manualy detect the sd and if I restart the printer I doesn't detect to.
If I upload a MArlin firmware the SDcard works fine. So the external sdcard works.
I think is a littel mistake with my firware but i can't find it.

Feature_Controller is set to 2

Any suggestion to find the place on firmware to solve it?

 

Answers

  • Posts: 0
    Please use dev version. Then in DisplayList.h you find


    #elif MOTHERBOARD == 703 // Megatronics v3.0

    #define UI_DISPLAY_RS_PIN 32
    #define UI_DISPLAY_RW_PIN -1
    #define UI_DISPLAY_ENABLE_PIN 31
    #define UI_DISPLAY_D0_PIN -1
    #define UI_DISPLAY_D1_PIN -1
    #define UI_DISPLAY_D2_PIN -1
    #define UI_DISPLAY_D3_PIN -1
    #define UI_DISPLAY_D4_PIN 14
    #define UI_DISPLAY_D5_PIN 30
    #define UI_DISPLAY_D6_PIN 39
    #define UI_DISPLAY_D7_PIN 15
    #define UI_ENCODER_A 45
    #define UI_ENCODER_B 44
    #define UI_ENCODER_CLICK 33
    #define UI_INVERT_MENU_DIRECTION 1
    #define UI_RESET_PIN -1

    for that display and as you see it is missing the sd card section. I think it is because the board has a sd card, right? Don't have that board so can not say much to it. There you would set normally the sd card pins like in some other board definitions you see for same display. If you have a tested solution, please let us know so we can merge that into official solution.
  • Posts: 3
    Yes the board have sd card on it.
    I'll try to define the UI code for the sd and I'll tell you how it goes.
  • Posts: 3
    in pins.h

    #if MOTHERBOARD == 703
    #define KNOWN_BOARD 1


    #ifndef __AVR_ATmega2560__
    #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
    #endif


    #define ORIG_X_STEP_PIN 58
    #define ORIG_X_DIR_PIN 57
    #define ORIG_X_ENABLE_PIN 59
    #define ORIG_X_MIN_PIN 37
    //2 //Max endstops default to disabled "-1", set to commented value to enable.
    #define ORIG_X_MAX_PIN 40

    #define ORIG_Y_STEP_PIN 5
    #define ORIG_Y_DIR_PIN 17
    #define ORIG_Y_ENABLE_PIN 4
    #define ORIG_Y_MIN_PIN 41
    #define ORIG_Y_MAX_PIN 38

    #define ORIG_Z_STEP_PIN 16
    #define ORIG_Z_DIR_PIN 11
    #define ORIG_Z_ENABLE_PIN 3
    #define ORIG_Z_MIN_PIN 18
    #define ORIG_Z_MAX_PIN 19

    #define ORIG_E0_STEP_PIN 28
    #define ORIG_E0_DIR_PIN 27
    #define ORIG_E0_ENABLE_PIN 29

    #define ORIG_E1_STEP_PIN 25
    #define ORIG_E1_DIR_PIN 24
    #define ORIG_E1_ENABLE_PIN 26

    #define ORIG_E2_STEP_PIN 22
    #define ORIG_E2_DIR_PIN 60
    #define ORIG_E2_ENABLE_PIN 23

    #define ORIG_SDCARDDETECT -1     // Ramps does not use this port
    #define SDPOWER -1
    #define SDSS 53


    #define LED_PIN 13

    #define ORIG_FAN_PIN 6
    #define ORIG_FAN2_PIN 7

    #define ORIG_PS_ON_PIN 12
    //#define KILL_PIN -1

    // EXTRUDER 0 - changed 10-9-2015
    #define HEATER_0_PIN 2
    // EXTRUDER 1 - changed 10-9-2015
    #define HEATER_2_PIN 9
    // EXTRUDER 2 - changed 10-9-2015
    #define HEATER_3_PIN 8
    // heater bed
    #define HEATER_1_PIN 10

    /*
    Temperature sensors
    ANALOG NUMBERING!

    Thermistors
    T0=15
    T1=14
    T2=13
    T3=12

    Thermocouple
    S0=11
    S1=10
    S2(ext)=8
    S3(ext)=9
    */

    // Extruder 1 - Thermistor 1
    #define TEMP_0_PIN 15
    // Extruder 2 - Thermistor 2
    #define TEMP_2_PIN 14
    // Extruder 3 - Thermistor 3
    #define TEMP_3_PIN 13
    // Heated bed - Thermistor 4
    #define TEMP_1_PIN 12

    #define THERMOCOUPLE_0_PIN 11
    #define THERMOCOUPLE_1_PIN 10
    #define THERMOCOUPLE_2_PIN 8
    #define THERMOCOUPLE_3_PIN 9

    // Beeper on AUX-4
    #define BEEPER_PIN 61     
    #define SDSUPPORT 1 // sd card reader on board

    #define UI_DISPLAY_RS_PIN 32
    #define UI_DISPLAY_ENABLE_PIN 31
    #define UI_DISPLAY_D4_PIN 14
    #define UI_DISPLAY_D5_PIN 30
    #define UI_DISPLAY_D6_PIN 39
    #define UI_DISPLAY_D7_PIN 15



    //buttons are directly attached using AUX-2
    ////encoder A 59
    ////encoder B 64
    ////encoder click 33 //the click

    #define SCK_PIN 52
    #define MISO_PIN 50
    #define MOSI_PIN 51


    #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,


    #endif

    the pins are set correctly, Miso Mosi, SCK and SDSS are well defined.

    in dispplay.h

    #elif MOTHERBOARD == 703 // Megatronics v3.0

    #define UI_DISPLAY_RS_PIN 32
    #define UI_DISPLAY_RW_PIN -1
    #define UI_DISPLAY_ENABLE_PIN 31
    #define UI_DISPLAY_D0_PIN -1
    #define UI_DISPLAY_D1_PIN -1
    #define UI_DISPLAY_D2_PIN -1
    #define UI_DISPLAY_D3_PIN -1
    #define UI_DISPLAY_D4_PIN 14
    #define UI_DISPLAY_D5_PIN 30
    #define UI_DISPLAY_D6_PIN 39
    #define UI_DISPLAY_D7_PIN 15
    #define UI_ENCODER_A 45
    #define UI_ENCODER_B 44
    #define UI_ENCODER_CLICK 33
    #define UI_INVERT_MENU_DIRECTION 1
    #define UI_RESET_PIN -1

    May I have to insert this:

    #undef SDCARDDETECT
    #define SDCARDDETECT           -1
    #undef SDCARDDETECTINVERTED
    #define SDCARDDETECTINVERTED   0
    #ifndef UI_VOLTAGE_LEVEL
    #define UI_VOLTAGE_LEVEL 1 // Set 1=5 o 0=3.3 V

    Because, if I compare with other boards, all have the same definition, the only difference the asignation pins.
    So... What is the SD Card section that I need?

     


  • Posts: 0
    #define SCK_PIN 52
    #define MISO_PIN 50
    #define MOSI_PIN 51

    are the same for AVR boards as these are the only available hardware SPI pins.

    What will differ is SDSS and SDCARDDETECT and SDCARDDETECTINVERTED. Setting these to right pins should already help in your case. If youi don't define it the board sd card should be the active one.
Sign In or Register to comment.