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

LINKS: GLCD and touch screen: tutorials, code and info

Discussion in 'Microcontrollers' started by 3v0, Dec 3, 2011.

  1. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    Links to GLCD and touch screen tutorials and code both here on ETO and on the web in general. If you have written one or know of a good link post to this thread and we will edit this list which will be made sticky.

    Please start a new thread to ask question.

    The basic format will be

    Controller Number
    Tutorial Links
    Code Links

    ST7565

    T6963C
    Part 1:Initialization Procedure
    PIC16F887 and a 240x64 GLCD display. Complete with code examples in ASM for the base initialization procedure and a full explanation of what each code segment does.
     
    Last edited: Dec 6, 2011
    • Like Like x 1
  2. Jon Wilder

    Jon Wilder Active Member

    Joined:
    Oct 22, 2010
    Messages:
    859
    Likes:
    82
    Location:
    Fresno, CA
    Here's one I just finished for the Toshiba T6963C controller. In my example I use a 16F887 and a 240x64 GLCD display. Complete with code examples in ASM and a full explanation of what each code segment does.

    http://www.electro-tech-online.com/threads/npn-transistor.482/

    This article will get you through the base initialization procedure to prepare the display to accept data and place it on the display. Hopefully soon I will have a second article to illustrate how to both display text as well as graphics.
     
    Last edited: Dec 5, 2011
  3. Gobbledok

    Gobbledok Active Member

    Joined:
    Mar 9, 2008
    Messages:
    452
    Likes:
    34
    Location:
    Toowoomba, Australia
    Nice idea for a thread.

    Attached is a driver I wrote for an ADS7843 Touch Screen Controller. I have used a PIC32MX795F512L and MPLAB with C32. It should take little to convert it to another other PIC with a free SPI port though. Though not sure if the SPI libraries are compatible between PIC releases. All the info is in the header file and should be pretty easy to get up and running. It's pretty-well commented.

    Sometime soon I will post a driver for an ILI9325 TFT Colour LCD Controller with simple graphic functions. Probably after christmas holidays :)
     

    Attached Files:

    Last edited: Dec 14, 2011
  4. dave

    Dave New Member

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


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,251
    Likes:
    911
    Location:
    Rochdale UK

    Just recently, I too had to access a touch screen (4 wire resistive ) using a pic ( and a max 232 chip if needed) to send digital data from the touch panel.
    Very easy to implement... This uses oshonsoft basic..
     

    Attached Files:

    Last edited: Dec 20, 2011
  6. aamir1

    aamir1 Member

    Joined:
    Oct 8, 2011
    Messages:
    106
    Likes:
    0
    please tell me how to interface it with an avr controller and which touch screen will be better i have to control about 20 different appliances through touch screen
     
  7. DerStrom8

    DerStrom8 Super Moderator Most Helpful Member

    Joined:
    Aug 9, 2010
    Messages:
    5,500
    Likes:
    503
    Location:
    Vermont (GMT-5:00)
    In case you missed it on the very first post here,

     
  8. Mosaic

    Mosaic Well-Known Member

    Joined:
    Jun 3, 2010
    Messages:
    2,609
    Likes:
    128
    Location:
    Caribbean
    3v0, this is a spectacular thread. Perhaps someone could chime in with the sources of the GLCD panels / touchscreens?
     
  9. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    That would be nice.
     
  10. Gobbledok

    Gobbledok Active Member

    Joined:
    Mar 9, 2008
    Messages:
    452
    Likes:
    34
    Location:
    Toowoomba, Australia
    I use eBay :)

    There are many different modules on eBay, including bare LCD's without a controller up to full modules including Touch Screen, Touch Screen Controller, SD Card Socket, Flash Memory all in the one 40-pin module.

    They range in sizes from < 1" all the way up to > 7".

    The main thing I would look at when choosing a screen is which controller it uses. If you are unsure of writing the driver yourself then make sure you choose one which already has a driver floating around on the net or one which is supported by (e.g.) Microchips Graphics Library.
     
  11. edeca

    edeca Active Member

    Joined:
    Apr 8, 2008
    Messages:
    589
    Likes:
    38
    Location:
    England
    Last edited: Jun 10, 2013
  12. Gobbledok

    Gobbledok Active Member

    Joined:
    Mar 9, 2008
    Messages:
    452
    Likes:
    34
    Location:
    Toowoomba, Australia
    Here are a couple of drivers which I have adapted from elsewhere/written to work on my hardware. Each driver is for a RGB565 65K color LCD. Hardware is PIC32 using 16-bit PMP.

    There is basic functions for each including Init and PutPixel and GetPixel.

    There is a driver for SSD1963 and for ILI9325.
     
  13. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,251
    Likes:
    911
    Location:
    Rochdale UK
    I have updated the touch controller!! It seemed a little unstable.. Usable, but unstable..

    Using two ADC inputs and two 100k resistors is all that's needed.. ( You can use two 47nF decoupling caps, but I don't read the ADC's too fast and I need a bit of noise as I oversample... Up to you ).

    You only ever need to read two of the wire's... X+ and Y-.
    First look at the schematic.. touch.png

    To read your X plane Tris state Y+ and Y- ... Place logic 1 on X+ and logic 0 on X-.. Read Y-.
    To read your Y plane Tris state X+ and X- ... Place logic 1 on Y+ and logic 0 on Y-.. Read X+.

    Now there is another plane you need to worry about.... The Z plane!! This is how much pressure has been applied to the panel..

    To read the Z plane you need to do the same as you do for the X plane but both X+ and X- are given a logic 1 and when you read the Y- pin the higher the value the harder the press... BUT!!! The reading is logarithmic, so the threshold has to be set high.. on a 10 bit ADC you are looking at an ADC reading of 950 +..

    The Z plane sensitivity can be increased by using lower pulldown resistors... I have seen them as low as 300ohm but as the screen planes are in the order of 300 ohm it will decrease the sensitivity of the X and Y planes...

    The beauty of the Z plane is, you only need to read the X and Y values when a valid press is detected...
     

Share This Page