lcd_hd44780_4

LCD library for HD44780 compatible LCDs, with 4 bits wide datatransfer

Author Rob Hamerling, Copyright (c) 2008..2009, all rights reserved.
Adapted-by Eur van Andel, Joep Suijs (refactoring)
Compiler >=2.4g

Description

   Nibble interface for HD44780 compatible alphanumeric LCD screens.
.
   Expects: - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
        and
            - 1 port nibble for data: 'lcd_dataport'
        or
            - 4 lines for data: 'lcd_d4' .. 'lcd_d7'
   note:    a 'port nibble' - the lower or higher 4 bits of a port - give
            faster and more compact code then random selected data lines.
.
   Directions for use of this library in application programs
   (in this sequence):
   1. Declare the following constants:
         const byte LCD_ROWS     = 2              -- 1, 2 or 4 lines
         const byte LCD_CHARS    = 16             -- 8, 16 or 20 chars per line
      and variables (aliases):
         var   bit  lcd_en        is  pin_A4      -- trigger
         var   bit  lcd_rs        is  pin_A5      -- cmd/data select
      and variables (aliases):
         var   byte lcd_dataport  is  portA_low   -- 4 data pins
      or
         var   bit  lcd_d4        is  pin_A3      -- databit d4 pin
         var   bit  lcd_d5        is  pin_A1      -- databit d5 pin
         var   bit  lcd_d6        is  pin_C0      -- databit d6 pin
         var   bit  lcd_d7        is  pin_C2      -- databit d7 pin
.
   2. Set the chosen LCD dataport and handshake pins to output:
         pin_A4_direction    = output
         pin_A5_direction    = output
      and
         portA_low_direction = all_output
      or
         pin_A3_direction    = output            -- set data pin as output
         pin_A1_direction    = output            -- set data pin as output
         pin_C0_direction    = output            -- set data pin as output
         pin_C2_direction    = output            -- set data pin as output
.
   3. Include this library.
.
   4. Call lcd_init() to initialize the lcd controller.
.
   Above is an example for a 2x16 LCD.
.
   See hd_44780_common for the LCD API.


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • lcd_init()

    Initialize LCD controller to 4-bit mode
    
    

Private

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_lcd_hd44780_4_4.jal
16f648a16f648a_lcd_hd44780_4_1.jal
16f67616f676_lcd_hd44780_4_4.jal
16f67616f676_lcd_hd44780_4_1.jal
16f69016f690_lcd_hd44780_4_4.jal
16f69016f690_lcd_hd44780_4_1.jal
16f72616f726_lcd_hd44780_4_4.jal
16f72616f726_lcd_hd44780_4_1.jal
16f72716f727_lcd_hd44780_4_1.jal
16f72716f727_lcd_hd44780_4_4.jal
16f81916f819_lcd_hd44780_4_4.jal
16f81916f819_lcd_hd44780_4_1.jal
16f876a16f876a_keyboard_lcd.jal
16f876a16f876a_t6603.jal
16f876a16f876a_lcd_hd44780_4_1.jal
16f876a16f876a_sht.jal
16f876a16f876a_rtc_lcd.jal
16f876a16f876a_tc77.jal
16f876a16f876a_lcd_hd44780_4_4.jal
16f877a16f877a_lcd_format.jal
16f877a16f877a_co2_t6603.jal
16f877a16f877a_keyboard_lcd.jal
16f877a16f877a_rtc_lcd.jal
16f877a16f877a_lcd_hd44780_4_1.jal
16f877a16f877a_lcd_hd44780_4_4.jal
16f8816f88_lcd_hd44780_4_1.jal
16f8816f88_lcd_hd44780_4_4.jal
16f88716f887_lcd_hd44780_4_1.jal
16f88716f887_lcd_hd44780_4_4.jal
18f123018f1230_lcd_hd44780_4_1.jal
18f232018f2320_lcd_hd44780_4_1.jal
18f232018f2320_lcd_hd44780_4_4.jal
18f245018f2450_lcd_hd44780_4.jal
18f455018f4550_lcd_hd44780_4.jal
18f468518f4685_lcd_hd44780_4_1.jal
18f468518f4685_lcd_hd44780_4_4.jal
18f631018f6310_lcd_hd44780_4_4.jal
18f631018f6310_lcd_hd44780_4_1.jal