lcd_dog_m_8

control for DOG-M (ST7036 based) LCD's

Author Richard Zengerink, Copyright © 2008, all rights reserved
Adapted-by
Compiler =2.4

Description

   Simple interface for DOG-M (st7036) alphanumeric LCD screens.
   Screens can range from 1x8  (1 lines, 8 chars), 2x16 and 3x16.
   Uses 8 bit wide datapath + 2 handshake lines (total 10 PIC pins).
   Expects: - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
            - 1 port for data: 'lcd_dataport'
   *
   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 3 lines
         const byte LCD_CHARS    = 16             -- 8, 16 chars per line
      and variables (aliases):
         var   byte lcd_dataport  is  portA       -- 8 data pins
         var   bit  lcd_en        is  pin_b0      -- trigger
         var   bit  lcd_rs        is  pin_b1      -- cmd/data select
   2. Include this library.
   and somewhere before actually using the lcd:
   3. Set the chosen LCD dataport and handshake pins to output:
         portA_direction     = all_output
         pin_b0_direction    = output
         pin_b0_direction    = output
   4. Call lcd_init() to initialize the lcd controller.
   Above is an example for a 2x16 LCD:
     portA are is used for data, pins 0 and 1 of portB are
     used for handshake. Any other available port and handshake pins
     could be used (provided these are configurable for output).
.
   Available functions for application programs:
.
     _lcd_write()                     sends byte from value to
                                            register of the lcd  and
                                            shift cursor position 1 right
.
     _lcd_write_data()                write data to lcd using
                                            _lcd_write() lcd_rs high
.
     _lcd_write_command()             write command to lcd using
                                            _lcd_write() lcd_rs low
.
     lcd_init()                             initialize the LCD controller


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • lcd_init()

    Initialize display in 1 and 2 or 3 line, display on, no cursor shown an cursor
    moves to the right.
    
    

Private

Functions


Related samples

No sample found