1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Z80 Graphic LCD interface

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by cmos555, Jun 25, 2009.

  1. cmos555

    cmos555 New Member

    Joined:
    Jun 25, 2009
    Messages:
    7
    Likes:
    0
    Location:
    Tokyo, Japan
    Hi,

    I'd like to interface a Z80 cpu to a monochrome LCD display through a dual port sram.
    The LCD is a 320x240 graphic display but I just want to use it to display 40x25 characters which will be stored in the dual port sram (1KB).

    I'm thinking of using the following hardware: Optrex F-55157GNF-LW-ASN display, and Cypress cy7c130 dual port sram.

    What would be the best way to go about doing this?

    Please would you give me some pointers in the right direction or any sample circuit designs would be very helpful.

    Thanks.
     
  2. monkeybiter

    monkeybiter Member

    Joined:
    Oct 16, 2006
    Messages:
    200
    Likes:
    2
    Location:
    doncaster, u.k.
    The LCD will need a microcontroller or the Z80 to feed it the display data, it won't get it by it's self.
    You could use a separate uC to access the ram and supply the LCD, but when the Z80 is writing data to the ram it might as well be writing directly to the LCD.
    In other words you don't need dual port ram for a job like this, just the cpu, program/data ram and the LCD [plus glue logic].
     
  3. cmos555

    cmos555 New Member

    Joined:
    Jun 25, 2009
    Messages:
    7
    Likes:
    0
    Location:
    Tokyo, Japan
    Hi Monkeybiter,

    Thank you for your help.

    Understood. I also need to be able to generate the characters for the display.
    Could I use a PIC cpu as an interface between the Z80 and LCD?

    I would like the LCD to be memory mapped, not using the I/O functionality of the Z80.


    Thanks again.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. monkeybiter

    monkeybiter Member

    Joined:
    Oct 16, 2006
    Messages:
    200
    Likes:
    2
    Location:
    doncaster, u.k.

    After a quick look at the datasheet for the display you will not be able to drive it directly from the cpu. In fact to drive it with a pic I think you will need a quickish chip at 20MHz min. For you requirements a parallel slave port might work out ok with character data stored in the pic. Why memory map the display?
    Choose an 18F at 40MHz and you should be OK.
    On the other hand I've just finished a nightshift and my grey matter is just about to go into sleep mode, so I might be talking rubbish.
     
  6. cmos555

    cmos555 New Member

    Joined:
    Jun 25, 2009
    Messages:
    7
    Likes:
    0
    Location:
    Tokyo, Japan
    Hi monkeybiter,

    I'll give that a try. I had been looking at some 40MHz PICs - not really sure which one to go with as there are so many. Any recommendations? I did some googling and came across a few PIC/LCD projects so I'll work on that part first.

    The next step I guess is to interface the Z80 with the PIC. I want to "memory map" the display because I'm basing the design on a very old computer, the first computer I used when I was a kid.

    Thanks for helping me out while on your nightshift :)
     
  7. kchriste

    kchriste New Member Forum Supporter

    Joined:
    Jul 23, 2006
    Messages:
    3,677
    Likes:
    47
    Location:
    Victoria BC, Canada
    I vaguely remember something about using the Z80's DRAM refresh feature to create a video signal with little or no processor overhead, but the details escape me at the moment.
     
  8. monkeybiter

    monkeybiter Member

    Joined:
    Oct 16, 2006
    Messages:
    200
    Likes:
    2
    Location:
    doncaster, u.k.
    The majority of PIC/LCD projects you will find will use what I would call static LCD modules as opposed to dynamic. The static type [character or graphic] have their own memory mapped to the display. You simply write data to the required address and the amended display remains until altered.
    'Dynamic' types require a constant synchronised data stream just to maintain the display. That would be challenging to perfect with a pic.
    I would reccomend a compromise on the display resolution to begin with so that you can use an easier memory mapped module, until you get the rest of your machine working, then revisit the display.

    Out of curiosity what was your first computer? Mine was a ZX80 [still got it].
     
    Last edited: Jun 26, 2009
  9. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi cmos,
    What was the model of I'm basing the design on a very old computer.?

    The Sharp MZ80K had the vid memory mapped at D000h thru D3E8h.
    1Kbyte, 40 cols * 25 lines, monochrome.
    The character set was in ROM.
     
  10. cmos555

    cmos555 New Member

    Joined:
    Jun 25, 2009
    Messages:
    7
    Likes:
    0
    Location:
    Tokyo, Japan
    Hi kchriste,

    Interesting idea! I did a google and came across a few related articles but can't say I really understood :-(

    Thanks.
     
  11. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    All it really means that the video memory/ram area is addressed by the video logic, timing from a 32.768Khz/2 xtal for the 15Khz nominal line freq.

    The main cpu writes to the vid memory during video blanking and the vid logic reads it during the display scan.
     
    Last edited: Jun 27, 2009
  12. cmos555

    cmos555 New Member

    Joined:
    Jun 25, 2009
    Messages:
    7
    Likes:
    0
    Location:
    Tokyo, Japan
    Hi monkeybiter,

    Thanks. I've been looking at some graphic lcd displays (with memory). Some of them have controllers and some don't. Would it be better to use an LCD with a controller or without if I am going to use a PIC interface? The SED controllers seem popular.

    I'll try setting up the PIC part first to get something to display on the screen, then work on the Z80 part.

    I realised that I made a mistake with the screen resolution. It was actually 48chars x 16 lines. Can you guess what computer it was? (see my reply to ericgibbs) So, I actually need something like a 400x200 pixel display (or 480x200). Makes it a bit more complicated, I guess... Can you recommend any displays?

    Thanks again.
     
  13. cmos555

    cmos555 New Member

    Joined:
    Jun 25, 2009
    Messages:
    7
    Likes:
    0
    Location:
    Tokyo, Japan
    Hi Eric,

    I vaguely remember the MZ80K, although I remember the ZX80 a bit better.
    Mine was a Nascom 1 that my dad bought. It was a kit that we had to build it ourselves.
    The display was memory mapped at 0800-0bff and quite a horrible configuration:

    video

    My dad threw it away a few months ago and I was a bit p!$$ed off so I decided I wanted to build one myself.

    Cheers.
     
  14. cmos555

    cmos555 New Member

    Joined:
    Jun 25, 2009
    Messages:
    7
    Likes:
    0
    Location:
    Tokyo, Japan
    Hi Eric,

    I think I need to read up a bit more on how displays work :)


    Cheers
     
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    Hi,
    I'll dig out and post the MZ80K video mem circuit.:)
     

Share This Page