Port display to SSD1325 oled

Libraries, utilities, bootloaders...

Port display to SSD1325 oled

Postby DLBB » Tue Aug 30, 2016 4:44 am

Hi.

Thanks for this kewl GB thingy! I like to port the screen from Nokia display to SSD1325 oled. I have a working lib for the ssd and the initialisation is like the one from the Nokia display.

Question: what does

Code: Select all
if(gb.update()){ //update everything


mean? What's behind

Code: Select all
and updates everything (display, sound, batter monitor, etc.) at a fixed frequency (20 times per second by default)


Does it draw all the stuff on the screen again? Bitmap bg, sprites etc. p. p.? Or what in detail does it do?

And what's this Nokia display routine doing:

Code: Select all
void Display::update(void) {
   frameCount ++;
    uint8_t col, maxcol, p;

    for (p = 0; p < 6; p++) {

        command(PCD8544_SETYADDR | p);

        // start at the beginning of the row
        col = 0;
        maxcol = LCDWIDTH_NOROT - 1;

        command(PCD8544_SETXADDR | col);

        digitalWrite(dc, HIGH);
        if (cs > 0)
            digitalWrite(cs, LOW);
        for (; col <= maxcol; col++) {
            SPI.transfer(_displayBuffer[(LCDWIDTH_NOROT * p) + col]);
        }

        if (cs > 0)
            digitalWrite(cs, HIGH);

    }

    command(PCD8544_SETYADDR); // no idea why this is necessary but it is to finish the last byte?
}



Thank you for information.
User avatar
DLBB
 
Posts: 7
Joined: Sun Aug 28, 2016 7:27 pm

Re: Port display to SSD1325 oled

Postby Sorunome » Tue Aug 30, 2016 9:35 am

Hey there! gb.update(); is responsible for updating the battery, the backlichgt, the pressed buttons, the shound, popups, sending the buffer to the screen (if set clearing it again) and handling your program to have a static frame-rate. For more in-detail stuff you might want to check the source here.

The routine you linked is gb.display.update(), right? That routine takes the graphbuffer and sends it off to the screen so that the screen actually displays what was in the graph buffer before calling that function.
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: Port display to SSD1325 oled

Postby DLBB » Sun Sep 04, 2016 10:12 am

Hi Sorunome.

Thank's for the info. I started the port now...

Can someone tell me what base was used for the Gamebuino display.cpp and display.h? Does it use the base core of Adafruit_PCD8544.cpp and Adafruit_PCD8544.h out of the https://github.com/adafruit/Adafruit-PC ... CD-library - repo? I mean functions like drawPixel() for example?

I have some essential problems to port this display.cpp to a / to the SSD1325 functions and declarations... It's (EDIT: very!!!) hard to find a starting point.
User avatar
DLBB
 
Posts: 7
Joined: Sun Aug 28, 2016 7:27 pm

Re: Port display to SSD1325 oled

Postby DLBB » Sun Sep 04, 2016 11:36 am

Ok. There seems to be a starting point:

http://gamebuino.com/forum/viewtopic.php?f=16&t=3385&p=12125#p12125

Now it's time to do something usefull...
User avatar
DLBB
 
Posts: 7
Joined: Sun Aug 28, 2016 7:27 pm

SPI.transfer()

Postby DLBB » Sun Sep 04, 2016 12:40 pm

Hi.

In display.cpp file in the function
Code: Select all
Display::update(...)
there's a

Code: Select all
SPI.transfer(_displayBuffer[(LCDWIDTH_NOROT * p) + col]);


in it. Is SPI using the pins I declared in setup.c for MOSI, clock etc.? Or must I use the standard SPI pins of the A328p (MOSI and SCK)?
User avatar
DLBB
 
Posts: 7
Joined: Sun Aug 28, 2016 7:27 pm

First light

Postby DLBB » Tue Sep 06, 2016 5:30 am

Ok. There's something like a picture on oled.

I connected the hardware SPI pins of the 328p to the oled.

This means I'm on the right track.

Way to go...
Attachments
IMG_20160906_072959.jpg
IMG_20160906_072959.jpg (230.32 KiB) Viewed 14770 times
User avatar
DLBB
 
Posts: 7
Joined: Sun Aug 28, 2016 7:27 pm

Re: Port display to SSD1325 oled

Postby DLBB » Sat Sep 17, 2016 12:34 pm

Another step?

I could change the Adafruit lib for SSD1325 (128x64) to 104(102)x80.

https://www.youtube.com/watch?v=9ATfVfpdznc

Now I should beginn to port this running stuff to GD framework...
User avatar
DLBB
 
Posts: 7
Joined: Sun Aug 28, 2016 7:27 pm


Return to Software Development

Who is online

Users browsing this forum: No registered users and 25 guests

cron