SSD1306 I2C driver

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

User avatar
RangerBob
Posts: 152
Joined: Thu May 31, 2007 8:52 am
Location: Beds, UK

Re: SSD1306 I2C driver

Post by RangerBob » Tue Feb 03, 2015 12:12 pm

SHughes_Fusion wrote: As for the setup, if you look at the SSD1306 datasheet the actual command for segment remap is $A0 or $A1, similar for Set_Start_Line - you add $40 to the line to get the actual command. Just a different way to do things I think - some people have a sub they call with 0/1 as options, I have individual subs for each option.
Ah, you're right; I'm being an idiot, too long since I looked properly at the code/datasheet.

User avatar
RangerBob
Posts: 152
Joined: Thu May 31, 2007 8:52 am
Location: Beds, UK

Re: SSD1306 I2C driver

Post by RangerBob » Tue Feb 03, 2015 12:16 pm

It does rather sound like they're trying to pullup the reset line with a Cap ;)

Edit: Even looking at the picture on their website, R4 looks like a cap to me!
Attachments
oled-1c-back.jpg
oled-1c-back.jpg (43.54 KiB) Viewed 13009 times
Last edited by RangerBob on Tue Feb 03, 2015 12:21 pm, edited 1 time in total.

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: SSD1306 I2C driver

Post by SHughes_Fusion » Tue Feb 03, 2015 12:21 pm

Maybe, but... I've looked at a couple of similar displays on eBay and they also have what is definitely a capacitor on this pin. I can't see the full PCB so there may be another track elsewhere. I wonder if there is meant to be a resistor charging a capacitor to give a slow ramp on the pin? After all, you need a low to actually reset the chip then hold it high in operation.

At least I know my code works (well, yours and mine!) and for now I can just solder a wire in place of the capacitor and reset from the PIC.

AndrF
Posts: 8
Joined: Fri Feb 06, 2015 5:50 am

Re: SSD1306 I2C driver

Post by AndrF » Sun Mar 29, 2015 1:13 pm

My OLED module:
Attachments
IMG_20150329_160814.jpg
IMG_20150329_160814.jpg (81.21 KiB) Viewed 12967 times

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: SSD1306 I2C driver

Post by SHughes_Fusion » Thu Apr 16, 2015 9:22 am

Quick update to this - I bought another OLED from DealExtreme. This is similar to the one AndrF posted - different layout but components seem the same.

This works without issue straight out of the box. Looks like the original one I got from Aura has a startup issue. Could be it has specific rise-time requirements or only works on certain voltages.

As an aside, I'd recommend avoiding DealExtreme unless you have no option - an order that was supposedly 3-5 day 'expedited delivery' took nearly a month to arrive...

Jon Chandler
Registered User
Registered User
Posts: 185
Joined: Mon Mar 10, 2008 8:20 am
Location: Seattle, WA USA
Contact:

Re: SSD1306 I2C driver

Post by Jon Chandler » Fri Mar 03, 2017 4:53 pm

I got a bunch of 132 x 32 OLED displays with this driver. RangerBob's SSD1306 module and demo code work great...except the output is only on the bottom half the display! I'm kind of (totally) lost looking through the driver module. I did find Max_Height and Max_Width constants and tried changing those but that didn't solve the issue.

Any recommendations?
Jon

Check out the TAP-28 PIC Application board at http://www.clever4hire.com/throwawaypic/

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: SSD1306 I2C driver

Post by bitfogav » Sun Mar 05, 2017 10:48 am

Hi Jon

When I tinkered with these displays a little while back I don't recall having any issue's with RangerBob's module, I do know that they come with different I2C Addresses assigned to them, which is selectable usually on back of the PCB, but I'm pretty sure you would be using the right I2C address?.

Also some of these displays come with a yellow top half and a blue bottom?, and some have been known to come with a completely different driver..


I wish I could be more helpful :(

Gavin

Jon Chandler
Registered User
Registered User
Posts: 185
Joined: Mon Mar 10, 2008 8:20 am
Location: Seattle, WA USA
Contact:

Re: SSD1306 I2C driver

Post by Jon Chandler » Sun Mar 05, 2017 12:42 pm

Thanks for the thoughts Gavin. The driver works perfectly, on the bottom half of the display. Even as the demo program scrolls text across the screen, only the bottom half displays anything. It looks like the vertical size parameter must be using only half the display.
Jon

Check out the TAP-28 PIC Application board at http://www.clever4hire.com/throwawaypic/

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: SSD1306 I2C driver

Post by bitfogav » Sun Mar 05, 2017 3:03 pm

I've had another look through the ssd1603 module, and I remember now that it's not so universal in respect to different size screens with ssd1603 driver..

I would look at the OLED_Init subroutine: As you say you're screen size is 132x32

Try changing the Vertical Ratio:

Code: Select all

Set_Multiplex_Ratio($0F) 
To

Code: Select all

Set_Multiplex_Ratio($1F) 

And in the demo code you may also have to change the Vertical size too:

From:

Code: Select all

OLED.Continuous_Scroll($00,$00,$02,$00,$0F,$01,Int_128_frames)
To

Code: Select all

OLED.Continuous_Scroll($00,$00,$02,$00,$1F,$01,Int_128_frames)
I hope that works for you as I don't have that size screen to test it on.. :)

User avatar
RangerBob
Posts: 152
Joined: Thu May 31, 2007 8:52 am
Location: Beds, UK

Re: SSD1306 I2C driver

Post by RangerBob » Mon Mar 06, 2017 9:08 am

Hi Jon,

Sorry for chipping in late, busy weekend!

It's been a while since I needed to look at these displays, but the SSD1306 is a fairly generic chip whilst the panels they are physically hooked up to can be connected in a number of ways. If you can get hold of the display datasheet, great; they should give you the correct register setup. If not, have a look at the datasheet:

SSD1306 Datasheet

You'll want to have a play around with the following registers:
Set Display Offset
Set Segment Re-map
Set Display Start Line

Figure 8-13 shows the ram structure you are writing into. The commands can re-map the ram to the panel as required.

If you could post where you got these from or send a picture, it might be helpful to deduce what setup they might have.

Regards

Jon Chandler
Registered User
Registered User
Posts: 185
Joined: Mon Mar 10, 2008 8:20 am
Location: Seattle, WA USA
Contact:

Re: SSD1306 I2C driver

Post by Jon Chandler » Tue Mar 07, 2017 7:40 am

The ebay ad should be attached.

The specs are:

I2C 0.91" 128x32 White/Blue OLED LCD Display Module For Arduino PIC

Features:

Driver IC: SSD1306

Size: 0.91 inch OLED

Resolution: 128 x 32

Font Color: white

Voltage: DC 3.3-5V
Attachments
ebay ad.jpg
ebay ad.jpg (103.04 KiB) Viewed 12043 times
Jon

Check out the TAP-28 PIC Application board at http://www.clever4hire.com/throwawaypic/

User avatar
RangerBob
Posts: 152
Joined: Thu May 31, 2007 8:52 am
Location: Beds, UK

Re: SSD1306 I2C driver

Post by RangerBob » Tue Mar 07, 2017 9:19 am

OK, not much information there. I poked around a number of similar listings and no-one seems to have any kind of detailed information about them.
I would suggest you try the re-mapping registers and see if you can get an idea for how its hooked up.

I have ordered a couple for the princely sum of £2 each to play around with myself. I am too cheap to pay shipping though so it'll be a month before they turn up!

Jon Chandler
Registered User
Registered User
Posts: 185
Joined: Mon Mar 10, 2008 8:20 am
Location: Seattle, WA USA
Contact:

Re: SSD1306 I2C driver

Post by Jon Chandler » Tue Mar 07, 2017 11:13 am

Yeah, there's not much to go on in that listing, not even the address but fortunately, the default in your code worked for that.

I saw these on YouTube and bought them to play with...so there's nothing waiting on them.

Another video gives a particular Arduino drive to that gives good results - I'll track it down and have a go at converting it.

Thanks for the help!

Jon
Jon

Check out the TAP-28 PIC Application board at http://www.clever4hire.com/throwawaypic/

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: SSD1306 I2C driver

Post by bitfogav » Tue Mar 07, 2017 6:01 pm

Jon Adafruit sell 128x32 oleds with Arduino tutorial and a library, I'm sure you can get the configuration data from that for you're display. website link below :)

https://www.adafruit.com/products/931

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: SSD1306 I2C driver

Post by Jerry Messina » Fri Jan 26, 2018 7:40 pm

I just got one of the adafruit displays to play around with (two actually... one spi and one I2C).

What's an easy way to generate fonts for these things? I'm interested mostly in generating a large font numeric display, maybe 6 digits or so.

Post Reply