View previous topic :: View next topic |
Author |
Message |
PeWa
Joined: 15 Jan 2019 Posts: 22 Location: Sweden
|
Sleepmode OLED SSD1306 0.91" version |
Posted: Sun Mar 10, 2019 12:52 am |
|
|
Hi Coders
Has anyone using the 0.91 OLED version been able to enter sleep mode, display off / on ?
The Code library has some drivers for it and I use one of them and it works fine, however i cannot get the Display off/on to work that should be 0xAE and 0xAF nothing happens to the display when I use these commands.
There is a 0.96" version of the 1306 maybe that is supporting these commands I donĀ“ t have any 0.96 display to test on.
Maybe someone has been able to take 0.91 version to sleep ?
//PeW |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19498
|
|
Posted: Sun Mar 10, 2019 3:22 am |
|
|
It should work.
The sequence would need to be (using my driver):
Code: |
const byte display_off[] = {S_DISPLAYOFF};
OLED_commands(display_off, 1);
|
Use the init_sequence to wake it or you may find it has forgotten some
settings (the 'off' is a full reset).
so wake with:
OLED_commands(init_sequence,sizeof(init_sequence)); //initialise the OLED
Remember also, that if you are putting the PIC to sleep, you need to
_wait_ for the command to have finished sending, _before_ you sleep
the PIC. |
|
|
PeWa
Joined: 15 Jan 2019 Posts: 22 Location: Sweden
|
Sleepmode OLED SSD1306 0.91" version |
Posted: Sun Mar 10, 2019 5:03 am |
|
|
Hi Ttelmah
Thank's for clarification, once I know that it should work I hooked up my I2C analyzer and saw that it was sending wrong byte.
I had the sequence in ROM array and for that I needed the
Code: |
void OLED_commands(rom byte* commands, unsigned int8 number)
|
So now it shuts off OK
//PeW |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Sun Mar 10, 2019 5:07 am |
|
|
There is a possibility that the OLED display doesn't accept the 'sleep' command. Unless the 'driver' was written by the mfr AND the manufacturer's datasheet says 'sleep' IS supported.
I remember getting a great deal on some 20 by 4 LCD modules 2 decades ago that had different 'line' addresses from 'regular' displays ! Even though they were pin compatible. THAT took awhile to figure out as they did 'work', just not as expected. The driver was correct for official LCDs. MY guess is these were maybe for some custom piece of equipment and were 'surplus', hence the GREAT deal ($2 each).
So first, read the datasheet and confirm ALL commands are as you expect,then look at the driver.
Also be sure the driver hasn't got some 'enable sleep mode' variable set to 'disable'! It's common to have default conditions early in the driver (R/W for example..), easy to miss. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19498
|
Re: Sleepmode OLED SSD1306 0.91" version |
Posted: Sun Mar 10, 2019 10:02 am |
|
|
Good. Glad it works.
PeWa wrote: | Hi Ttelmah
Thank's for clarification, once I know that it should work I hooked up my I2C analyzer and saw that it was sending wrong byte.
I had the sequence in ROM array and for that I needed the
Code: |
void OLED_commands(rom byte* commands, unsigned int8 number)
|
So now it shuts off OK
//PeW |
|
|
|
|