[Request ] A tutorial to control an I2C OLED display without libraries.

I would like a tutorial about how to control an I2C OLED display without libaries. I'm looking for such a tutorial to learn I2C interface a little better and to learn how this display works. thanks for paying attention.

Hi mike.

To do that you need to RTFM. Find the chip that is in use in the display you have at hand. Then find and download its datasheet. These datasheets show all commands and usually also show some examples.

MAS3: Hi mike.

To do that you need to RTFM. Find the chip that is in use in the display you have at hand. Then find and download its datasheet. These datasheets show all commands and usually also show some examples.

That doesn't help. I don't even know how to make it work with Arduino through the datasheet.

That's why these libraries exist. They take all kinds of stuff out of your hands, like how to prepare the display for use (initialising it).

Are you asking about I2C and how that works, or are you not interested in that and only need to know what commands to send to that device and what those commands will do (and perhaps what you need to send using these commands) ?

You have several separate problems to deal with.

(1) Learn what signals are needed to control the display using it's native (probably parallel) interface.

(2) Learn how to use the I2C subsystem in the ATmega328 or learn how to 'bit bang' an I2C interface (which really isn't too difficult). I would suggest dealing with an RTC chip for this part.

(3) Then put those together to send the required signals to the OLED via the I2C interface.

Don

MAS3: That's why these libraries exist. They take all kinds of stuff out of your hands, like how to prepare the display for use (initialising it).

Are you asking about I2C and how that works, or are you not interested in that and only need to know what commands to send to that device and what those commands will do (and perhaps what you need to send using these commands) ?

Well I'm looking to learn how to use I2C devices without relying in other sources there is a tutorial about how to use the Nokia lcd display from scratch I'll give you the link to that tut https://www.youtube.com/watch?v=RAlZ1DHw03g . that's the kind of tutorial I'm looking for but with the I2C OLED display

...that's the kind of tutorial I'm looking for but with the I2C OLED display

I am not familiar with I2C OLED displays but I suspect that there is more than one model in existence.

Don

Since wire library, already handles the bitbanging for you, and you can input byte arrays to the write function of it, I suggest you to check wire library. You just need provide the oled panel address with write and then pretty much do bunch of writes to provide image data.

If you take a look of datasheet, it provides usually the i2c inteface, where first 8bits are device address and read/write bit, then aknowledge from display, then you send register address where you want to write, aknowledge, then you write byte of data, aknowledge, byte, aknowledge and so on.

This is example where I have implemented function to driv my DSP chip:

// i2c object
TwoWire i2c;

void DSPcommand (uint8_t register, uint8_t bytes[], uint8_t bytecount) {
    
   uint8_t address = 0x68; //DSP chip address with write bit
   
   i2c.beginTransmission(address); 
   
   i2c.write(register); // write which register we are writing to
      
   i2c.write(bytes, bytecount); // Write bytes  
      
   i2c.endTransmission();    // stop transmitting
    
      
}

Jeroi: Since wire library, already handles the bitbanging for you, and you can input byte arrays to the write function of it, I suggest you to check wire library. You just need provide the oled panel address with write and then pretty much do bunch of writes to provide image data.

If you take a look of datasheet, it provides usually the i2c inteface, where first 8bits are device address and read/write bit, then aknowledge from display, then you send register address where you want to write, aknowledge, then you write byte of data, aknowledge, byte, aknowledge and so on.

This is example where I have implemented function to driv my DSP chip:

// i2c object
TwoWire i2c;

Is the aknowledge being done by the library automatically?

void DSPcommand (uint8_t register, uint8_t bytes[], uint8_t bytecount) {       uint8_t address = 0x68; //DSP chip address with write bit  
  i2c.beginTransmission(address);  
  i2c.write(register); // write which register we are writing to         i2c.write(bytes, bytecount); // Write bytes          i2c.endTransmission();    // stop transmitting           }