Re: DIY Tiny OLED I2C full graphics controller December 11, 2017 02:12AM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller December 29, 2017 03:00AM |
Registered: 6 years ago Posts: 3 |
Quote
enif
As for the I2C problem on the Arduino Due that caused some conflict when activating simultaneously the I2C OLED (using the U8glib I2C routines) and the I2C EEPROM (using Arduino's Wire.h), I have made some progress:
I removed the '//' from the (3 each) commented out statements "//u8g->pin_list[U8G_PI_SET_A0] = 1;" and "// u8g_i2c_stop();" in file U8glib/utility/u8g_com_arduino_ssd_i2c.c :
$diff u8g_com_arduino_ssd_i2c.c.ori u8g_com_arduino_ssd_i2c.c 125c125 < //u8g->pin_list[U8G_PI_SET_A0] = 1; --- > u8g->pin_list[U8G_PI_SET_A0] = 1; 130c130 < // u8g_i2c_stop(); --- > u8g_i2c_stop(); 134c134 < //u8g->pin_list[U8G_PI_SET_A0] = 1; --- > u8g->pin_list[U8G_PI_SET_A0] = 1; 146c146 < // u8g_i2c_stop(); --- > u8g_i2c_stop(); 150c150 < //u8g->pin_list[U8G_PI_SET_A0] = 1; --- > u8g->pin_list[U8G_PI_SET_A0] = 1; 163c163 < // u8g_i2c_stop(); --- > u8g_i2c_stop();
After recompiling Marlin4Due with this change the Arduino Due the conflict seems resolved and it can now access the I2C EEPROM (after having it activated in Configuration.h of course) while using the I2C OLED display - so far without any problem
Re: DIY Tiny OLED I2C full graphics controller July 10, 2018 05:20AM |
Registered: 7 years ago Posts: 69 |
SDA1 3.3V SCL1 | | | | | | o--[1.5k]---o | | | | | o--[1.5k]--o
#ifdef EEPROM_SETTINGS
// To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
#define EEPROM_CHITCHAT // Please keep turned on if you can.
#define EEPROM_ON_2ND_I2C // EEPROM CHIP ON second I2C for Arduino Due
#endif
// -------------------------------------------------------------------------- // eeprom // -------------------------------------------------------------------------- static bool eeprom_initialised = false; static uint8_t eeprom_device_address = 0x50; #ifdef EEPROM_ON_2ND_I2C static void eeprom_init(void) { if (!eeprom_initialised) { Wire1.begin(); eeprom_initialised = true; } } void eeprom_write_byte(unsigned char *pos, unsigned char value) { unsigned eeprom_address = (unsigned) pos; eeprom_init(); Wire1.beginTransmission(eeprom_device_address); Wire1.write((int)(eeprom_address >> 8)); // MSB Wire1.write((int)(eeprom_address & 0xFF)); // LSB Wire1.write(value); Wire1.endTransmission(); // wait for write cycle to complete // this could be done more efficiently with "acknowledge polling" delay(5); } unsigned char eeprom_read_byte(unsigned char *pos) { byte data = 0xFF; unsigned eeprom_address = (unsigned) pos; eeprom_init (); Wire1.beginTransmission(eeprom_device_address); Wire1.write((int)(eeprom_address >> 8)); // MSB Wire1.write((int)(eeprom_address & 0xFF)); // LSB Wire1.endTransmission(); Wire1.requestFrom(eeprom_device_address, (byte)1); if (Wire1.available()) data = Wire1.read(); return data; } #else static void eeprom_init(void) { if (!eeprom_initialised) { Wire.begin(); eeprom_initialised = true; } } void eeprom_write_byte(unsigned char *pos, unsigned char value) { unsigned eeprom_address = (unsigned) pos; eeprom_init(); Wire.beginTransmission(eeprom_device_address); Wire.write((int)(eeprom_address >> 8)); // MSB Wire.write((int)(eeprom_address & 0xFF)); // LSB Wire.write(value); Wire.endTransmission(); // wait for write cycle to complete // this could be done more efficiently with "acknowledge polling" delay(5); } unsigned char eeprom_read_byte(unsigned char *pos) { byte data = 0xFF; unsigned eeprom_address = (unsigned) pos; eeprom_init (); Wire.beginTransmission(eeprom_device_address); Wire.write((int)(eeprom_address >> 8)); // MSB Wire.write((int)(eeprom_address & 0xFF)); // LSB Wire.endTransmission(); Wire.requestFrom(eeprom_device_address, (byte)1); if (Wire.available()) data = Wire.read(); return data; } #endif // -------------------------------------------------------------------------- // Timers // --------------------------------------------------------------------------
Re: DIY Tiny OLED I2C full graphics controller September 20, 2018 03:06AM |
Registered: 6 years ago Posts: 3 |
Re: DIY Tiny OLED I2C full graphics controller September 20, 2018 12:55PM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller September 22, 2018 12:23PM |
Registered: 6 years ago Posts: 3 |
Re: DIY Tiny OLED I2C full graphics controller September 23, 2018 02:32AM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller September 23, 2018 03:37AM |
Registered: 6 years ago Posts: 3 |
Re: DIY Tiny OLED I2C full graphics controller September 23, 2018 07:55AM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller September 23, 2018 10:14AM |
Registered: 10 years ago Posts: 590 |
diff Configuration.h.ori Configuration.h *** Configuration.h.ori 2018-09-23 15:49:49.410579191 +0200 --- Configuration.h 2018-09-23 15:51:19.728792937 +0200 *************** *** 1531,1536 **** --- 1531,1540 ---- // //#define REPRAP_DISCOUNT_SMART_CONTROLLER + //#define U8GLIB_SH1106 // used for most 1.3" OLEDs (default for TINYOLED) + //#define U8GLIB_SSD1306 // used for most 0.96" OLEDs + #define TINYOLED + // // ULTIMAKER Controller. // diff Conditionals_LCD.h.ori Conditionals_LCD.h *** Conditionals_LCD.h.ori 2018-09-23 15:48:49.055772809 +0200 --- Conditionals_LCD.h 2018-09-23 16:06:14.335230093 +0200 *************** *** 88,93 **** --- 88,106 ---- #define SD_DETECT_INVERTED #endif + + #elif ENABLED(TINYOLED) + + #ifndef U8GLIB_SSD1306 // define U8GLIB_SSD1306 in Configuration.h if not using SH1106 version + #define U8GLIB_SH1106 // SSD1306 and SH1106 are similar, but have slightly different horizontal shift + #endif + #define ULTIPANEL + #define NEWPANEL + #define ULTRA_LCD + #define DOGLCD + #define REVERSE_ENCODER_DIRECTION + #define REVERSE_MENU_DIRECTION + #elif ENABLED(OLED_PANEL_TINYBOY2) #define U8GLIB_SSD1306 *************** *** 244,249 **** --- 257,263 ---- #elif ENABLED(miniVIKI) || ENABLED(VIKI2) \ || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ || ENABLED(OLED_PANEL_TINYBOY2) \ + || ENABLED(TINYOLED) \ || ENABLED(BQ_LCD_SMART_CONTROLLER) \ || ENABLED(LCD_I2C_PANELOLU2) \ || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) diff pins_RAMPS.h.ori pins_RAMPS.h *** pins_RAMPS.h.ori 2018-09-23 15:45:57.975156042 +0200 --- pins_RAMPS.h 2018-09-23 15:47:03.653857233 +0200 *************** *** 431,436 **** --- 431,445 ---- #define LCD_BACKLIGHT_PIN 39 #endif + #elif ENABLED(TINYOLED) + #define BTN_EN1 31 + #define BTN_EN2 33 + #define BTN_ENC 35 + #define BEEPER_PIN 37 + #define LCD_SDSS 53 + #define SD_DETECT_PIN -1 + #define KILL_PIN -1 + #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #define BTN_EN1 64
Re: DIY Tiny OLED I2C full graphics controller September 28, 2018 11:28PM |
Registered: 7 years ago Posts: 110 |
Re: DIY Tiny OLED I2C full graphics controller September 29, 2018 03:59AM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller September 29, 2018 11:19AM |
Registered: 7 years ago Posts: 110 |
diff Configuration.h.ori Configuration.h
*** Configuration.h.ori 2018-09-23 15:49:49.410579191 +0200
--- Configuration.h 2018-09-23 15:51:19.728792937 +0200
***************
*** 1531,1536 ****
--- 1531,1540 ----
//
//#define REPRAP_DISCOUNT_SMART_CONTROLLER
+ //#define U8GLIB_SH1106 // used for most 1.3" OLEDs (default for TINYOLED)
+ //#define U8GLIB_SSD1306 // used for most 0.96" OLEDs
+ #define TINYOLED
+
// If you have a speaker that can produce tones, enable it here. // By default Marlin assumes you have a buzzer with a fixed frequency. // #define SPEAKER // // The duration and frequency for the UI feedback sound. // Set these to 0 to disable audio feedback in the LCD menus. // // Note: Test audio output with the G-Code: // M300 S P // #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 #define LCD_FEEDBACK_FREQUENCY_HZ 5000
Re: DIY Tiny OLED I2C full graphics controller October 27, 2018 02:44PM |
Registered: 8 years ago Posts: 58 |
Re: DIY Tiny OLED I2C full graphics controller January 20, 2019 08:18AM |
Registered: 5 years ago Posts: 1 |
Re: DIY Tiny OLED I2C full graphics controller January 20, 2019 03:58PM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller January 25, 2019 01:54PM |
Registered: 5 years ago Posts: 4 |
Re: DIY Tiny OLED I2C full graphics controller January 26, 2019 08:14AM |
Registered: 10 years ago Posts: 590 |
Quote
juansuarez
I have been trying for 3 months to connect the oled but the marlin gives me 8mhz errors
Re: DIY Tiny OLED I2C full graphics controller January 26, 2019 08:34AM |
Admin Registered: 13 years ago Posts: 7,148 |
Re: DIY Tiny OLED I2C full graphics controller January 26, 2019 08:35AM |
Registered: 10 years ago Posts: 590 |
*** pins_SANGUINOLOLU_11.h.ori 2018-12-04 10:37:15.101313000 +0100 --- pins_SANGUINOLOLU_11.h 2018-12-04 10:47:03.641419000 +0100 *************** *** 262,267 **** --- 269,285 ---- #define BTN_EN1 -1 #define BTN_EN2 -1 + #elif ENABLED(TINYOLED) + #ifdef BTN_EN1 + #undef BTN_EN1 + #undef BTN_EN2 + #endif + #define BTN_EN1 30 // A1 - rotary encoder A + #define BTN_EN2 29 // A2 - rotary encoder B + #define BTN_ENC 28 // A3 - rotary encoder push switch + #define BEEPER_PIN 10 // RX1 - piezo beeper + #define LCD_SDSS 31 // SD Card SS pin + #else // !LCD_I2C_PANELOLU2 && !LCD_FOR_MELZI && !ZONESTAR_LCD #define BTN_ENC 16
*** Conditionals_LCD.h.ori 2018-12-02 10:30:33.677927000 +0100 --- Conditionals_LCD.h 2018-12-02 10:31:20.713003000 +0100 *************** *** 88,93 **** --- 88,106 ---- #define SD_DETECT_INVERTED #endif + + #elif ENABLED(TINYOLED) + + #ifndef U8GLIB_SSD1306 // define U8GLIB_SSD1306 in Configuration.h if not using SH1106 version + #define U8GLIB_SH1106 // SSD1306 and SH1106 are similar, but have slightly different horizontal shift + #endif + #define ULTIPANEL + #define NEWPANEL + #define ULTRA_LCD + #define DOGLCD + #define REVERSE_ENCODER_DIRECTION + #define REVERSE_MENU_DIRECTION + #elif ENABLED(OLED_PANEL_TINYBOY2) #define U8GLIB_SSD1306 *************** *** 244,249 **** --- 257,263 ---- #elif ENABLED(miniVIKI) || ENABLED(VIKI2) \ || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ || ENABLED(OLED_PANEL_TINYBOY2) \ + || ENABLED(TINYOLED) \ || ENABLED(BQ_LCD_SMART_CONTROLLER) \ || ENABLED(LCD_I2C_PANELOLU2) \ || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
Re: DIY Tiny OLED I2C full graphics controller January 31, 2019 11:06PM |
Registered: 5 years ago Posts: 4 |
Re: DIY Tiny OLED I2C full graphics controller January 31, 2019 11:12PM |
Registered: 5 years ago Posts: 4 |
Re: DIY Tiny OLED I2C full graphics controller February 01, 2019 03:20AM |
Admin Registered: 13 years ago Posts: 7,148 |
Re: DIY Tiny OLED I2C full graphics controller March 01, 2019 06:32PM |
Registered: 5 years ago Posts: 4 |
Re: DIY Tiny OLED I2C full graphics controller April 24, 2019 05:09PM |
Registered: 7 years ago Posts: 110 |
Re: DIY Tiny OLED I2C full graphics controller April 25, 2019 11:14AM |
Registered: 10 years ago Posts: 590 |
Quote
sinned
are you using this on Marlin 2.0 8bit or 32bit? i was hoping to switch to 32bit with ReArm but I am a little stumped right now how to configure it.
ReArm does use SPI - can we use that per Biachifan's post on page 2?
Re: DIY Tiny OLED I2C full graphics controller April 25, 2019 06:34PM |
Registered: 7 years ago Posts: 110 |
Re: DIY Tiny OLED I2C full graphics controller May 28, 2019 09:05PM |
Registered: 6 years ago Posts: 5 |
Re: DIY Tiny OLED I2C full graphics controller May 29, 2019 05:43AM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller May 31, 2019 11:47PM |
Registered: 6 years ago Posts: 5 |