Pages: 1 2 3 [4]   Go Down
Author Topic: ST7920 Interface Question  (Read 10609 times)
0 Members and 1 Guest are viewing this topic.
North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 52
Posts: 1778
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Unfortunately the display sucks at 'fast' ( you can set and clear the display before the pixels fully illuminate ). The ST7920 chip is a good driver however. A different model ( green are usually good ) ST7920 screen may have a lot better performance.

It is a great display for static information as you can still write to it quickly.

Or are you having problems with static info displaying properly?
Logged


United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same screen and the same problem. Pot wiper to v0 won't do anything, in fact, I haven't been able to change contrast at all.

The ST7920-based glcd that I purchased from eBay has a tiny pot for contrast adjustment, labelled VR1, on the back of the board. The Vout pin on the board is not connected to anything. Check yours in case it is similar.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Or are you having problems with static info displaying properly?
I know its refesh rate is slow. I'm talking about static contrast.
The ST7920-based glcd that I purchased from eBay has a tiny pot for contrast adjustment, labelled VR1, on the back of the board. The Vout pin on the board is not connected to anything. Check yours in case it is similar.

Mine doesn't. And vOut is connected to a pad for a resistor that isn't there.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

And vOut is connected to a pad for a resistor that isn't there.

Same with mine - that's what I meant when I said it isn't connected. Possibly you have the same board as I have but with the pot not fitted (I've seen a photo of one somewhere). VR1 is midway between the 2 black blobs (chips) marked U1 and U3. My guess is that the board is supposed to be populated with either the pot or that resistor.

[EDIT: my board has 2 further resistors unpopulated, labelled R6 and R7, close to VR1. Looks like they may be for providing a fixed contrast setting instead of the pot - so maybe this is a third way that the board can be populated.]
« Last Edit: June 10, 2012, 04:04:16 pm by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Indeed, it looks like we have different versions of the same board. I found the pads for vr1. Mine is missing r7 too, but R6 is a 0ohm resistor. Also, I have other empty pads, labeled C3 and C4.

I don't have enough electronics knowledge to do anything but I'm sure there has to be a way to adjust contrast on mine. Right now it is awful.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Mine has C3 and C4 unpopulated as well.

R6 appears to short the pot. You could try removing it and installing the pot instead, or a resistor (the 3rd terminal of the pot appears to be unconnected, which agrees with the ST7920 datasheet). The pot on my board measures 18K end to end, and its current setting is equivalent to R6 = 2K.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

R6 appears to short the pot. You could try removing it and installing the pot instead, or a resistor (the 3rd terminal of the pot appears to be unconnected, which agrees with the ST7920 datasheet). The pot on my board measures 18K end to end, and its current setting is equivalent to R6 = 2K.
Thank you, with this info I figured out the board a little bit.

I made my v0 pin work by soldering jumper J1 and desoldering the one in vr1. Still, no luck with a pot. I get nothing until v0 gets to 5v, then I get shitty contrast, which is weird because VR1 (and therefore R6) was connected straight to +5v. It seems that the lcd wants more than VDD to drive the contrast... how many V do you get at the upper pad of r6 @ optimal contrast?
Logged

gedrop
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

at the moment i am using the SPI interface with a ST7920 with the u8glib.
but it is to slow to update the whole display.
is there a function i can use to update a part of the screen (not the whole frame buffer) to speed up things?

the function i use now is drawPixel(); and i draw a horizontal wave form, so its a line of 128 pixels.
Logged

Germany
Offline Offline
Edison Member
*
Karma: 100
Posts: 1218
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

What you can do: Redraw only the upper part of the screen (assuming that no screen rotation is in effect). However this is not very portable and will always be specific to your display. Idea is this:

1. Get the current y position of the current page.
2. Abort the picture loop once the upper part of the display has been redrawn.

Let me assume that you have a 128x64 ST7920 display.
This means your constructor looks like this:
Code:
U8GLIB_ST7920_128X64 u8g(18, 16, 17, U8G_PIN_NONE);                  // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17

To get the current y coordinate, define the following:
Code:
/*
  the pb object is (usually) the device name from http://code.google.com/p/u8glib/wiki/device
  with "_pb" added at the end.
*/
extern u8g_pb_t u8g_dev_st7920_128x64_sw_spi_pb;

Then, within the picture loop, you can access the upper y position of the current page with:     u8g_dev_st7920_128x64_sw_spi_pb.p.page_y0

The modified picture loop will look like this:
Code:
  u8g.firstPage(); 
  do {
    drawFast();
    /* check if the upper part has finished */
    if ( u8g_dev_st7920_128x64_sw_spi_pb.p.page_y0 >= 16 )
      break;
  } while( u8g.nextPage() );

Note, that u8g_dev_st7920_128x64_sw_spi_pb.p.page_y0 will have values 0, 8, 16, 24, ... if the page height is 8.

I have added a complete example here:
http://code.google.com/p/u8glib/source/browse/sys/arduino/PartialUpdate/PartialUpdate.pde

Oliver
Logged

Pages: 1 2 3 [4]   Go Up
Jump to: