Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:51 16 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MM2: Updated graphics - All controllers

     Page 2 of 2    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10251
Posted: 11:01pm 22 Feb 2016
Copy link to clipboard 
Print this post

  Quote  I wondering if the I2C code could be adapted for this OLED


Looking at your picture it appears that every second line is missing so there must be something strange in the way this device is addressing.

It is a very cute display

I'm going to do some work on updating the i2c driver for the normal display then it may be possible to define a double height font to solve the issue

UPDATE

Just found on the web: try replacing lines 168-195 (block of initialisation commands) with the following

OLED.SCmd(&HAE) 'display off
OLED.SCmd(&H20) 'Set Memory Addressing Mode
OLED.SCmd(&H10) '00,Horizontal Addressing Mode01,Vertical Addressing Mode10,Page Addressing Mode (RESET)11,Invalid
OLED.SCmd(&Hb0) 'Set Page Start Address for Page Addressing Mode,0-7
OLED.SCmd(&Hc8) 'Set COM Output Scan Direction
OLED.SCmd(&H00) '---set low column address
OLED.SCmd(&H10) '---set high column address
OLED.SCmd(&H40) '--set start line address
OLED.SCmd(&H81) '--set contrast control register
OLED.SCmd(&Haf) '--contrast value
OLED.SCmd(&Ha1) '--set segment re-map 0 to 95
OLED.SCmd(&Ha6) '--set normal display
OLED.SCmd(&Ha8) '--set multiplex ratio(1 to 16)
OLED.SCmd(&H0f) '
OLED.SCmd(&Ha4) '&Ha4,Output follows RAM content&Ha5,Output ignores RAM content
OLED.SCmd(&Hd3) '-set display offset
OLED.SCmd(&H00) '-not offset
OLED.SCmd(&Hd5) '--set display clock divide ratio/oscillator frequency
OLED.SCmd(&Hf0) '--set divide ratio
OLED.SCmd(&Hd9) '--set pre-charge period
OLED.SCmd(&H22) '
OLED.SCmd(&Hda) '--set com pins hardware configuration
OLED.SCmd(&H02)
OLED.SCmd(&Hdb) '--set vcomh
OLED.SCmd(&H49) '&H20,0.83xVcc
OLED.SCmd(&H8d) '--set DC-DC enable
OLED.SCmd(&H14) '
OLED.SCmd(&Haf) '--turn on oled panel
Edited by matherp 2016-02-24
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 08:46am 23 Feb 2016
Copy link to clipboard 
Print this post

Hi Matherp

You are a genius thanks for the updated code
this

OLED.pstring(0, 0, "Hello", 1, 0)
OLED.pstring(35, 0, "Hello", 2, 0)


now produces




Many Thanks
Jman
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025