element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Undestanding the pin assignment LCD i2C
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 18 replies
  • Subscribers 393 subscribers
  • Views 2174 views
  • Users 0 members are here
  • lcd
  • i2c
  • arduino
Related

Undestanding the pin assignment LCD i2C

onemikeoscar
onemikeoscar over 10 years ago

Hi everyone!

First i need to admit something hahaha, i'm spanish and in first place sorry for my rought english.

 

I'm here for Ben Show, it's a incredible show and i love it hahaha but i think that i doesn't matter now xD

I bought one i2c adapter for LCD in ebay (you can see it here) the problems came when i tried to start typing something.

I have had a lot of problems with the LyquidCristalI2C library, all of this problems are for the pin assignment, the last combination

that works was this: LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

My question now is How can i find the values of these parameters? I mean, i only try with the standard values but i think that it will have one way

to discover this values (maybe one datasheet or something else, i dont know).

 

I hope that you cand understand my question and again sorry for my english.

  • Sign in to reply
  • Cancel

Top Replies

  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago +1
    There are two variations of the serial to LCD adapters floating around The chip on the board linked is a PCF8574 I2C 8 bit port expander http://www.ti.com/lit/ds/symlink/pcf8574.pdf and as such does not…
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago in reply to onemikeoscar +1
    So to see more about that I would suggest simply looking at the library CPP file (It will be the same name as the header file (.h) but with a .CPP extention instead, with luck it is commented but at least…
  • billpenner
    billpenner over 10 years ago in reply to Robert Peter Oakes +1
    I think the codes relate to the LCD not the expander. As I understand the port expander only translates the serial data to parallel. the actual code would be the same. Is this correct. Maybe I am looking…
Parents
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago

    There are two variations of the serial to LCD adapters floating around

    The chip on the board linked is a PCF8574 I2C 8 bit port expander  http://www.ti.com/lit/ds/symlink/pcf8574.pdf

    and as such does not support SPI even though the ebay add says it does

     

    so this is a standard library driver and it is probably connected in a standard way to what ever LCD display you hock it too providing it follows the 1602 / 2004 standard pin out which is most of them

     

    the codes needed for the display is found in the display documentation, not the I2C to LCD adapter and again is usualy following the Hitachi standard

     

    the standard driver and samples should all work for you

     

    What do you get on the display when you try to run the samples, have you verified your using the library for the PCF8574 ?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • onemikeoscar
    onemikeoscar over 10 years ago in reply to Robert Peter Oakes

    Yes, finally I could run one example with succes, the problem is that i dont know how to know where is the docuementation for the values of the constructor

     

    LiquidCrystal_I2C LCD(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address

     

    I know that 0x27 is the address of device but i dont know how to find the correct values of the next parameters, for example 2,1,0....

    I know also that 2 is for enable, 1 is for rw and so on... But WHY? hahaha, i found the correct values trying with differents examples

    but I always want to understand all that I wrote in my programs because if in the future I need to modify this program how I will do it? hahahah

     

    Thanks image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • bobcroft
    bobcroft over 10 years ago in reply to billpenner

    Bill, Jose,

                        The codes in the constructor reflect the way the I2C to parallel chip (PCF8574) is connected to the LCD.  These devices use the 4 bit data transfer method from the 8574 to the LCD. So in the example lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE).  The numbers refer to En, RW, RS, data pins 4,5,6,7, 3 is the back light control pin and POSITIVE is the back light polarity.  The pins referred to are on the LCD module linked to the 8574 chip.  Thus provided the constructor is correct the data sent to the LCD via the I2C interface will be displayed correctly.  The code written and programmed into the Arduino will work correctly provided the constructor for the particular I2C to LCD module reflects the wiring between the 8574 and the LCD module.  Bill is therefore correct in his understanding.

    I do have a PDF file that shows the connections of one LCD backpack module but I don't know how to attach it to this note.  If anyone wants it please email me.

     

    Now the rub!  As Peter has noted there is very little information on these devices apart from that on yourduino.com, so to answer Jose'e question specifically there is no easy way to find the correct constructor for these back packs unless the supplier has the information.  Alternatively a logic analyser could be used.

    Again as Peter noted much of the information above can be gleaned from the comments of the library files.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • billpenner
    billpenner over 10 years ago in reply to bobcroft

    Yep, looks like the most complete data may be on Sparkfun.com. go there and lookup the LCD module their number (LCD-00790) the datasheet seems to be the most complete.

    It is difficult to comprehend but the data is there for all the codes for the display.

    Thanks guys.

    Bill

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • onemikeoscar
    onemikeoscar over 10 years ago in reply to bobcroft

    Ok I think more or less I am understanding now how it works. I think that the main problem here is the documentation of all of these modules but anyway...

     

    Thanks to all of you, Is a great pleasure talk with you

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago in reply to onemikeoscar

    Your welcome

     

    Any please if you will, mark helpful and or Correct answers for people that have helped you as it earns us badges and points

     

    Thanks

    Peter

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • onemikeoscar
    onemikeoscar over 10 years ago in reply to Robert Peter Oakes

    Ok hahaha image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • billpenner
    billpenner over 10 years ago in reply to onemikeoscar

    Hey, José

    Peter is serious. We  all enjoy helping but it is nice to be recognized as helpful.

    Bill

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • onemikeoscar
    onemikeoscar over 10 years ago in reply to billpenner

    Yes, I know but i already have clicked in "i like button" image Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 10 years ago in reply to Robert Peter Oakes

    Unfortunately it selected as a question....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • onemikeoscar
    onemikeoscar over 10 years ago in reply to mcb1

    Sorry, i dont understand, i'm newby in this forum and spanish also and for this reason sometimes i dont understand hahaha.

    I clicked in button "like" in all replies. Is it all ok?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 10 years ago in reply to onemikeoscar

    Sorry, i dont understand

    When you first entered this post, it should have asked if you want to make this a question (and given you a short time to make the choice)

     

    When you mark it as a question, it allows you to mark the answers helpful (3 ... I think) or correct (1)

    http://www.element14.com/community/docs/DOC-68325/l/earning-points-for-sharing-your-expertise-on-element14-community

     

    You might be able to go back and change it ...according to this.

    http://www.element14.com/community/message/154267/l/re-updatingediting-a-discussion-to-indicate-as-a-clear-question#154267

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • mcb1
    mcb1 over 10 years ago in reply to onemikeoscar

    Sorry, i dont understand

    When you first entered this post, it should have asked if you want to make this a question (and given you a short time to make the choice)

     

    When you mark it as a question, it allows you to mark the answers helpful (3 ... I think) or correct (1)

    http://www.element14.com/community/docs/DOC-68325/l/earning-points-for-sharing-your-expertise-on-element14-community

     

    You might be able to go back and change it ...according to this.

    http://www.element14.com/community/message/154267/l/re-updatingediting-a-discussion-to-indicate-as-a-clear-question#154267

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube