I2C LCD help needed



THE BOOK of DT's INTERRUPTS is an organization of interrupt service routines and other works written by Darrel Taylor, RIP.

Interrupt routines are arranged per Darrel's original list. Darrel Taylor's Instant Interrupts are an extension of the work of Tim Box whom in October of 2002 wrote INT_CTRL.pbp

Many of the forum members felt this is a long overdue project.

THE BOOK of DT's INTERRUPTS
will be a valuable resource and a tribute to Darrel Taylor the "Fanatical Contributor".

THE BOOK of DT's INTERRUPTS is located at http://dt.picbasic.co.uk/

+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2005
    Location
    Cocoa, Florida
    Posts
    42

    Default I2C LCD help needed

    During the pandemic I had to lay out boards using the chips to hand, in this case 16F1503.
    Not enough pins for a parallel LCDout, so I used I2C LCDs intended for Arduino. How difficult could it be?
    I ended up using TTL232 displays, but would like to get the I2C working.

    Tried all the snippets on here. Can't find DT's but there is a post with his (possibly modified) library.
    Links to PBP3 forum no longer work. I understand I2C and the H27 is really H4E/4F thing.
    These are 8x2 using the Ti version of the Phillips T expander.
    Anyone with working, commented code?
    Thanks.

  2. #2

    Default Re: I2C LCD help needed

    Code is modified from Steve Earl have left his code but remmed out stuff I did not use.

    Biggest problem is getting the address correct.
    Picture is adapter used. (Ebay) LCDs with adapter attached can be ones that the address is fixed.

    As it came it was 0x27 Dec 39 but I had to double it for pbp to 0x4e dec 78.
    Tried to put the code in code tabs but not all would appear, so I zipped it as picforum.zip

    Code is for 12f683 but will/should work with any other pic, just change the ports and pic config

    Name:  BCBA100201_LCD I2C Serial Interface Adapter Board_1.JPG
Views: 49
Size:  479.3 KB

    picforum.zip

    ^^^^^^ ZIP File
    Last edited by aerostar; - 13th July 2022 at 18:52. Reason: typo

  3. #3

    Default Re: I2C LCD help needed

    Just becareful with lcds that have backpacks already attached, some do not have the SDA SCL pullups on board, hence may not work. I hooked up a lcd with backpack fitted and it would not work until 10Ks were added.

    Picture below is the backpack to avoid, apart from the fact you cannot change the address even if you wanted.

    Name:  no resistors backpak.jpg
Views: 44
Size:  100.6 KB

  4. #4
    Join Date
    Mar 2005
    Location
    Cocoa, Florida
    Posts
    42

    Default Re: I2C LCD help needed

    Thanks, I'll try this.

    > As it came it was 0x27 Dec 39 but I had to double it for pbp to 0x4e dec 78.
    $27 is the code not counting the R/W bit. Some people shift this one bit and add the R/W bit making $4E and $4F.
    This is clear in the Ti or NXP expander datasheets.

    There are pullups on my boards. The signals look clean.

    My hardware looks more like this:

    Name:  s-l500 (3).jpg
Views: 37
Size:  60.9 KB

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,118

    Default Re: I2C LCD help needed

    As it came it was 0x27 Dec 39 but I had to double it for pbp to 0x4e dec 78.
    arduino uses a 7bit i2c address , so everything arduino-ish complies with that convention , pbp uses an 8bit i2c address scheme
    no big deal just 1 shift left gets there from the 7 bit address.


    add the R/W bit making $4E and $4F.
    and that is a waste of time and effort, pbp i2c commands set or clear the r/w bit automatically
    regardless.

    google "pbp ic2 lcd"

    you will find dt's version and an alternative for board with wiring variation
    there may other variations also
    you may need to trace the connections to verify code matches
    Last edited by richard; - 17th July 2022 at 05:00.
    Warning I'm not a teacher

Similar Threads

  1. I2C LCD
    By midali in forum General
    Replies: 46
    Last Post: - 8th January 2021, 22:52
  2. help to test a I2C LCD
    By lutherblisset in forum Code Examples
    Replies: 0
    Last Post: - 25th August 2017, 19:37
  3. Pcf8574 i2c lcd
    By cesar35 in forum General
    Replies: 2
    Last Post: - 25th August 2017, 15:22
  4. I2C CONFUSION, Help needed please
    By FromTheCockpit in forum mel PIC BASIC Pro
    Replies: 42
    Last Post: - 29th July 2013, 00:54
  5. Sample code for I2C text LCD needed
    By Alexey in forum Code Examples
    Replies: 4
    Last Post: - 15th September 2011, 01:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts