Interfacing with Arduino I2C LCD


Closed Thread
Results 1 to 40 of 48

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: Interfacing with Arduino I2C LCD

    16F629A ?
    might you mean 12f629 ?

    if so you need to set the " lcd " pins to digital
    Warning I'm not a teacher

  2. #2
    Join Date
    Mar 2008
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: Interfacing with Arduino I2C LCD

    Sorry, I should have said 16F628A. I did set my pins as digital? I want to display data from my program but that seems far away at this point?? I cut the program down to the below lines and I get a custom character and a blinking cursor the backlight stays on. I guess that is progress ?

    Thank You!

    ;----[16f628A Hardware Configuration]-------------------------------------------
    #config
    __config _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _LVP_OFF & _CP_ON & _BODEN_OFF
    #endconfig


    SDA var porta.7
    SCL var porta.6
    ;----[Initialize Hardware]------------------------------------------------------
    CMCON = 7 'CHANGES PORTA TO DIGITAL
    ;----[Setup LCD using PCF8574 Port Expander]------------------------------------
    LCD_Addr CON $7E
    INCLUDE "LCD_PCF8574.pbp" ; Include LCD module for PCF8574

    ARRAYWRITE LCD_Buff,[$FE,$50,$04,$0A,$15,$0E,$04,$0A,$0A,$00]:LCD_WriteBuff ' #2


    Main:

    GOTO Main

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: Interfacing with Arduino I2C LCD

    there is more info here . note the slightly differing versions of the include
    INCLUDE "LCD_PCF8574.pbp" ; Include LCD module for PCF8574
    INCLUDE "LCD_PCF8574a.pbp" ; Include LCD module for PCF8574

    http://support.melabs.com/threads/10...hlight=PCF8574
    http://support.melabs.com/threads/10...hlight=PCF8574
    ps
    LCD_Addr CON $7E is way different to addr used in above threads
    Warning I'm not a teacher

  4. #4
    Join Date
    Mar 2008
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: Interfacing with Arduino I2C LCD

    Richard thank you for your help.

    I have read most of the threads but will read them again. I will find and download both version of the include. On Arduino this is the Initialization for my display the 3F turns into 7E when you shift the bits one to the left.

    "LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)"

    I have used serial lcd displays in the past with no issues. So far I am not a fan of this i2c version. I think someone is missing a market for easy to use i2c displays?

    Thanks again!
    Last edited by n0yox; - 27th February 2017 at 01:50.

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


    Did you find this post helpful? Yes | No

    Default Re: Interfacing with Arduino I2C LCD

    "LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)"

    interpreted as [( 7bit_addr, EN, RW, RS, D4, D5, D6, D7, Backlight, POLARITY) ]

    the PCF8574 datasheet indicates the 7bit addr range is 0x20--0x27

    0x3f is not valid afaik.


    default with a0:2 open = 7bit_addr of 0x27 , pbp addr would be $4e
    Last edited by richard; - 27th February 2017 at 02:38.
    Warning I'm not a teacher

  6. #6
    Join Date
    Mar 2008
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: Interfacing with Arduino I2C LCD

    Quote Originally Posted by richard View Post
    interpreted as [( 7bit_addr, EN, RW, RS, D4, D5, D6, D7, Backlight, POLARITY) ]

    the PCF8574 datasheet indicates the 7bit addr range is 0x20--0x27

    0x3f is not valid afaik.


    default with a0:2 open = 7bit_addr of 0x27 , pbp addr would be $4e
    I see on the data sheet for the PCF8574 you are right I used the Arduino i2c address finder to get the address. I have tried it using the 4E address and get nothing however with the 7E I do get some response from the display. I am still trying to understand the Initialization string and how to use it if you can offer guidance it would be appreciated. This is a little beyond my current ability but I will continue to try to learn and get this project going.

    Thank You!

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: Interfacing with Arduino I2C LCD

    did it work with the Arduino sketch ?
    if so what was the init command [I assume a0:2 are open]
    LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE) or LiquidCrystal_I2C lcd(0x27, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE);
    afaik there is at least two types there may be others.
    if the addr is not between 0x20 and 0x27 then its a going to be different animal and the include files may need modification

    would not hurt to trace out the cct and see what bits are wired to rs,e,rd/wr etc
    Warning I'm not a teacher

Similar Threads

  1. Another Arduino clone that uses a PIC
    By dhouston in forum PBP & Amicus18
    Replies: 0
    Last Post: - 7th March 2012, 19:14
  2. Arduino ?
    By Michael in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 13th September 2011, 19:50
  3. How do I operate an Arduino I2C LCD
    By menta in forum General
    Replies: 8
    Last Post: - 13th July 2011, 02:28
  4. Arduino
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st July 2011, 19:11
  5. ARDUINO? -- what is it?
    By Michael in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 18th August 2009, 00:19

Members who have read this thread : 4

You do not have permission to view the list of names.

Posting Permissions

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