element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Adafruit 16x2 LCD library does not work on 512mB board.
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 19 replies
  • Subscribers 676 subscribers
  • Views 2457 views
  • Users 0 members are here
  • raspberry_pi
Related

Adafruit 16x2 LCD library does not work on 512mB board.

wallarug
wallarug over 13 years ago

Question say it all.

 

How do I fix this?  I need an updated .pyc with corrects made for the new pin outs.  Where can I find an updated copy for rev2 board?

  • Sign in to reply
  • Cancel
  • fustini
    fustini over 13 years ago

    Hi - is this the Python code from Adafruit that you are using? 

     

    https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/tree/master/Adafruit_CharLCD 

     

    I see it referenced on the character LCD tutorial:

    http://learn.adafruit.com/drive-a-16x2-lcd-directly-with-a-raspberry-pi/overview 

     

    I've not tried it out myself yet so don't have any particular insight.  However, I think a good way to get help would be to raise a issue in that GitHub repo:

    https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/issues

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 13 years ago in reply to fustini

    Could you do that for me?  I don't have an account there and don't know how it works.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 13 years ago in reply to fustini

    Drew Fustini wrote:

     

    Hi - is this the Python code from Adafruit that you are using? 

     

    https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/tree/master/Adafruit_CharLCD 

     

    I see it referenced on the character LCD tutorial:

    http://learn.adafruit.com/drive-a-16x2-lcd-directly-with-a-raspberry-pi/overview 

     

    I've not tried it out myself yet so don't have any particular insight.  However, I think a good way to get help would be to raise a issue in that GitHub repo:

    https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/issues

    Yes I am talking about the Python code referenced in the Tutorial.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • fustini
    fustini over 13 years ago in reply to wallarug

    Sure, I can raise an issue, but I think I need to get some more info first.  Do you mean that you believe Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCD/Adafruit_CharLCD.py is out of date and does not work? 

     

    My understanding of and experience with the 512MB Rev 2.0 Pi is that the P1 GPIO header (which the Pi Cobbler uses) is unchanged.  I've not noticed any differences switching between old and new Pi's in my own projects.  I'm going to try to wire up a 16x2 LCD on a breadboard with the Pi Cobbler like in the tutorial.  I've got Rev 1.0, Rev 1.0 + ECN0001, and 512MB Rev 2.0 Pi's so I can check if I experience any difference.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 13 years ago in reply to fustini

    Sounds good.  I an am pritty sure that I have wired it correctly because I got "???????????????" Accross the display.  I think it has something to do with the change involving GPIO21 and GPIO27.  That would be the only change that could affect it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 13 years ago in reply to fustini

    Problem found.  It is exactly what I thought...

    I think it has something to do with the change involving GPIO21 and GPIO27.  That would be the only change that could affect it.

     

    Before I tested with 512mb RPi, I did a test with my old rev1 board. = PASS

     

    Anyway, I found this out by connecting the 4th pin from the right to the pin 11 on the camera connector and...WOOH! It worked.

     

    Now all we need to do is work out how to fix this issue by rewriting the .pyc file that adafruit has kindly provided for us.

     

    Attached is the .pyc file along with some other files that they provide.

    Attachments:
    CharLCD_IPclock.py.zip
    Adafruit_CharLCD.py.zip
    Adafruit_CharLCD.pyc.zip
    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 13 years ago in reply to wallarug

    **ALERT**

     

    Fixed the problem...

    Change Line:

    def __init__(self, pin_rs=25, pin_e=24, pins_db=[23, 17, 21, 22], GPIO = None):

    to:

    def __init__(self, pin_rs=25, pin_e=24, pins_db=[23, 17, 27, 22], GPIO = None):

    Hope this helps someone and I hope that adafruit add in a checker for rev in updates of this software.

     

    EDIT:

    MUST ALSO DELETE .pyc FILE.  The program will recompile itself.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • fustini
    fustini over 13 years ago in reply to wallarug

    Thanks for the advise and sharing the solution.  I see I overlooked the pin change which you point out (under "JTAG Debug Support" on this page: http://www.raspberrypi.org/archives/1929).

     

    I didn't get a chance to wire up a LCD last night, but I'm looking forward to doing that tonight and taking advantage of your fix.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 13 years ago

    Hi Fergus,

    thank you, thank you, thank you for this....you saved my life.

    yoe

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 13 years ago in reply to Former Member

    Always willing to help. image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
>
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