Interfacing I2c LCD with PIC

Discussion in 'Embedded Systems and Microcontrollers' started by jj_alukkas, Aug 2, 2011.

  1. jj_alukkas

    Thread Starter Well-Known Member

    Jan 8, 2009
    751
    5
    I recently salvaged out a 98 x 64 - 5 line mono LCD from a Motorola T190 mobile phone. Since its a graphical display, Im curious to work on it but it uses an I2C to get its data. Could somebody please help me in Hi Tech C on how to use this with a PIC? A simple sample program or a library or a circuit diagram would be helpful! This is the pinout diagram I found out after a lot of googling. Thanks a lot!

    [​IMG]
     
    • ckt.png
      ckt.png
      File size:
      38.5 KB
      Views:
      178
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
  3. jj_alukkas

    Thread Starter Well-Known Member

    Jan 8, 2009
    751
    5
    Wow.. That lmgtfy.com thingy was so awesome... I tried googling before posting.. but I always added 'PIC' along with the Hi tech c and it gave me nothing usefull. The main point I made this post was that everywhere it asks for a I2c write address like at 0x78h, how do I find that one for this lcd when I dont have the datasheet?? Thank You.
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    Oh, sorry. I thought you had that part. Is there any part numbers on the display? Slogging ramdom info at it will probably be frustrating and useless, and nothing is coming up on it so you may be the first one trying to hack one.

    (LMGTFY is lots of fun :D)
     
  5. jj_alukkas

    Thread Starter Well-Known Member

    Jan 8, 2009
    751
    5
    I found one hacked project video with the same display on youtube but that was with ATmega8 and the person had not linked his code nor any other details other than the uC and the display from Motorola T190. Tried contacting the person too, but no reply. I tried googling all what I could find on the display, but returned nothing. it reads GPM131D0 and B-KB331726. Now the only hope remaining is that most motorola mono low res displays use address ranging between 0x72h to 0x78h, so give it a trial and error. :D

    I found a sample code to drive an LCD through I2c with a pic 16 HERE Could you please tell me if this is complete? Its looks so short, Im a complete beginner to this, so confused. :confused: Another one here I. I just need to get this lcd started, rest I will try somehow :)

    Both the codes show no sign of which ports to connect to RES, SCL and SDA of lcd???
     
    Last edited: Aug 3, 2011
  6. jj_alukkas

    Thread Starter Well-Known Member

    Jan 8, 2009
    751
    5
    Now a new doubt. Is it even possible to use I2C to drive an LCD using a PIC16F628 which has no hardware I2c??
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    Oh sure it's possible, maybe even easier then using the hardware module. I use the hardware module but it is never simple, especially when you're making a slave device. With a software I2C you can put the I/O pins most anywhere you want.

    I'll peek around a bit for some sample code. You're looking for "bit bang" or "bitbang" code samples.

    Just found some C code (don't know what compiler) here. It has a nice tutorial too.
     
    Last edited: Aug 3, 2011
  8. jj_alukkas

    Thread Starter Well-Known Member

    Jan 8, 2009
    751
    5
    Thank You, I will try compiling some programs and get it to 'talk' :p I donno how much resemblance there is between just I2c communication and using it for an lCD data. BTW, could you tell me what this NRSTOUT pin is in the first diagram I posted? It goes to /RES marked on display terminal. Can I leave it out or should it be grounded?
     
  9. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    /RES looks like an active low reset pin. Most screen displays I've seen want to get a reset signal after the power is up and stable.

    Don't just ground it or leave it out. Keep NRSTOUT high for the most part, but do an init sequence on start up something like:

    Code ( (Unknown Language)):
    1.  
    2.   NRSTOUT = 1;
    3.   DelayMs(100);
    4.   NRSTOUT = 0;
    5.   DelayMs(100);
    6.   NRSTOUT = 1;
    I'm just guessing how long the reset needs be but that should cover it, and you can try cutting it back once you see your screen working.
     
  10. jj_alukkas

    Thread Starter Well-Known Member

    Jan 8, 2009
    751
    5
    Oh thanks a lot.. So 3 ports in total should do the job. Let me give it a shot!
     
Loading...