CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Sleepmode OLED SSD1306 0.91" version

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PeWa



Joined: 15 Jan 2019
Posts: 22
Location: Sweden

View user's profile Send private message

Sleepmode OLED SSD1306 0.91" version
PostPosted: Sun Mar 10, 2019 12:52 am     Reply with quote

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: 19195

View user's profile Send private message

PostPosted: Sun Mar 10, 2019 3:22 am     Reply with quote

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

View user's profile Send private message

Sleepmode OLED SSD1306 0.91" version
PostPosted: Sun Mar 10, 2019 5:03 am     Reply with quote

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: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Mar 10, 2019 5:07 am     Reply with quote

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: 19195

View user's profile Send private message

Re: Sleepmode OLED SSD1306 0.91" version
PostPosted: Sun Mar 10, 2019 10:02 am     Reply with quote

Good. Glad it works. Very Happy

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group