I'm trying to make my own library for the SH1106 (I2C model). I can send commands and draw on the first line each individual pixel, only I'm not able the write on the other lines.
I was wondering if someone could lend a hand. I've looked to other code and it seems you need to change the page. I tried it and it doesn't work. I can't make sense of the u8glib library.
david_prentice:
With most I2C displays.
You send a command as <80>
You send data as ...
No, I have not checked your data sheet.
I bet that your display will work just like a SSD1306. (with possible slight difference in initialisation)
David.
first, thank you for your time.
second, that is pretty much how send commands and data to the screen.
problem is I cannot seem to write data to the other lines, only the first line works.
You have an Arduino. There are proven SH1106 libraries e.g. from Olikraus
I always start with round wheels. Then develop my own versions after fully examining the prior art.
I am not proud. If someone has written better code, I am happy to steal their knowledge.
I have never studied the SH1106. However I have written my own SSD1306. Quite honestly, you look at the timing diagrams. Write the appropriate low level driver.
Then it is just a question of reading the datasheet and issuing the relevant oled_command() and oled_data() sequences.
If you find u8glib difficult to follow, there are often 8051 examples on the internet in C or ASM. These bit-bang lcd_command() and lcd_data() functions. Just observe how they are used in the lcd_init() and how they are used to clear the screen or render a font..
thanks again for your time.
well I did study other libraries (sorry should have mentioned it) and from what I understand is that you change the page. this controls the y coordinate.
I believe this works for ssd1306 as well. My problem is when I change the page the screen doesn't respond.
From memory, the SSD1306 and SH1106 use one byte per column X. Each bit is a different row. So 128 bytes will fill 128x8 strip in your screen. The Y row is referred to as a page. e.g. page#5 is row#40 .. #47.
This is just like a KS0108 or many other monochrome controllers.
As always, you read the datasheet.
These are things that you have to digest for yourself. We can spoonfeed you but you will not understand it if it is done for you.
If I understand you and the data sheet sending 0xff to ram 128,I believe SH1106 is actualy 132 bits wide according to the data sheet, a section of 128 by 8 pixels should be on? I have tried it and only the first row is turned on. though the screen seems to be undamaged, I've tried the u8glib and it works. So the problem is in the code and not dead pixels.
thanks again for you time,
Rick
PS. I have made code all by myself by simply reading datasheets etc.
Maybe you should tell us the exact command sequence, which you sent to the display. The problem is, that the memory layout is influenced by several other commands. Most of the code you see in u8glib or u8g2 manly ensures that the display is in a predictable clearly defined state.
well I tried it and its works the same as sending 0x01.
Maybe its the init (maybe I am forgetting a important setting) , could you have look at mine or point me to the init for SH1106 in your library
maybe I should mention when I change the page (like 0xb1) the screen does not respond (I2C communications seems fine, TWSR reads 0x28) while a line on 9th line should have been drawn.
it works!!!!!!!!!!!!!!!!!!
it is something in the settings.
I don't have time to pin point which setting it is.
I will report back later, reckon Sunday evening or Monday.