Shop OBEX P1 Docs P2 Docs Learn Events
128x64 graphics module — Parallax Forums

128x64 graphics module

Peter JakackiPeter Jakacki Posts: 10,193
edited 2012-10-21 19:57 in Propeller 1
I recently ordered some samples of this 128x64 graphics module to replace some of my serial 20x4 character LCDs. They are the same width as the 20x4 modules but the glass height is 40mm vs 25mm (1") so the pcb is a taller in this respect. What's interesting is that the LCD also supports clock serial mode which turns out to be only 2 lines required. This would make it suitable for a lot of I/O strapped projects for sure. Anyway, I hooked up the Prop and had to do a lot of guessing as these Chinese datasheets aren't much better than a brochure (or an old newspaper ad) but I eventually got it going after half a day.

I don't need to run it in text mode which is only 16x4 as the graphics mode is much more flexible. So I wrote a driver that works like the TV and VGA bitmap drivers in that you have a memory area that you can draw to and the driver just refreshes the display automatically. Of course the LCD doesn't need constant refreshing but it's much easier to do it this way to mirror the "frame buffer" in RAM.

Here's a pic of the display and I am adapting graphics.spin at the moment so I can have a cog as the graphics engine to draw text and other graphics. It would therefore be possible to use the same cog to draw and refresh. Quite surprising too is that although the backlight is nice and bright it is only drawing 70ma as opposed to the 200ma+ that the smaller 20x4 draws.

I have arranged to buy these displays in carton loads to get the price down (real cheap!) as I will be doing a Prop serial backback for these but I should a few leftover for any who want to try. Otherwise you can get them from:
cgi.ebay.com/12864-128x64-Graphic-LCD-Display-module-YellowBacklight_W0QQitemZ300350679188QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item45ee4ba894

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
«13

Comments

  • BeanBean Posts: 8,129
    edited 2009-11-13 12:25
    Looks like a nice display.
    What is the connection like on it ? It looks like 0.1" pins on the bottom ?

    What price will you charge for just the displays ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...


    ·
  • FredBlaisFredBlais Posts: 370
    edited 2009-11-13 13:56
    Hey, nice job!

    It don't seems like there is a lot a informations about serial programming of the device in the datasheet (versus parallel)·how did you manage to find out what to send? So graphics.spin will be 100% working on it? (apart from colors)
  • LeonLeon Posts: 7,620
    edited 2009-11-13 13:58
    I downloaded the data sheet, they are 0.1" spacing pins.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
  • COlsenCOlsen Posts: 8
    edited 2009-11-13 20:33
    Great job Peter! I would also be interested in buying some of these displays when you get them in.

    You might want to look at the driver in the object exchange here: http://obex.parallax.com/objects/151/ It might just save you some time [noparse]:)[/noparse]

    It is a good driver I have used for a similar LCD (using a different chipset and parallel interface) The driver includes drawing functions and several fonts. It also seems to be compatible with graphics.spin.

    Carl
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-14 09:38
    COlsen said...
    Great job Peter! I would also be interested in buying some of these displays when you get them in.

    You might want to look at the driver in the object exchange here: http://obex.parallax.com/objects/151/ It might just save you some time [noparse]:)[/noparse]

    It is a good driver I have used for a similar LCD (using a different chipset and parallel interface) The driver includes drawing functions and several fonts. It also seems to be compatible with graphics.spin.

    Carl

    Thanks for the link, I didn't think to look in the obex. I've got it now and looking at it but I may still roll my own as there seems to be a lot of head scratching mush in the driver, I'll see how it goes. My lcd driver has been optimized and pixel positions set up as lsb=left to keep it compatible with these graphics drivers.

    @Fred
    The basic serial timing is ok and there is no problem with that, the problem was with the command set and how the sequence is touchy I guess. Anyway, it's not really obvious or spelt out in the datasheet, just takes experimentation, even if it does work, you experiment to see what doesn't to help fill in the gaps. Then there was this problem with the bottom half of the graphics display not working. Eventually found another datasheet which hinted at this half having the same vertical address as the top but the X position is offset by 8.

    @Bean
    Bear in mind that these displays sell for around $20 each one off or around $15 if you buy three cgi.ebay.com/3x-128x64-Dot-Matrix-GRAPHIC-LCD-module-Blue-Backlight_W0QQitemZ300350679179QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item45ee4ba88b. My buy price is better but it's always awkward to sell in 1's and 2's. Mind you my completed Propeller backpack will include and SD slot, 16 free I/O, RS485, etc and compete with stock standard 20x4 LCDs. As always with pricing though is you like to sell cheap to hobbyists but then you have to deal with handling one offs and "I can't get your %^&$%#! module to work, it's cr^&%p!, sort it out for me". Trying to lower the price for hobbyists also affects the price you charge OEMs who are much easier to deal with and order in bulk and will pay a good price but not if they find out you are selling cheap to hobbyists! Any suggestions?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-11-15 00:38
    Peter: Nice. I bought a 128x64 panel 18 months ago (with some PIC stuff) but while awaiting delivery I discovered the prop - enough said - it is still in the box. Might be the same panel in which case I might be able to get it running with your work smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-15 23:59
    Here's an update on the LCD module that features a clocked serial interface as well as the standard 4/8-bit parallel mode. One thing to note too about this display is that it does not need any contrast pots as it automatically compensates, just give it 5V and a serial clock and data and that's it! Backlight is connected directly to 5V and draws 70ma for a big bright display.

    Over the weekend I managed to hack graphics.spin enough to get it to work with this display so I have included a short video. I haven't tried all the functions yet. I don't use any normal frame buffers but I write directly (so no need to copy) into the 1K display bitmap in hub memory which another cog continually reads from and updates the lcd at around 10Hz. My original code showed a CS signal but this is not needed as the serial timing can work without it. Once I test it out a bit more I will tidy it up and post it. Has anyone got one of these displays?

    This is an excellent graphic display especially considering that even in one off quantities it only costs $20 (from China).

    Short flash video (1.9MB) of graphics demo on 128x64 LCD.
    www.pbjtech.com/propeller/graphicsdemo.avi

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
    747 x 595 - 93K
    641 x 373 - 158K
  • LeonLeon Posts: 7,620
    edited 2009-11-16 00:16
    I've just ordered two of them. I'll use one with a Propeller and the other with an XMOS chip.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-11-16 00:21
    Nice work Peter!
    Peter Jakacki said...
    Here's an update on the LCD module that features a clocked serial interface as well as the standard 4/8-bit parallel mode. One thing to note too about this display is that it does not need any contrast pots as it automatically compensates, just give it 5V and a serial clock and data and that's it! Backlight is connected directly to 5V and draws 70ma for a big bright display.

    Over the weekend I managed to hack graphics.spin enough to get it to work with this display so I have included a short video. I haven't tried all the functions yet. I don't use any normal frame buffers but I write directly (so no need to copy) into the 1K display bitmap in hub memory which another cog continually reads from and updates the lcd at around 10Hz. My original code showed a CS signal but this is not needed as the serial timing can work without it. Once I test it out a bit more I will tidy it up and post it. Has anyone got one of these displays?

    This is an excellent graphic display especially considering that even in one off quantities it only costs $20 (from China).

    Short flash video (1.9MB) of graphics demo on 128x64 LCD.
    www.pbjtech.com/propeller/graphicsdemo.avi
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
    Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-16 13:51
    Why bother with yet another graphic lcd module you say? Since this one can be operated in serial mode with just the clock and data then what happens when you solder a PS/2 cable on the end of it and plug it into a Propeller PS/2 port?

    That's it, no external components at all, and the 70ma from the backlight will keep those regulators running cool, actually I'm just running mine straight off the USB power.

    I like it. BTW, the image has the lcd driver set to a negative image to give you an idea of the display area.

    P.S. Sneaked/snuck in another picture but with the Parallax font.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*

    Post Edited (Peter Jakacki) : 11/17/2009 4:57:01 AM GMT
    640 x 425 - 159K
    640 x 390 - 171K
  • COlsenCOlsen Posts: 8
    edited 2009-11-16 15:55
    This is a great find Peter, only 2 I/O's and 4 wires total for an inexpensive graphic LCD!
  • Jim FouchJim Fouch Posts: 395
    edited 2009-11-16 16:37
    I've ordered 4 to play with. I'll also be making an enclosure if anyone's interested. Thinking of putting a PS/2 connector in so you can just use a mouse extension cable to run them.

    I may even modify the driver to run two displays from one prop like I did w/ the LM9033A display from Brilldea.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jim Fouch

    FOUCH SOFTWARE
  • HarleyHarley Posts: 997
    edited 2009-11-19 01:39
    I too ordered a couple of the LCDs, and downloaded the spec and your Spin file to study while they ship (appears to take about 2-3 weeks to airmail + customs + what else).

    This module sounds like about the minimum size I'd want for one application. Spoiled using a nice Sony DVD reader with 8" color LCD. But monochrome with graphics is what I need/wanted it for. I will need graphics, so I await that portion of Spin/PASM coding. yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-11-19 02:04
    Leon,

    Keep me posted on the XMOS code:
    Leon said...
    I'll use one with a Propeller and the other with an XMOS chip.

    With 8 threads per Chip X 4 chips = Lotsa I/O.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH

    Post Edited (James Michael Huselton) : 11/19/2009 2:09:30 AM GMT
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-19 03:05
    Harley said...
    I too ordered a couple of the LCDs, and downloaded the spec and your Spin file to study while they ship (appears to take about 2-3 weeks to airmail + customs + what else).

    This module sounds like about the minimum size I'd want for one application. Spoiled using a nice Sony DVD reader with 8" color LCD. But monochrome with graphics is what I need/wanted it for. I will need graphics, so I await that portion of Spin/PASM coding. yeah.gif

    Mine only took around a week I think, I ordered them on the 4th and by the 13th I had them all hooked-up and running and posted. Wasn't such a black Friday after all.

    Color may be nice but these things are viewable in bright sunlight.

    Since then I have done a little on it on and off, improved the low level driver and added synchronization for drawing then updating automatically. I have also done a small 5x7 font for 21x8 text plus the Parallax font as you saw. I won't be able to do much with it in the next few weeks though as I will be over in the US, looks like I won't have time to drop in on Parallax out in the backwoods though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • TubularTubular Posts: 4,700
    edited 2009-11-19 08:33
    Hi Peter,

    Do you think the blue and white version from the same seller would also work in serial mode?

    I had a quick look at the data sheet, there is not as much detail on serial mode although there is some brief mention of it.

    Unless you tell me it certainly won't work I'm happy to take a minor gamble and try one...

    cheers
    tubular
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-19 10:48
    I actually ordered the blue version but they sent me the green, either way it's the same module. They have both.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • COlsenCOlsen Posts: 8
    edited 2009-11-19 14:32
    @Tubular - The white on blue LCD displays usually aren't visible without the back-light on. The black on green displays have better visibility in sunlight and normal room lighting even without the back-light. The Blue LCD's do look extremely cool in subdued lighting with the back-light on. Keep in mind that the display will draw < 1mA of supply power without the back-light. The back-light uses 70mA according to Peter's post. Many LCD's use 150-200mA for the back-light. So for portable (i.e. battery powered) applications the green displays work fine without the back-light on, you only really need to turn the back-light on to see the display in the dark.

    Carl

    Post Edited (COlsen) : 11/19/2009 2:52:51 PM GMT
  • HarleyHarley Posts: 997
    edited 2009-11-20 00:56
    Does anyone know the address to access the ROM character set; is it documented how to access from Spin and PASM?

    Thanks for any guidance on this detail. Probably rtfm, huh? yeah.gif I've not yet worked in this area of needing to work graphics and put text up too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-20 01:54
    Have a look at my code if you like but don't look too closely, it's a mess, but it works.

    This is a snippet to draw a character from the font table. Don't mind the funny {end} type statements, I stuck them in late at night to overcome "indentation blindness".

    pub font16(code) | ptr,ix,iy,ch,sh
      ptr := ((code/2)<<7) + $8000
      sh := code&1
      repeat iy from 0 to 31        ' 32 lines
        ch := long[noparse][[/noparse]ptr]             ' read combo font for this line
        ptr +=4                     ' update pointer
        ch >>= sh                   ' offset for odd or even
        repeat ix from 0 to 15
          if ch&1
            gr.plot(ix+tx-64,32-iy+ty)     ' force top left corner origin for font render
          ch >>= 2
        {end}
      {end}
      tx += 16
      if tx => 128-14                    ' rough wrap
        tx := xmar
        ty -= 32
      {endif}
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • nohabnohab Posts: 96
    edited 2009-11-20 16:08
    Great Peter !
    I've ordered one to play with too.
  • HarleyHarley Posts: 997
    edited 2009-11-21 06:52
    Peter,
    In your program ST9720.spin, sdo, sck and scs appear to be pins. If so, do the first two attach to LCD pins 5 and 6? What about scs?

    I'm trying to figure out the Prop-to-LCD wiring. If scl and sda aren't used, and I couldn't tell if used by the program, it wasn't clear how the LCD was driven. yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-21 07:43
    Harley,

    SCL and SDA are standard definitions along with RXD and TXD as the Prop uses these for program loading but they are not used in the demo. Use the latest code ST9720_demo and you will find the SCS is disabled as I found I didn't need it. Refer to a previous post where I have the connection sheet and the SDI (SDO) and SCLK (SCK) which are just the SERIAL DATA and SERIAL CLOCK lines from the Prop. These lines are output only, no need for pullups or anything. Could it be simpler?

    http://forums.parallax.com/attachment.php?attachmentid=65151

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • william chanwilliam chan Posts: 1,326
    edited 2009-11-21 08:11
    Hi Peter,

    If I use this display for text only,
    how many characters can I get per line and how many lines can be displayed?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-21 08:39
    william chan said...
    Hi Peter,

    If I use this display for text only,
    how many characters can I get per line and how many lines can be displayed?

    Hi William,

    Look back at one of my posts where I discuss that a little.
    I said...
    I have also done a small 5x7 font for 21x8 text plus the Parallax font as you saw.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-11-21 12:05
    Hi Peter, nice display.

    This has me thinking about a text 'terminal' program. I just spent all day writing one for a 20x4 display and the pocketerm has one for a vga display, but I'm not sure if such a thing exists for other displays?

    A simple terminal is:
    1) n number of lines
    2) if you feed in characters they print one after the other till you get to the bottom of the screen.
    3) when you reach the bottom of the screen at the end of that line all the lines scroll up
    4) lines can either wrap or not wrap. (I've used both, currently I'm not wrapping, but only scrolling when a CRLF arrives)
    5) the backspace character (08) goes back one character (unless it was on the first column).

    You can get fancy and move the cursor to x,y and do inverse characters and the like, but a basic terminal is still very helpful. An array of the characters is part of the code (and necessary if you want to do backspace). eg this is the code for a 20x4 to scroll up:

    (with squarebrackets in text as the forum interprets them as italics!)
    PUB Newline | i ' move the lines all up one, clear line 4, move cursor to position 1 of line 4
        repeat i from 0 to 59                                            ' move up to next line
          Display leftsquarebracket i rightsquarebracket:=Display leftsquarebracket i+20 rightsquarebracket
    
        repeat i from 60 to 79
          Display leftsquarebracket i rightsquarebracket:=32                                    ' space
    
        Column:=0                                           ' column counter to zero
        Redraw  
    
    



    Redraw is a bit of a fiddle on a 20x4 as the lines go 1,3,2,4. Display[noparse]/noparse is an 80 element array.

    A 20x4 display is about $16-$18. Yours is $20 for 21x8, so the price per character is nearly half. Very tempting. And the two lines makes interfacing easy. And Kudos to you for delving into the Chinglish datasheets and discovering the 2 line solution.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/build

    Post Edited (Dr_Acula) : 11/21/2009 12:10:57 PM GMT
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-11-21 13:06
    Makes more sense to use the screen as 20x8. The code is easy enough for a basic screen terminal as has been done for various displays. 8 lines is much better than 4 and the simple 2 wire interface is fantastic.

    Peter, I have a DE-LM106 (QY-12864BG) and it has virtually the same datasheet except it has pin 15=CS1 and 16=CS2. The block diagram shows 1 x S6B0107 and 2 x S6B0108 chips. The CS1 goes to one S6B0108 & CS2 goes to the other. There is no mention of it doing serial. I will have to try sometime.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-21 14:47
    Ray, the datasheet for this lcd is incorrect as it does not show or mention the controller although it does incorrectly attribute the interface to the COM segment driver chip. It sounds like one of those kludged KS0108 controllers that uses two chip selects, definitely not serial and needs lots of I/O.

    Here's a bit of stuff on the chip www.arduino.cc/playground/Code/GLCDks0108

    I'm busy packing for my flight at the moment and finishing off a lot of work (too much) so I won't be sleeping tonight. Still on this forum though smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • HarleyHarley Posts: 997
    edited 2009-11-21 19:32
    Peter, thanks for that clarification.

    From that info, the connections are then

    A0 to LCD-5
    A1 to LCD-6,
    with the other pins on the LCD connected to Gnd (1, 15, 20), +5v (2, 4, 19) or are no-connects (pins 3, 7..14 and 16..18). Would you say these are your connections?

    So, one could use only four wires between the Prop board and LCD for the 'write-only' connection. Simple. yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-21 19:52
    No LCDs are worthwhile reading from anyway (we don't read from the VGA monitor or TV either) and also it's not possible to read from this one when in serial mode as there is also no need to. Yep, the connection is that simple, no contrast adjustment, no extra backlight resistors, just 4 wires.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
Sign In or Register to comment.