Page 1 of 1

Port display to SSD1325 oled

PostPosted: Tue Aug 30, 2016 4:44 am
by DLBB
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.

Re: Port display to SSD1325 oled

PostPosted: Tue Aug 30, 2016 9:35 am
by Sorunome
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.

Re: Port display to SSD1325 oled

PostPosted: Sun Sep 04, 2016 10:12 am
by DLBB
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.

Re: Port display to SSD1325 oled

PostPosted: Sun Sep 04, 2016 11:36 am
by DLBB
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...

SPI.transfer()

PostPosted: Sun Sep 04, 2016 12:40 pm
by DLBB
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)?

First light

PostPosted: Tue Sep 06, 2016 5:30 am
by DLBB
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...

Re: Port display to SSD1325 oled

PostPosted: Sat Sep 17, 2016 12:34 pm
by DLBB
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...