Zunixyz / u8glib

Automatically exported from code.google.com/p/u8glib
Other
0 stars 0 forks source link

Touchy Screen gets noise #94

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.adding additional circuits that are referenced to the same ground plane as 
the screen.

What is the expected output? What do you see instead?
The entire screen looks either all lights up or looks like it flops the rotate 
i've applied and it just looks noisy and the fonts split to every other line.

What version of the product are you using? On what operating system?
Running ssd1325 screen on arduino mega 2560, u8glib version 1.07 

I think that because there is a ground noise issue here, that the best approach 
would be to reinitialize the screen every so often.  Is there any command that 
would simply run the init sequence of the screen again?  Or should I go through 
with physically writing the commands through the SPI comm?

Original issue reported on code.google.com by electric...@gmail.com on 13 Sep 2012 at 2:29

GoogleCodeExporter commented 8 years ago
reinit is done with this command within Arduino env (not tested):

u8g_InitLL(u8g.getU8g(), u8g.getU8g()->dev);

This should send the init sequence again.

Can you confirm, that everything is ok without the additional circuit?
What about adding some larger caps between ground and power supply?

Original comment by olikr...@gmail.com on 13 Sep 2012 at 3:52

GoogleCodeExporter commented 8 years ago

Original comment by olikr...@gmail.com on 13 Sep 2012 at 3:52

GoogleCodeExporter commented 8 years ago
wow, the reinitialize code works perfectly, and I did try things out with
larger caps, but if i really try to ignite having the screen mess up by
connecting my ground planes on my breadboards, then eventually after enough
tries, i can still manage to mess up the screen.  I just recently ordered
some supercaps figuring that it was most likely dips on my 12 volts needed
for the screen so i'll have to get back to you on whether it fixed the
whole situation.

and great job on this library by the way.  ever since i've been playing
with arduinos, i've been fascinated by driving lcd screens and I definitely
like this library the most by far.

Original comment by electric...@gmail.com on 13 Sep 2012 at 5:26

GoogleCodeExporter commented 8 years ago
glad, that you like this lib :-)

i will close this issue, feel free to add a new one (or contact me directly)

Oliver

Original comment by olikr...@gmail.com on 13 Sep 2012 at 5:38

GoogleCodeExporter commented 8 years ago

Original comment by olikr...@gmail.com on 13 Sep 2012 at 5:38

GoogleCodeExporter commented 8 years ago
Oliver,

I'm hitting some issues with the speed of running the u8g library and
arduino. Let's say i'm trying to display a lot of text on a screen while
having the arduino processing inputs and outputs simultaneously.

Is there any way I can optimize my code so that the frame rate speeds up or
only changes when needed? For example, my main loop is always drawing to
the screen, and I also need it to run the operation code as fast as
possible.  I was considering having the font library be pulled into RAM
instead of PROGMEM because I believe there could be some delay with looking
up characters from the font library in PROGMEM, and I've also tried
considering a "run once" code where the screen updates to the latest text,
and then doesn't continue writing to the screen until something needs to
change, but that doesn't seem to work.

The whole reason behind this is that I'm trying to make a simple menu
structure, however if it's taking 20ms to write to the screen each time,
then that's 20ms of processing time in my loop that I lose, so I can't do
button press updates very quickly and therefore have a laggy or skipped
button response.

Is there anything you could suggest I do to speed up this process whether
it be use software interrupts for buttons or anything like that?

Original comment by electric...@gmail.com on 18 Sep 2012 at 9:48

GoogleCodeExporter commented 8 years ago
Hi

I would suggest to contact me directly @gmail.com (see e-mail in the source 
code of u8glib). With e-mails it is easier to share and discuss code. 

Here are some ideas:
General speed up:
- use 2x version of the display device
- use hardware SPI variants

Processing:
- Interleave your processing code with the picture loop
- E.g. use button checks within the picture loop

Let me give an example with m2tklib (which is my menu lib):
// Arduino loop procedure
void loop() {
  m2.checkKey();
  if ( m2.handleKey() ) {
    u8g.firstPage();  
    do {
      m2.checkKey();
      draw();
    } while( u8g.nextPage() );
  }
}

"m2.checkKey()" is the m2tklib procedure to check for a menu
button (also does debounce and queueing). It can be called inside
and outside of the picture loop. 

Oliver

Original comment by olikr...@gmail.com on 19 Sep 2012 at 4:34