• AVR Freaks

Hot!LCD / 16x2 Character Displays : 8Bit MCU only

Author
TymerTopCat
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2016/11/21 13:59:00
  • Location: 0
  • Status: offline
2019/10/20 22:32:35 (permalink)
0

LCD / 16x2 Character Displays : 8Bit MCU only

Hi, I am a 18 year C/C++/C# software engineer new to PIC Micros and Embedded Systems.
I am only interested in 8-Bit MCUs. Not interested in 16bit/32Bit MCUs for this application.
Question:
How does one properly communicate with a basic 16x2, 20x2 and 20x4 LCD Character displays in the 21st century using any modern 8-bit MicroChip MCU?
I understand that there used to be library for PIC micros to talk to 4/8 bit parallel displays, but the library has been removed from MpLabX environment.
Do I have to code my own LCD Library?
Is it possible to use the latest version of MPLabX and MCC Code Configurator to create LCD Library routines?
 
I am fully aware of SPI / I2c interfaces for newer LCD Displays (New Haven has some super nice OLEDs (SPI/I2C).
I'm not ready for SPI / I2c just yet, I want a parallel library first, then I learn SPI /I2c.
 
What would help me the most as I claw my way up the Embedded Systems ladder.
1. Tell me how to operate MCC code configurator to generate LCD Library. (Probably impossible).
2. A working C library for any 8-Bit Microchip MCU, (MPlabX only).
3. Code Example of how to write to (New Haven OLED display), SPI communication using a MCU with SPI.
4. If Microchip has decided to kill LCD library, so be it. I will have to learn how to use SPI serial displays.
 
Thanks.
-TymerTopCat 10/20/2019
 
#1

3 Replies Related Threads

    Mysil
    Super Member
    • Total Posts : 3489
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: LCD / 16x2 Character Displays : 8Bit MCU only 2019/10/21 04:10:22 (permalink)
    +1 (1)
    Hi,
    There have been several alternative codes published in Microchip Forum during many years.
    Generally, interfacing 8 bit PIC to Hitachi HD44780 character display controller, using 8 bit or 4 bit parallel connection is often regarded as a learning experience that any developer should be able to do by himself.
     
    Discription of how the LCD desplay controller work, may be found in Wikipedia,
    and in the Datasheet for HD44780 display controller.
     
    There is a tutorial here:  https://www.studentcompanion.co.za/interfacing-lcd-display-with-pic-microcontroller-xc8/
     
    There is library code by vloki here:
    http://picforum.ric323.com/viewtopic.php?f=40&t=210&sid=4bfe42ad370a4da998fe4a43c80c3229
    that have been updated to use with XC8 compiler in C99 mode.
     
        Mysil
    #2
    pcbbc
    Super Member
    • Total Posts : 1388
    • Reward points : 0
    • Joined: 2014/03/27 07:04:41
    • Location: 0
    • Status: offline
    Re: LCD / 16x2 Character Displays : 8Bit MCU only 2019/10/21 05:33:50 (permalink)
    +1 (1)
    The problem with ready rolled libraries and small footprint 8-bit devices is that they are often bloated with features you do not need:
    * ability to use parallel and serial (you'll only need one)
    * ability to use configurable PORT pins (can be hard-coded in any one implementation)
    etc.
    Consequently, as Mysil says, I expect most developers roll their own customised library routines from scratch.
     
    Sooner or later, for any serious PIC project, you are going to have to "get your hands dirty" and mess with the hardware directly.  You might as well start here.
     
    I'd also steer clear of MCC as well.  It's probably fine for getting something up and running quickly just to "experiment" with the hardware, but for any serious project I find the code it produces to be bloated unmaintainable mess.
    #3
    TymerTopCat
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2016/11/21 13:59:00
    • Location: 0
    • Status: offline
    Re: LCD / 16x2 Character Displays : 8Bit MCU only 2019/10/22 00:15:06 (permalink)
    0
    pcbbc
    Sooner or later, for any serious PIC project, you are going to have to "get your hands dirty" and mess with the hardware directly.  You might as well start here. 
    I'd also steer clear of MCC as well.  It's probably fine for getting something up and running quickly just to "experiment" with the hardware, but for any serious project I find the code it produces to be bloated unmaintainable mess.



    Thanks for the reply, I figured that I would have to roll my own LCD code. I just wanted to ask the question in the case there was something useful in MCC or the latest version of MPLabx.
    Regarding MCC:
    Yeah, I haven't heard too many good things about MCC. I plan to only use it as a learning crutch. The seasoned developer's say it's best to create your project configuration bits manually.
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5