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

Discussion in 'Microcontrollers' started by AtomSoft, Jul 30, 2008.

  1. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Just got my GLCD in yesterday and went programming. Im using a PIC18F248 and noticed im going to need some more memory :D or at least learn SD. I was wondering if anyone can recommend a larger dsPIC or something. Here are some images of what ive got so far. Im like a fat kid in the candy store lol (so happy)

    So can someone recommend a new PIC and or some memory device.
    I can only fit about 2 pages on both sides. Also for some reason i have to have it upside down?

    When i first got it:
    [​IMG]

    [​IMG]

    Soldering Skills (even though lots of space):
    [​IMG]

    My Logo:
    [​IMG]

    It at work: (yay!)
    [​IMG]

    I know... i know... its messy but heh its easier to move wiers if anything.
     
  2. Krumlink

    Krumlink New Member

    Joined:
    Aug 10, 2007
    Messages:
    2,080
    Likes:
    20
    Location:
    Michigan, USA
    Why do you need more memory? Why not a bigger 18F PIC? Try a 18F4620, it is as bill referred to it as "A beast" :)
     
  3. richard.c

    richard.c New Member

    Joined:
    May 28, 2007
    Messages:
    168
    Likes:
    4
    Location:
    England
    Hi,

    That looks a great start - it sure is a good feeling when it finally displays.

    Have you coded it in MCC18 or Assembler ?

    Think you might find your upside down thing is one of the glcd initialisation parameters.

    If you are wanting to create your own fonts - your might find this link / utility very handy - it also has a couple of fonts there for you to try.
    http://www.elvand.com/en/LFG.asp

    Richard
     
  4. dave

    Dave New Member

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


     
  5. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.

    It only seems upside down because you're used to character LCD's. Your GLCD is right side up. It's your brain that's upside down. :p
     
  6. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    Would it look upside down to Pommie "down under" (grin)?
     
  7. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    lol futz and mike.

    Futz no one told me its rotated for the GLCDs. Well i just read something on a site and it seems there is a sticker on the back which will tell you if its Top Side or Bottom Side. Anyone got some ideas on how to store large amount of bytes for example 300 bytes and be able to pull them out 1 by 1. I used a unsigned char and it works well but the max allowed is 255 by the whole program. I rewrote it to work on MCC18.

    I have full version now. But anyway... Any thoughts on the code?
     
  8. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    If your data is static (for display - doesn't need to be changed) you can store it in program memory like this:
    Code (text):
    rom char *alpha1 = {
        0x3e,0x51,0x49,0x45,0x3e,   //0
        0x00,0x42,0x7f,0x40,0x00,   //1
        0x72,0x49,0x49,0x49,0x46,   //2
        0x22,0x49,0x49,0x49,0x36,   //3
        0x0f,0x08,0x08,0x7f,0x08,   //4
        0x2f,0x49,0x49,0x49,0x31,   //5
        0x3e,0x49,0x49,0x49,0x32,   //6
        0x41,0x21,0x11,0x09,0x07,   //7
        0x36,0x49,0x49,0x49,0x36,   //8
        0x26,0x49,0x49,0x49,0x3e,   //9
        0x7c,0x0a,0x09,0x0a,0x7c,   //A
        0x7f,0x49,0x49,0x49,0x36,   //B
        0x3e,0x41,0x41,0x41,0x22,   //C
        0x7f,0x41,0x41,0x41,0x3e,   //D
        0x7f,0x49,0x49,0x49,0x41,   //E
        0x7f,0x09,0x09,0x09,0x01,   //F
        0x3e,0x41,0x49,0x49,0x3a,   //G
        0x7f,0x08,0x08,0x08,0x7f,   //H
        0x00,0x41,0x7f,0x41,0x00,   //I
        0x20,0x40,0x40,0x40,0x3f,   //J
        0x7f,0x08,0x14,0x22,0x41,   //K
        0x7f,0x40,0x40,0x40,0x40,   //L
        0x7f,0x02,0x04,0x02,0x7f,   //M
        0x7f,0x04,0x08,0x10,0x7f,   //N
        0x3e,0x41,0x41,0x41,0x3e,   //O
        0x7f,0x09,0x09,0x09,0x06,   //P
        0x3e,0x41,0x51,0x21,0x5e,   //Q
        0x7f,0x09,0x09,0x09,0x76,   //R
        0x26,0x49,0x49,0x49,0x32,   //S
        0x01,0x01,0x7f,0x01,0x01,   //T
        0x3f,0x40,0x40,0x40,0x3f,   //U
        0x1f,0x20,0x40,0x20,0x1f,   //V
        0x7f,0x20,0x10,0x20,0x7f,   //W
        0x63,0x14,0x08,0x14,0x63,   //X
        0x01,0x02,0x7c,0x02,0x01,   //Y
        0x61,0x51,0x49,0x45,0x43};  //Z
    That syntax is a BoostC thing only. Other compilers use different syntax to do the same thing.
     
  9. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    void loadimg(rom char *image, unsigned int len);...

    unsigned rom char toplogo_bmp[1024] = ...

    To call it:
    loadimg(&toplogo_bmp[0], 1024);

    I was able to do it using the above. Now i put a full screen logo! Heres a PIC* (lol get it?)

    I actually figured it out reading the manual (thx tho futz i appreciate the help buddy! (everyone else also))

    [​IMG]
     

    Attached Files:

    • 5.jpg
      5.jpg
      File size:
      285.1 KB
      Views:
      5,057
    Last edited: Jul 30, 2008
  10. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,008
    Likes:
    316
    Location:
    Brisbane Australia
    Congrats on getting it working.

    As for storing screen images, I used a 16f886 and used the first 4k for code and the second 4k to store 4 screen images. To copy the screen from memory to the GLCD took 16mS and to write the screen to memory took (I think) around 100mS. I later added a 1M I²C EEPROM and used that to store a further 128 screen images.

    Mike.
     
  11. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    any links to the 1m memory? I just learned i2c and would love to intertwine the 2 :D

    Here is Futz Font (well i seperated it into NUMbers and ALPHAbets). This just show the numbers side. Also i made it so once it hits 0x7F (Pixel 63 on the left side) it will jump to right side and start from y=0x40 (pixel 0). Whatcha think?

    [​IMG]
     

    Attached Files:

    • 6.jpg
      6.jpg
      File size:
      305.4 KB
      Views:
      4,900
  12. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,008
    Likes:
    316
    Location:
    Brisbane Australia
    You can get the EEPROM from Microchip (link) about $4 each. If you have the basic I²C routines, they are very easy to use.

    Mike.
     
    Last edited: Jul 30, 2008
  13. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    yeah i got basic routines. Read / Write and all working stuff. Im building a programmer for i2c eeprom. So i can send data straight to it from a terminal program. (im making program also :D ) Its in the works but will be done in couple days.

    Thanks!
     
  14. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Ill get a few SOICs and PDIPs. 1 question ... the "SOIC 208mil" the 208mil is the length of the chip right?
     
  15. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,008
    Likes:
    316
    Location:
    Brisbane Australia
    The 208mil is the package width without the pins. However, in 8 pin devices the width and length are the same.

    Mike.
     
  16. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    What is really useful is havening 1KB of memory to spare. Because thats how much memory it takes to store a full screen image in ram. What this alows you is to have a buffer. It sppeds things up a great deal.

    I have made a extensive GLCD lib in MPLAB for the 16bit family. It was developed with a dsPIC30F4011 . It could draw 100 pictures of 64x64 at any Y position (not multiples of 8 or pages) with OR XOR or AND merge with background plus make them bounce around with simple physics utilizing floating point math.And all of this ran at about 30 fps. More qould be sqezed out of it if i overcooked the pic to 40MIPS (its rated for 30MIPS but seems to work fine at 40)

    I can make the code available if anyone wants it.With a little tweaking it should run on a 18F too.
     
  17. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    yes but i need a starting point. I dont have any dsPICs (yet) so i cant use one of course.
     
  18. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    Well you can probably get it to compile for a 18F if it has enough RAM. But you need to change a few SFRs in the initialization and the C file that sends the data to the display. Altho it may be a tad slow on a 18F without optimizing the code a bit, but nothing serious.

    Oh and if you want to display text you can use my font. Its not the best font but it gets the job done.
     
  19. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    I have it working on a 18F right now with no issue. Where can i get your fonts?
     
  20. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    i think there in "font.h" . There should be a rom constant array in there.Its about 2KB

    The font contains 255 ASCII characters, each character is 8x8 pixels.To draw a character you jump to 8*ascii and then print 8 bytes from it to the display.
     
  21. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    dude check page 1 i already know how to put it on screen i used futz fonts before http://www.electro-tech-online.com/threads/glcd.41023/#post332104

    Thanks for the tips tho.. Ill post my code give me a minute to make sure not to ugly :D

    Sorry if not full of comments. Its like 7 ish am here and im still soo tired and my body hurts from work. So i need to relax. But here it is.

    EDIT: UPLOADED the new (right) file.
     

    Attached Files:

    Last edited: Aug 2, 2008

Share This Page