Show Posts
Pages: 1 2 [3] 4 5 ... 102
31  Using Arduino / Displays / Re: SSD1306 can only write to part of screen (U8Glib works, AdaFruit not) on: September 08, 2014, 12:22:01 pm
You are right, the init sequence is the same for the SH1106 and SSD1306 controller. In u8glib the displays specific details are handled in "device" callback functions. Here are those which are relevant for the SSD1306 and SH1106 with 128x64 pixel:

Code:
uint8_t u8g_dev_ssd1306_adafruit_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg)
{
  switch(msg)
  {
    case U8G_DEV_MSG_INIT:
      u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
      u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1306_128x64_init_seq);
      break;
    case U8G_DEV_MSG_STOP:
      break;
    case U8G_DEV_MSG_PAGE_NEXT:
      {
        u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
        u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1306_128x64_data_start);   
        u8g_WriteByte(u8g, dev, 0x0b0 | pb->p.page); /* select current page (SSD1306) */
        u8g_SetAddress(u8g, dev, 1);           /* data mode */
        if ( u8g_pb_WriteBuffer(pb, u8g, dev) == 0 )
          return 0;
        u8g_SetChipSelect(u8g, dev, 0);
      }
      break;
    case U8G_DEV_MSG_SLEEP_ON:
      u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd13xx_sleep_on);   
      return 1;
    case U8G_DEV_MSG_SLEEP_OFF:
      u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd13xx_sleep_off);   
      return 1;
  }
  return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg);
}

uint8_t u8g_dev_sh1106_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg)
{
  switch(msg)
  {
    case U8G_DEV_MSG_INIT:
      u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
      u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1306_128x64_init_seq);
      break;
    case U8G_DEV_MSG_STOP:
      break;
    case U8G_DEV_MSG_PAGE_NEXT:
      {
        u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
        u8g_WriteEscSeqP(u8g, dev, u8g_dev_sh1106_128x64_data_start);   
        u8g_WriteByte(u8g, dev, 0x0b0 | pb->p.page); /* select current page (SSD1306) */
        u8g_SetAddress(u8g, dev, 1);           /* data mode */
        if ( u8g_pb_WriteBuffer(pb, u8g, dev) == 0 )
          return 0;
        u8g_SetChipSelect(u8g, dev, 0);
      }
      break;
    case U8G_DEV_MSG_SLEEP_ON:
      u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd13xx_sleep_on);   
      return 1;
    case U8G_DEV_MSG_SLEEP_OFF:
      u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd13xx_sleep_off);   
      return 1;
  }
  return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg);
}

This code is taken from file u8g_dev_ssd1306_128x64.c at line 247.

The message U8G_DEV_MSG_INIT forces the init sequence to be sent to the display. This is identical for both devices.
The actual data is written with the U8G_DEV_MSG_PAGE_NEXT command. One page is written only. A page (usually) has a hight of 8 pixel and corresponds to the page of the memory in the display controller.

Here you find the only difference between the two controllers.
Code:
u8g_dev_ssd1306_128x64_data_start
for the SSD1306 and for the SH1106 this is:
Code:
u8g_dev_sh1106_128x64_data_start
Here are the definitions:
Code:
static const uint8_t u8g_dev_ssd1306_128x64_data_start[] PROGMEM = {
  U8G_ESC_ADR(0),           /* instruction mode */
  U8G_ESC_CS(1),             /* enable chip */
  0x010,                /* set upper 4 bit of the col adr to 0 */
  0x000,                /* set lower 4 bit of the col adr to 0  */
  U8G_ESC_END                /* end of sequence */
};

/* the sh1106 is compatible to the ssd1306, but is 132x64. display seems to be centered */
static const uint8_t u8g_dev_sh1106_128x64_data_start[] PROGMEM = {
  U8G_ESC_ADR(0),           /* instruction mode */
  U8G_ESC_CS(1),             /* enable chip */
  0x010,                /* set upper 4 bit of the col adr to 0 */
  0x002,                /* set lower 4 bit of the col adr to 2 (centered display with sh1106)  */
  U8G_ESC_END                /* end of sequence */
};
The only difference is, that the page starts at column 0 for the SSD1306 and at column 2 for the SH1106 controller.

The adafruit does not use this kind of page writing. It uses a complete different approach. So i can not say much about the Adafruit code.

Oliver


32  Using Arduino / Displays / Re: OLED display with 4-wire SPI mode, but without CS on: September 08, 2014, 12:07:59 pm
A good starting point is:
Code:
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);

Oliver
33  Using Arduino / Displays / Re: SSD1306 can only write to part of screen (U8Glib works, AdaFruit not) on: September 08, 2014, 12:27:53 am
Hi

If u8glib is working, it is difficult for me to provide any other usefull help. However, from what i know from the adafruit lib: Although the init sequence is almost identical to u8glib, the writing of the actual data is very different. Especially if one of your OLED displays contains the SH1106 controller, the Adafruit lib will not work at all. The SH1106 does not differ much from the SSD1306 (in fact displays are often advertised as SSD1306 display, although they contain the SH1106 controller), but still the init sequenze and data writing must be adjusted.

Oliver

34  Using Arduino / Displays / Re: Newhaven OLED displays - different versions on: September 04, 2014, 11:54:28 pm
Cross-Ref-Table: https://code.google.com/p/u8glib/wiki/device

SSD1322 constructor:
Code:
U8GLIB_NHD31OLED_GR(sck, mosi, cs, a0 [, reset])

I do not own this display, but according to other users, this should work.

Oliver
35  Using Arduino / Displays / Re: Display screen I2C - U8g library - strange graphic! on: September 03, 2014, 02:23:48 pm
Maybe, this is a SH1106 controller (instead of the SSD1306):

Code:
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NO_ACK);

Oliver
36  Using Arduino / Displays / Re: Ucglib: Color OLED and TFT Library... on: August 28, 2014, 08:27:32 am
I have developed most of the procedures with SDL and Ubuntu Linux first. Some instructions are given here: https://code.google.com/p/ucglib/wiki/sdl

Oliver
37  Using Arduino / Displays / Re: SPI_Mode3 causing SPI multiple device errors when using u8glib Library on: August 27, 2014, 05:13:14 pm
U8glib has an option to store and restore the state of the HW SPI registers. Have a look at this:
https://code.google.com/p/u8glib/wiki/userreference#setHardwareBackup
In some cases this may help...

Please also check whether U8glib works with SW SPI together with your RTC (with HW SPI).

Oliver
38  Using Arduino / Displays / Re: How to use Arduino UNO control an LCD which has a NT7506 LCD controller? on: August 27, 2014, 11:31:50 am
Hi

I have seen a lot of displays with a large number of controllers, but this controller is new to me. I do not think there is a ready made library for it.
It looks similar to the ST7565, but still has some differences in the command set. Take a library for the ST7565 (such as u8glib)  try and update the ST7565 specific code. Unfortunately i will have only limited internet access in the next days, otherwise i could offer to extend u8glib with support for the NT7506.

Any datasheet available for the display? Where did you buy the display and what is the actual screen resolution?

Oliver
39  Using Arduino / Programming Questions / Re: Having trouble with SHIELD GLCD V2 programming. on: August 27, 2014, 10:06:39 am

Oh, looks like these people made reference to U8glib, without proper citing the origin (which is, from my perspective, a license violation).

Nevertheless U8glib (which seem to be the prefered library for this shield) has been written by me and it is open source. You can download U8glib here: https://code.google.com/p/u8glib/. This project page also contains a lot of examples and the full reference manual. Please have a look there. If you have any further questions please ask your question either in this thread or post a new question in the "display" subforum of this Arduino forum.

Oliver
40  Using Arduino / Displays / Re: Looking for readable LCD display without backlight on: August 26, 2014, 12:11:37 pm
Hi

To my knowledge, at reichelt.de you can buy without registration.
mouser.com has free shipping above 65€. I never had been below that limit  smiley-roll

Oliver
41  Using Arduino / Displays / Re: Amazingly Inexpensive LCD display screens on: August 26, 2014, 01:06:32 am
At least buy-display is a reliable and good shop for buying displays. A level converter is required for most of the displays with the Uno or Mega board. For the Due (3.3V board) it will work without level shifter.

Here is a display from buy-display.com (ERC24064-1). It also requires some caps for the internal charge pump:



Oliver
42  Using Arduino / Displays / Re: Easy with you, hard with newbee, Oled 12864 4spi Helppppp me, god bless you:( on: August 25, 2014, 03:05:47 pm
Quote
i cant find where pin to tonect

This depends on the library. U8glib has as SW SPI included, so you can use any digital or analog Arduino pin for any of the display pins. Just inform U8glib which pins you actually use.

Oliver
43  Using Arduino / Displays / Re: Ucglib: Color OLED and TFT Library... on: August 24, 2014, 02:50:39 pm
Hi All

I have released version 1.01 of Ucglib. Follow the download link on the project page: https://code.google.com/p/ucglib/.

This release fixes a problem with the solid mode for font rendering. I have also added some more functions: drawGlyph, drawString and also functions to modify the reference position for strings.

Oliver
44  Using Arduino / Displays / Re: Looking for readable LCD display without backlight on: August 23, 2014, 05:35:54 pm
Hi Peter

The DOGS102 reflective version is black and white only. For the other displays you have some options for the background color. See the datasheet for this. And yes, you will need a 5V to 3.3V level translator chip for the Arduino Uno. The Arduino Due can drive this display directly.

Grüße aus BW, Oliver
45  Using Arduino / Displays / Re: Easy with you, hard with newbee, Oled 12864 4spi Helppppp me, god bless you:( on: August 22, 2014, 02:37:05 pm
Hi

Let me start with the very beginning:
Quote
I have a Mega adruino , and a oled  screen like this
Do not show a picture which is like your screen. Provide a picture of your screen together with the correct datasheet. Anything else is guessing. It seems that you have used some pictures from/for Adafruit Displays. Is your OLED an Adafruit OLED? If not, then the Adafruit software might not work at all (the Adafruit library only supports SSD1306, but not the SH1106 controller).

Regarding the connection: My suggestion is to use the 4-wire SPI, because 3-wire SPI is usually not implemented by the Arduino libraries and I2C is unreliable for far east variants of this OLED with the SSD1306 controller.
For 4-wire SPI:
- The display does not have a MISO output
- DC is data/command line, which is required in 4-wire SPI mode
- CS, MOSI and CLK are the other 3 lines required for 4-wire SPI mode.

Oliver
 
Pages: 1 2 [3] 4 5 ... 102