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

GLCD (Wayton MG1206E) CS1 CS2 polarity ...

Discussion in 'Microcontrollers' started by granddad, May 17, 2017 at 6:16 AM.

  1. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    699
    Likes:
    63
    Location:
    Worcestershire UK
    I had this 2.5” 128x64 GLCD (WAYTON MIT MG1206E SGL) in my parts box , and in a crazy moment I thought I would see if it worked ( It was from a Maplin grab bag of led / lcd junk) , found some data on the www and lashed up a test bed, having realised graphics LCD require big-ish data squirted at them I used a dsPIC33EV256GM104 it is has 16k ram available. ( no details of the 20 pins on the pcb ) several days later ….. success. Well some lines on the screen, seems NT7108 / KS0108 controllers are not all the same, this one has a high level CS1 and CS2 ,( Left and right side controllers) not seen any mention of this on the files / posts found on the web. So though I would share. My intention is to write fonts / graphics into an array in PIC memory and just display that….
    ( colours are just my BB wire reference ).

    wayton1206e2.jpg
    GLCD_lashup.jpg
     
    Last edited: May 17, 2017 at 11:15 AM
  2. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    9,772
    Likes:
    290
    Location:
    Brisbane Australia
    Not sure if it's useful or not but attached is some code I wrote about 10 years ago for one of these displays.

    Mike.
     

    Attached Files:

    • Like Like x 1
    • Thanks Thanks x 1
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,755
    Likes:
    846
    Location:
    Rochdale UK
    Wow Mike... That's what I call a concise library.. Mine is half that size.. I do, however, use a double buffer, so alot of my code write's are to the spare canvas...

    Well done though!!
     
  4. dave

    Dave New Member

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


     
  5. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    699
    Likes:
    63
    Location:
    Worcestershire UK

    Thank you Mike, I'm getting to understand the GLCD controller ( possibly ! )
    lcd01.jpg .
     
  6. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    9,772
    Likes:
    290
    Location:
    Brisbane Australia
    I particularly like the circle routine because it completely baffles people how it works.
    Code (text):

    void Circle(unsigned char cx,unsigned char cy,unsigned char r){
        unsigned char x,y,p;
        x=0;
        y=r;
        p=-r/2;
        while(x<=y){
            Plot8(cx,cy,x,y);
            x=x+1;
            if(p>128){
                p+=2*x+1;
            }else{
                y--;
                p+=2*(x-y)+1;
            }
        }
    }
    Mike.
     
  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,755
    Likes:
    846
    Location:
    Rochdale UK
    If you come across a simple arc routine, let me know..
     
  8. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    9,772
    Likes:
    290
    Location:
    Brisbane Australia
    The way the circle routine works is the same as those nail and string curved paterns. The axes are at right angles in the circle case and a quarter circle is generated by working along "the nails". Using lines at different angles and lengths should give various arcs.

    Mike
     
  9. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,755
    Likes:
    846
    Location:
    Rochdale UK
    I know.... But a arc could cross the 90 degree, that means the 8 point routine won't do the job.. So if you come across one!! I have written one, but it's a little slow, too many iterations... if this and if that!! Ill convert it to asm to see if I can boost the speed..
     
  10. atferrari

    atferrari Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    2,733
    Likes:
    117
    Location:
    Buenos Aires - Argentina
    Long time I do not use one of these. From what I recall, not all manufacturer use CS1 ans CS2 in the same way. Besides the allocation of pins, that is what distinguish GLCDs from each other.
     
    Last edited: May 19, 2017 at 10:01 AM
    • Thanks Thanks x 1
  11. atferrari

    atferrari Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    2,733
    Likes:
    117
    Location:
    Buenos Aires - Argentina
    Hola granddad,

    I inherited from a failed replacement (difference in pins allocation) a brand new one. :)

    After searching for the datasheet of a quickly vanished manufacturer in Brazil, I realized that there were kind of discernible patterns among the variation for different brands. :happy:

    I finally compiled the data from several tens of datasheets and based on the pins allocated to power I could use mine successfully. The data is shown in the attached pdf. With my "electronic" PC down, it is good I got a proper back up handy. Hope you can wade through it.

    One day I should post my implementation of the John Conway's game "Life". A piece of judicious programming I enjoyed much. Really.

    ¡Buena suerte!
     

    Attached Files:

  12. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    699
    Likes:
    63
    Location:
    Worcestershire UK
    Thank you at , let wading commence...
     
  13. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    699
    Likes:
    63
    Location:
    Worcestershire UK
    ThanksM.jpg

    Mike, Not copy and paste of your code , but got lots of help etc, understand the true type working , just have to reinvent it for my project... Cheers.
     

Share This Page