diasplay i2c and eeprom

if enable i2c the display option in uiconfig.h ( SSD1306 over I2C using hardware I2C pins)
reading from eeprom works
it does not work overwriting eeprom
firmware freezes

please, help

// ST7920 with software SPI

//#define U8GLIB_ST7920

// SSD1306 with software SPI

//#define U8GLIB_SSD1306_SW_SPI

// SH1106 with software SPI

// U8GLIB_SH1106_SW_SPI

// SSD1306 over I2C using hardware I2C pins

// #define U8GLIB_MINI12864_2X_SW_SPI

#define U8GLIB_SSD1306_I2C


Comments

  • I2C is prone to freezes on communication problems. Try without display and see if eeprom works (assuming you have a due with i2c eeprom). Then you know that there is a conflict with I2C, maybe different speeds.

    Does the display show?
  • edited November 2018

    see here:

    on due you should use second I2C port for Display.

    https://forum.repetier.com/discussion/3092/ssd1306-i2c-display-on-due#latest

  • edited November 2018
    Repetier said:
    I2C is prone to freezes on communication problems. Try without display and see if eeprom works (assuming you have a due with i2c eeprom). Then you know that there is a conflict with I2C, maybe different speeds.

    Does the display show?

    see here:

    on due you should use second I2C port for Display.

    https://forum.repetier.com/discussion/3092/ssd1306-i2c-display-on-due#latest

    Display, encoder eeprom work. but rewriting eeprom does not work.
    If you turn off the display, then the eeprom rewrite works
  • edited November 2018
    if you specify spi display, then eeprom overwrite works
    does not work only with i2c display, while reading works and overwriting is not.
    Tell me where to look for an error in the firmware?
    while using an alternative. I keep eeprom on SD

    arduino due 
    ramps fd
    i2c pin 20-21
    my uiconfig.h  
    #define UI_DISPLAY_TYPE 5
    // ST7920 with software SPI//#define U8GLIB_ST7920// SSD1306 with software SPI//#define U8GLIB_SSD1306_SW_SPI// SH1106 with software SPI// U8GLIB_SH1106_SW_SPI// SSD1306 over I2C using hardware I2C pins// #define U8GLIB_MINI12864_2X_SW_SPI#define U8GLIB_SSD1306_I2C
    #define UI_HAS_BACK_KEY 0
    /** Uncomment this, if you have keys connected via i2c to a PCF8574 chip. */ //#define UI_HAS_I2C_KEYS  void uiInitKeys() { #if UI_HAS_KEYS!=0   UI_KEYS_INIT_CLICKENCODER_LOW(33,31); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.  //UI_KEYS_INIT_BUTTON_LOW(4); // push button, connects gnd to pin   //UI_KEYS_INIT_BUTTON_LOW(5);   //UI_KEYS_INIT_BUTTON_LOW(6);   //UI_KEYS_INIT_BUTTON_LOW(11);   //UI_KEYS_INIT_BUTTON_LOW(42);   //  UI_KEYS_INIT_CLICKENCODER_LOW(47,45); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.   UI_KEYS_INIT_BUTTON_LOW(35); // push button, connects gnd to pin //  UI_KEYS_INIT_MATRIX(32,47,45,43,41,39,37,35); #endif } void uiCheckKeys(uint16_t &action) { #if UI_HAS_KEYS!=0    //UI_KEYS_CLICKENCODER_LOW_REV(33,31); // click encoder on pins 47 and 45. Phase is connected with gnd for signals. // UI_KEYS_BUTTON_LOW(4,UI_ACTION_OK); // push button, connects gnd to pin // UI_KEYS_BUTTON_LOW(5,UI_ACTION_NEXT); // push button, connects gnd to pin  //UI_KEYS_BUTTON_LOW(6,UI_ACTION_PREVIOUS); // push button, connects gnd to pin  //UI_KEYS_BUTTON_LOW(11,UI_ACTION_BACK); // push button, connects gnd to pin  //UI_KEYS_BUTTON_LOW(42,UI_ACTION_SD_PRINT ); // push button, connects gnd to pin  //UI_KEYS_CLICKENCODER_LOW_REV(47,45); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.  //UI_KEYS_BUTTON_LOW(43,UI_ACTION_OK); // push button, connects gnd to pin #endif
  • edited November 2018
    the problem is that eeprom and display use different i2c routines.
    u8glib(Display library) has it´s own routines which don´t match the HAL routines.
    That´s what causes the problems.
    So if you follow my suggestion with  DUE´s second I2C Port (pin 70/71) for display , you can use display and I2C EEProm without problems.
    (Had the same problems on my DUE/RADDS/SSD1306 combination)
  • good afternoon. tell me how to use 20 -21 under EPROM 70 and 71 under the display. I failed. is there an example of what you need to change in the firmware?null
  • edited November 2018
    what to change is written in the thread i supposed

    only line numbers changed , as there were many updates since then.

    in actual version there is only a single line to change, just edit ui.cpp and search for

    u8g_InitI2C(&u8g, &u8g_dev_ssd1306_128x64_i2c, U8G_I2C_OPT_NONE);

    (should be around line 909)

    change to:

    u8g_InitI2C(&u8g,&u8g_dev_ssd1306_128x64_i2c,U8G_I2C_OPT_DEV_1);


    remember there are hardware combinations which need modifications,
    It is impossible to have all  setups working out of the Box and especially the I2C stuff
    sometimes is quite tricky.
    And of coarse Repetier does a great job in writing and supporting this Firmware .
    Keep in mind : up to now Firmware and support is still for free





Sign In or Register to comment.