Menu

Using LCDs

Help
Jonny!!!
2008-06-08
2013-05-30
  • Jonny!!!

    Jonny!!! - 2008-06-08

    I'm having a hard time finding documentation via the Google, or anything on the forum on how to use LCDs with MCU's. Any recommended reading?

    Thank you

     
    • Hugh Considine

      Hugh Considine - 2008-06-22

      Text based LCDs are pretty easy, they nearly all use the same controller chip and interface. Just connect up the data bus, enable, register select and read/write pins to the MCU, and connect the contrast pin up to a 10K pot connected to ground.

      Once the pins are all connected, set the right constants in GCBASIC. Here is an example of the code needed to do this:

      #define LCD_IO 4
      #define LCD_DB4 PORTD.4
      #define LCD_DB5 PORTD.5
      #define LCD_DB6 PORTD.6
      #define LCD_DB7 PORTD.7
      #define LCD_RS PORTD.0
      #define LCD_RW PORTD.1
      #define LCD_Enable PORTD.2

      You'll need to change the pins specified, but that's all. Then, use the Print, LCDInt, CLS and other LCD commands to display things. There is more information on these in the help file.

      If you're using a graphic LCD, then you're in for a lot more work! They are not anywhere near as standardised, and GCBASIC doesn't include any code for them. If you're trying to use one and you've not found anything helpful on the web, you'll have to find the datasheet and work it all out from scratch.

       
    • Nobody/Anonymous

      Wow, easier than I thought. Thanks!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.