refresh rate of uoled 128-gh1

hey,

have had alot of trouble finding any help on working this littler screen out. Now ive got the basic library and basic drawring methods down im stuck with a problem. The refresh rate im getting is horrible! and all im doing is moving a rectangle. Is this a downfall of the arduino? or of the screen? or is it my coding? any help would be really appreciated!

on closer inspection by drawing a vertical line across the screen i have found it is only the top 30 pixels that suffer from a horrible refresh rate :S?

below is my simple moving rectangle code

#include <uOLED.h>              
#include <colors.h>

uOLED uoled;                
int posX, posY;
void setup()
{
  Serial.begin(115200);         
  uoled.begin(8,256000, &Serial);
  posX = 5;                               
  posY = 5;                         
  uoled.SetContrast(5);         
  uoled.DeviceInfo();            
  delay(2000);                    
  uoled.Cls();                   
}
void loop()
{
   uoled.Rectangle(posX,posY,posX+6,posY+6,YELLOW,0);
   posX += 2;
   uoled.Cls();
}

There is nothing wrong with the code you have written. However you are using some sort of library that I don't know about and neither do you. What is going on in that is anyone's guess. That is the problem with the cut and paste computing, you think you know what is going on but you don't.

Have you sought advice from the library author?

hmm I assumed it would just work because it was of the arduino website:P

no I havnt contacted him, but I have had a look at the code and cut it down took it out the library and included it directly in the code.

however I think there's a different problem as now it appears its only around the top 40 pixels that don't refresh well.

hmm I assumed it would just work because it was of the arduino website

yes it does just work but not necessaries for what you want to do in the way you want to do it.

I assume it is doing a whole memory dump to the screen each time you update it. The problem with the top 40 pixels is probably to do with beating between the internal refresh rate of the LCD with the refresh rate you are trying to use. Put a small delay in the loop() and I think you will find it goes away although refresh will be slower.

The real answer is to only update the pixels you need to update but that will require you to write some code.

... because it was of the arduino website

You mean there is a link to a google code project in the playground?

I noticed that the cls is very slow in comparison with the other commands. It does manipulate the entire screen after all. This has not much to do with the library.

What worked nice for me is to remember the background color and the last position of an object (your rectangle). When you want to draw a new one first draw the old one in background color so it dissappears. Basically what G_Mike said

...only update the pixels you need...

I'm interested in this

...only the top 30 pixels that suffer from a horrible refresh rate

Could you explain a bit more what you did/noticed?

Jeroen

ahh thank, originaliy I tried drawing a black rectangle behind my rectangle and it improved slightly, but will try it again!

as for the top 30 pixels I mean if i change my rectangle to a line spanning from 0 to 100 or even the whole screen then the bottom half of it moves smoothly and looks nice, however the top half flashes and spikes and just doesnt appear to be able to keep up.

Does the top part of the screen look like it is missing some lines (vertical or horizontal)? I have that problem because the ribbon connecting the screen to the module has torn a small bit.

A possibility for you could be to reseat the ribbon in the module.

Jeroen

no it appears its just slower to update than the rest of the screen.

for example drawrign the lines it lookes like a straight line on the bottom and at the top it kinda flashes as it moves as in you can see it visibly go on and off.

I unfortunately can’t test anything at the moment. You still have that problem if you change the code in the first post to something like this?

#include <uOLED.h>              
#include <colors.h>

uOLED uoled;                
int posX, posY;
void setup()
{
  //[glow]Serial.begin(115200);[/glow]           // redundant serial.begin gets called from uoled.begin       
  uoled.begin(8,256000, &Serial);
  posX = 5;                              
  posY = 5;                        
  uoled.SetContrast(5);        
  uoled.DeviceInfo();            
  delay(2000);                    
  uoled.Cls();
  uoled.Rectangle(posX,posY,posX+6,posY+6,YELLOW,0);  // draw first visible rectangle
  delay(1000);                                       // wait so you can actually see it                
  for (byte i = 0; i < 5; i++)                   // to make sure the program does not try to draw outside of the screen (it will continue drawing on the next row or column)
    {
        uoled.Rectangle(posX,posY,posX+6,posY+6,BLACK,0);     // 'erase' last rectangle
        posX += 2;
//     uoled.Cls();
        uoled.Rectangle(posX,posY,posX+6,posY+6,YELLOW,0);  // draw new rectangle 
        delay(1000);                                                 // wait so you can actually see it 
    }
}

void loop()
{

}

Jeroen

the strange thing is although that works (thanks!) the same area of the screen still has a flicker and doesn't work as well as the lower portion. =/ hmm maybe ive just damaged it?

Maybe as a last resort. What firmware version (uoled.DeviceInfo()) are you running on the module? On the 4d-systems the latest is version 17.

My module has a small tear in the ribbon to the screen. I miss some vertical lines on the left and a lot of horizontal lines at the top. It doesn't effect the speed of the screen as far as i can tell. Replacement screen is in the mail. ?outch?

Jeroen

ahh, good idea! will have a look when i get home =) thanks again!

Ok, i have checked my firmware ( i know this has taken me forever) and its out of date. However it says i need to buy another programmer to update it....

is there anyway anyone knows that i can do this with the arduino instead?

A possibility is to use the arduino as a 'programmer'. Basically the only thing u need is the ftdi usb-serial chip.

-keep the arduino processor in reset or remove from board. -connect rx/tx from the display to tx/rx from the arduino (ftdi). -connect the display reset to the reset of the arduino board. -connect ground

Be sure to check the connection with for example 'DISP Software Tool' [u]before[/u] you try to flash the new firmware. At this point you can use the 4d-systems firmware update program.

Jeroen

edit: Long story short. The 'programmer' they sell is a basic ftdi board.